ServiceNow · Arazzo Workflow

ServiceNow Upsert Contact

Version 1.0.0

Find a CSM contact by email and update it if it exists, otherwise create it.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub AutomationCloud ServicesDigital WorkflowsEnterprise PlatformITSMProcessesT1Workflow-AutomationWorkflowsArazzoWorkflows

Provider

servicenow

Workflows

upsert-contact
Create or update a CSM contact keyed on email.
Looks for an existing contact by email and either updates the matched contact or creates a new one.
3 steps inputs: email, firstName, lastName, phone, title outputs: createdContactSysId, updatedContactSysId
1
findContact
getContacts
Search for an existing contact whose email matches the supplied value, returning at most one record.
2
updateContact
patchRecord
Patch the matched contact through the Table API customer_contact table. The Contact API exposes no update endpoint, so the generic Table API is used to apply changes by sys_id.
3
createContact
createContact
Create a new CSM contact when no existing contact matched the email.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: ServiceNow Upsert Contact
  summary: Find a CSM contact by email and update it if it exists, otherwise create it.
  description: >-
    The contact deduplication pattern on the ServiceNow Contact API. The
    workflow searches for an existing CSM contact by email using an encoded
    query, branches on whether a match was found, and either patches the
    matched contact through the Table API customer_contact table or creates a
    new contact. The Contact API returns lists under a result array and create
    returns the new sys_id under a result string. Every request is written
    inline.
  version: 1.0.0
sourceDescriptions:
- name: contactApi
  url: ../openapi/contact-api-openapi.yaml
  type: openapi
- name: tableApi
  url: ../openapi/servicenow-table-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-contact
  summary: Create or update a CSM contact keyed on email.
  description: >-
    Looks for an existing contact by email and either updates the matched
    contact or creates a new one.
  inputs:
    type: object
    required:
    - email
    - firstName
    - lastName
    properties:
      email:
        type: string
        description: The email address used to match an existing contact.
      firstName:
        type: string
        description: The contact's first name.
      lastName:
        type: string
        description: The contact's last name.
      phone:
        type: string
        description: The contact's phone number.
      title:
        type: string
        description: The contact's job title.
  steps:
  - stepId: findContact
    description: >-
      Search for an existing contact whose email matches the supplied value,
      returning at most one record.
    operationId: getContacts
    parameters:
    - name: sysparm_query
      in: query
      value: "email=$inputs.email"
    - name: sysparm_limit
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      matchedSysId: $response.body#/result/0/sys_id
    onSuccess:
    - name: contactExists
      type: goto
      stepId: updateContact
      criteria:
      - context: $response.body
        condition: $.result.length > 0
        type: jsonpath
    - name: contactMissing
      type: goto
      stepId: createContact
      criteria:
      - context: $response.body
        condition: $.result.length == 0
        type: jsonpath
  - stepId: updateContact
    description: >-
      Patch the matched contact through the Table API customer_contact table.
      The Contact API exposes no update endpoint, so the generic Table API is
      used to apply changes by sys_id.
    operationId: patchRecord
    parameters:
    - name: tableName
      in: path
      value: customer_contact
    - name: sys_id
      in: path
      value: $steps.findContact.outputs.matchedSysId
    requestBody:
      contentType: application/json
      payload:
        first_name: $inputs.firstName
        last_name: $inputs.lastName
        phone: $inputs.phone
        title: $inputs.title
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      contactSysId: $response.body#/result/sys_id
    onSuccess:
    - name: done
      type: end
  - stepId: createContact
    description: >-
      Create a new CSM contact when no existing contact matched the email.
    operationId: createContact
    requestBody:
      contentType: application/json
      payload:
        first_name: $inputs.firstName
        last_name: $inputs.lastName
        email: $inputs.email
        phone: $inputs.phone
        title: $inputs.title
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      contactSysId: $response.body#/result
  outputs:
    updatedContactSysId: $steps.updateContact.outputs.contactSysId
    createdContactSysId: $steps.createContact.outputs.contactSysId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/servicenow-upsert-contact-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.