Cross-Provider Workflow

Salesforce Contact to SendGrid List Create and Import

Version 1.0.0

Create a Salesforce contact, build a SendGrid list, then import to it.

1 workflow 3 source APIs 2 providers
View Spec View on GitHub ArazzoWorkflowsCross-Provider

Providers Orchestrated

salesforce sendgrid

Workflows

salesforce-contact-to-new-sendgrid-list
Create a Salesforce contact, create a SendGrid list, then upsert.
Inserts a Contact in Salesforce, creates a new SendGrid Marketing Contacts list, then upserts the contact into the new list using the returned list id.
3 steps inputs: email, firstName, lastName, listName outputs: jobId, listId, salesforceId
1
create-sf-contact
$sourceDescriptions.salesforceRestApi.createRecord
Insert a new Contact record into Salesforce.
2
create-list
$sourceDescriptions.sendgridListsApi.CreateMarketingList
Provision a new SendGrid Marketing Contacts list.
3
import-contact
$sourceDescriptions.sendgridContactsApi.UpdateContact
Upsert the contact into the new SendGrid list.

Source API Descriptions

Arazzo Workflow Specification

crm-salesforce-contact-to-sendgrid-list-create-import-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Salesforce Contact to SendGrid List Create and Import
  summary: Create a Salesforce contact, build a SendGrid list, then import to it.
  description: >-
    A cross-provider workflow that captures a contact in Salesforce, provisions
    a new SendGrid Marketing Contacts list, and upserts the contact into that
    freshly created list. Demonstrates standing up a fresh email segment in the
    email platform and seeding it from a CRM record in one orchestration.
  version: 1.0.0
sourceDescriptions:
  - name: salesforceRestApi
    url: https://raw.githubusercontent.com/api-evangelist/salesforce/refs/heads/main/openapi/salesforce-rest-api-openapi.yml
    type: openapi
  - name: sendgridListsApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mc_lists_v3.yaml
    type: openapi
  - name: sendgridContactsApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mc_contacts_v3.yaml
    type: openapi
workflows:
  - workflowId: salesforce-contact-to-new-sendgrid-list
    summary: Create a Salesforce contact, create a SendGrid list, then upsert.
    description: >-
      Inserts a Contact in Salesforce, creates a new SendGrid Marketing Contacts
      list, then upserts the contact into the new list using the returned list
      id.
    inputs:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        listName:
          type: string
    steps:
      - stepId: create-sf-contact
        description: Insert a new Contact record into Salesforce.
        operationId: $sourceDescriptions.salesforceRestApi.createRecord
        parameters:
          - name: sobjectType
            in: path
            value: Contact
        requestBody:
          contentType: application/json
          payload:
            FirstName: $inputs.firstName
            LastName: $inputs.lastName
            Email: $inputs.email
        successCriteria:
          - condition: $statusCode == 201
          - condition: $response.body#/success == true
        outputs:
          salesforceId: $response.body#/id
      - stepId: create-list
        description: Provision a new SendGrid Marketing Contacts list.
        operationId: $sourceDescriptions.sendgridListsApi.CreateMarketingList
        requestBody:
          contentType: application/json
          payload:
            name: $inputs.listName
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          listId: $response.body#/id
      - stepId: import-contact
        description: Upsert the contact into the new SendGrid list.
        operationId: $sourceDescriptions.sendgridContactsApi.UpdateContact
        requestBody:
          contentType: application/json
          payload:
            list_ids:
              - $steps.create-list.outputs.listId
            contacts:
              - email: $inputs.email
                first_name: $inputs.firstName
                last_name: $inputs.lastName
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          jobId: $response.body#/job_id
    outputs:
      salesforceId: $steps.create-sf-contact.outputs.salesforceId
      listId: $steps.create-list.outputs.listId
      jobId: $steps.import-contact.outputs.jobId