Cross-Provider Workflow

HubSpot Unsubscribe to SendGrid Suppression

Version 1.0.0

Update a HubSpot contact opt-out, then add a SendGrid suppression.

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

Providers Orchestrated

hubspot sendgrid

Workflows

hubspot-optout-to-sendgrid-suppression
Mark a HubSpot contact opted-out, then suppress in SendGrid.
Updates a HubSpot contact to reflect an opt-out, then adds the contact's email to a SendGrid unsubscribe group suppression list.
2 steps inputs: contactId, email, groupId outputs: suppressionStatus, updatedId
1
mark-optout
$sourceDescriptions.hubspotContactsApi.updateContact
Update the HubSpot contact to reflect the opt-out.
2
add-suppression
$sourceDescriptions.sendgridSuppressionsApi.AddSuppressionToAsmGroup
Add the email to a SendGrid unsubscribe group suppression.

Source API Descriptions

Arazzo Workflow Specification

crm-hubspot-unsubscribe-to-sendgrid-suppression-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: HubSpot Unsubscribe to SendGrid Suppression
  summary: Update a HubSpot contact opt-out, then add a SendGrid suppression.
  description: >-
    A cross-provider workflow that propagates an opt-out from the HubSpot CRM
    into SendGrid by adding the contact's email to a SendGrid unsubscribe group
    suppression. Demonstrates honoring a CRM-side unsubscribe across the email
    sending platform so the address is suppressed from future group sends.
  version: 1.0.0
sourceDescriptions:
  - name: hubspotContactsApi
    url: https://raw.githubusercontent.com/api-evangelist/hubspot/refs/heads/main/openapi/hubspot-crm-contacts-api-openapi.yml
    type: openapi
  - name: sendgridSuppressionsApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_suppressions_v3.yaml
    type: openapi
workflows:
  - workflowId: hubspot-optout-to-sendgrid-suppression
    summary: Mark a HubSpot contact opted-out, then suppress in SendGrid.
    description: >-
      Updates a HubSpot contact to reflect an opt-out, then adds the contact's
      email to a SendGrid unsubscribe group suppression list.
    inputs:
      type: object
      properties:
        contactId:
          type: string
        email:
          type: string
        groupId:
          type: string
    steps:
      - stepId: mark-optout
        description: Update the HubSpot contact to reflect the opt-out.
        operationId: $sourceDescriptions.hubspotContactsApi.updateContact
        parameters:
          - name: contactId
            in: path
            value: $inputs.contactId
        requestBody:
          contentType: application/json
          payload:
            properties:
              hs_marketable_status: false
              email_opt_out: true
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          updatedId: $response.body#/id
      - stepId: add-suppression
        description: Add the email to a SendGrid unsubscribe group suppression.
        operationId: $sourceDescriptions.sendgridSuppressionsApi.AddSuppressionToAsmGroup
        parameters:
          - name: group_id
            in: path
            value: $inputs.groupId
        requestBody:
          contentType: application/json
          payload:
            recipient_emails:
              - $inputs.email
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          suppressionStatus: $statusCode
    outputs:
      updatedId: $steps.mark-optout.outputs.updatedId
      suppressionStatus: $steps.add-suppression.outputs.suppressionStatus