Cross-Provider Workflow

SendGrid Engagement to HubSpot CRM Update

Version 1.0.0

Search SendGrid contacts, find the HubSpot contact, then update it.

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

Providers Orchestrated

sendgrid hubspot

Workflows

sendgrid-engagement-to-hubspot
Search SendGrid contacts, find the HubSpot contact, then update it.
Runs an SGQL search against SendGrid Marketing Contacts to evaluate engagement, searches HubSpot for the matching contact, and updates a CRM engagement property reflecting the email activity.
3 steps inputs: email, engagementStage, hubspotContactId outputs: contactCount, updatedId
1
search-sendgrid
$sourceDescriptions.sendgridContactsApi.SearchContact
Search SendGrid Marketing Contacts by email.
2
find-hubspot-contact
$sourceDescriptions.hubspotContactsApi.searchContacts
Search HubSpot for the matching contact by email.
3
update-engagement
$sourceDescriptions.hubspotContactsApi.updateContact
Update the HubSpot contact with the engagement stage.

Source API Descriptions

Arazzo Workflow Specification

crm-sendgrid-engagement-to-hubspot-update-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: SendGrid Engagement to HubSpot CRM Update
  summary: Search SendGrid contacts, find the HubSpot contact, then update it.
  description: >-
    A cross-provider workflow that reads campaign engagement state from SendGrid
    Marketing Contacts, locates the matching HubSpot contact, and writes an
    engagement property back to the CRM. Demonstrates pushing email-platform
    engagement signals back into the system of record so sales sees the latest
    activity.
  version: 1.0.0
sourceDescriptions:
  - name: sendgridContactsApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mc_contacts_v3.yaml
    type: openapi
  - name: hubspotContactsApi
    url: https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/openapi/hubspot-crm-contacts-api-openapi.yml
    type: openapi
workflows:
  - workflowId: sendgrid-engagement-to-hubspot
    summary: Search SendGrid contacts, find the HubSpot contact, then update it.
    description: >-
      Runs an SGQL search against SendGrid Marketing Contacts to evaluate
      engagement, searches HubSpot for the matching contact, and updates a CRM
      engagement property reflecting the email activity.
    inputs:
      type: object
      properties:
        email:
          type: string
        hubspotContactId:
          type: string
        engagementStage:
          type: string
    steps:
      - stepId: search-sendgrid
        description: Search SendGrid Marketing Contacts by email.
        operationId: $sourceDescriptions.sendgridContactsApi.SearchContact
        requestBody:
          contentType: application/json
          payload:
            query: email LIKE ':email%'
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          contactCount: $response.body#/contact_count
      - stepId: find-hubspot-contact
        description: Search HubSpot for the matching contact by email.
        operationId: $sourceDescriptions.hubspotContactsApi.searchContacts
        requestBody:
          contentType: application/json
          payload:
            filterGroups:
              - filters:
                  - propertyName: email
                    operator: EQ
                    value: $inputs.email
            properties:
              - email
            limit: 1
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          total: $response.body#/total
      - stepId: update-engagement
        description: Update the HubSpot contact with the engagement stage.
        operationId: $sourceDescriptions.hubspotContactsApi.updateContact
        parameters:
          - name: contactId
            in: path
            value: $inputs.hubspotContactId
        requestBody:
          contentType: application/json
          payload:
            properties:
              hs_email_last_engagement: $inputs.engagementStage
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          updatedId: $response.body#/id
    outputs:
      contactCount: $steps.search-sendgrid.outputs.contactCount
      updatedId: $steps.update-engagement.outputs.updatedId