Cross-Provider Workflow

Salesforce Lead to SendGrid Welcome Email

Version 1.0.0

Create a Salesforce lead, then send a welcome email through SendGrid.

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

Providers Orchestrated

salesforce sendgrid

Workflows

salesforce-lead-to-welcome-email
Create a Salesforce lead, then send a SendGrid welcome email.
Inserts a new Lead record into Salesforce, captures the returned record id, and sends a welcome email to the lead's email address through SendGrid.
2 steps inputs: company, email, firstName, fromEmail, lastName outputs: emailStatus, leadId
1
create-lead
$sourceDescriptions.salesforceRestApi.createRecord
Insert a new Lead record into Salesforce.
2
send-welcome
$sourceDescriptions.sendgridMailApi.SendMail
Send a welcome email to the new lead via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

crm-salesforce-lead-to-sendgrid-welcome-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Salesforce Lead to SendGrid Welcome Email
  summary: Create a Salesforce lead, then send a welcome email through SendGrid.
  description: >-
    A cross-provider workflow that captures a new lead in Salesforce via the
    REST API createRecord operation and immediately sends a personalized welcome
    email to that lead through SendGrid's Mail Send API. Demonstrates handing a
    freshly captured CRM lead off to an email service provider for first-touch
    nurture.
  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: sendgridMailApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: salesforce-lead-to-welcome-email
    summary: Create a Salesforce lead, then send a SendGrid welcome email.
    description: >-
      Inserts a new Lead record into Salesforce, captures the returned record
      id, and sends a welcome email to the lead's email address through
      SendGrid.
    inputs:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        company:
          type: string
        email:
          type: string
        fromEmail:
          type: string
    steps:
      - stepId: create-lead
        description: Insert a new Lead record into Salesforce.
        operationId: $sourceDescriptions.salesforceRestApi.createRecord
        parameters:
          - name: sobjectType
            in: path
            value: Lead
        requestBody:
          contentType: application/json
          payload:
            FirstName: $inputs.firstName
            LastName: $inputs.lastName
            Company: $inputs.company
            Email: $inputs.email
        successCriteria:
          - condition: $statusCode == 201
          - condition: $response.body#/success == true
        outputs:
          leadId: $response.body#/id
      - stepId: send-welcome
        description: Send a welcome email to the new lead via SendGrid.
        operationId: $sourceDescriptions.sendgridMailApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.email
                subject: Welcome aboard
            from:
              email: $inputs.fromEmail
            content:
              - type: text/plain
                value: Thanks for your interest. A team member will reach out soon.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      leadId: $steps.create-lead.outputs.leadId
      emailStatus: $steps.send-welcome.outputs.emailStatus