Cross-Provider Workflow

HubSpot Segment to SendGrid Single Send Campaign

Version 1.0.0

Search a HubSpot segment, create a SendGrid Single Send, then schedule it.

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

Providers Orchestrated

hubspot sendgrid

Workflows

hubspot-segment-to-singlesend
Search a HubSpot segment, create a SendGrid Single Send, then schedule.
Searches HubSpot contacts for a marketing-qualified segment, creates a SendGrid Single Send targeting an audience list, then schedules the Single Send for delivery.
3 steps inputs: campaignName, lifecycleStage, listId, sendAt, senderId, suppressionGroupId outputs: scheduleStatus, singleSendId, total
1
search-segment
$sourceDescriptions.hubspotContactsApi.searchContacts
Search HubSpot for contacts in the target lifecycle stage.
2
create-singlesend
$sourceDescriptions.sendgridSingleSendApi.CreateSingleSend
Create a SendGrid Single Send campaign for the audience.
3
schedule-singlesend
$sourceDescriptions.sendgridSingleSendApi.ScheduleSingleSend
Schedule the Single Send for delivery.

Source API Descriptions

Arazzo Workflow Specification

crm-hubspot-segment-to-sendgrid-singlesend-campaign-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: HubSpot Segment to SendGrid Single Send Campaign
  summary: Search a HubSpot segment, create a SendGrid Single Send, then schedule it.
  description: >-
    A cross-provider workflow that searches the HubSpot CRM for a target
    audience, creates a SendGrid Single Send marketing campaign aimed at a list,
    and schedules it for delivery. Demonstrates driving an email marketing
    campaign from a CRM-defined segment across two providers in one
    orchestration.
  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: sendgridSingleSendApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mc_singlesends_v3.yaml
    type: openapi
workflows:
  - workflowId: hubspot-segment-to-singlesend
    summary: Search a HubSpot segment, create a SendGrid Single Send, then schedule.
    description: >-
      Searches HubSpot contacts for a marketing-qualified segment, creates a
      SendGrid Single Send targeting an audience list, then schedules the Single
      Send for delivery.
    inputs:
      type: object
      properties:
        lifecycleStage:
          type: string
        campaignName:
          type: string
        senderId:
          type: integer
        suppressionGroupId:
          type: integer
        listId:
          type: string
        sendAt:
          type: string
    steps:
      - stepId: search-segment
        description: Search HubSpot for contacts in the target lifecycle stage.
        operationId: $sourceDescriptions.hubspotContactsApi.searchContacts
        requestBody:
          contentType: application/json
          payload:
            filterGroups:
              - filters:
                  - propertyName: lifecyclestage
                    operator: EQ
                    value: $inputs.lifecycleStage
            properties:
              - email
            limit: 100
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          total: $response.body#/total
      - stepId: create-singlesend
        description: Create a SendGrid Single Send campaign for the audience.
        operationId: $sourceDescriptions.sendgridSingleSendApi.CreateSingleSend
        requestBody:
          contentType: application/json
          payload:
            name: $inputs.campaignName
            send_to:
              list_ids:
                - $inputs.listId
            email_config:
              sender_id: $inputs.senderId
              suppression_group_id: $inputs.suppressionGroupId
              subject: A message for you
              html_content: <p>Thanks for being part of our community.</p>
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          singleSendId: $response.body#/id
      - stepId: schedule-singlesend
        description: Schedule the Single Send for delivery.
        operationId: $sourceDescriptions.sendgridSingleSendApi.ScheduleSingleSend
        parameters:
          - name: id
            in: path
            value: $steps.create-singlesend.outputs.singleSendId
        requestBody:
          contentType: application/json
          payload:
            send_at: $inputs.sendAt
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          scheduleStatus: $statusCode
    outputs:
      total: $steps.search-segment.outputs.total
      singleSendId: $steps.create-singlesend.outputs.singleSendId
      scheduleStatus: $steps.schedule-singlesend.outputs.scheduleStatus