Cross-Provider Workflow

SendGrid Scheduled Send to Slack Notify

Version 1.0.0

Schedule a SendGrid email send, then notify a Slack channel it is queued.

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

Providers Orchestrated

sendgrid slack

Workflows

schedule-send-and-notify
Schedule an email send, then notify Slack the send is queued.
Schedules an email send in SendGrid for a batch id and, on success, posts a notification to a marketing operations Slack channel.
2 steps inputs: batchId, opsChannel, sendAt, slackToken outputs: notifyTs, scheduledBatchId
1
schedule-send
$sourceDescriptions.sendgridScheduledSendsApi.CreateScheduledSend
Schedule the email send in SendGrid.
2
notify-ops
$sourceDescriptions.slackChatApi.postChatPostmessage
Notify the marketing operations Slack channel of the queued send.

Source API Descriptions

Arazzo Workflow Specification

msg-sendgrid-scheduled-send-to-slack-notify.yml Raw ↑
arazzo: 1.0.1
info:
  title: SendGrid Scheduled Send to Slack Notify
  summary: Schedule a SendGrid email send, then notify a Slack channel it is queued.
  description: >-
    A cross-provider workflow that schedules an email send through SendGrid's
    Scheduled Sends API and then notifies a marketing operations Slack channel
    that the send has been queued through the Slack Chat API. Demonstrates
    coordinating an email scheduling action with a team notification in a single
    Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: sendgridScheduledSendsApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_scheduled_sends_v3.yaml
    type: openapi
  - name: slackChatApi
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-openapi.yml
    type: openapi
workflows:
  - workflowId: schedule-send-and-notify
    summary: Schedule an email send, then notify Slack the send is queued.
    description: >-
      Schedules an email send in SendGrid for a batch id and, on success, posts
      a notification to a marketing operations Slack channel.
    inputs:
      type: object
      properties:
        batchId:
          type: string
        sendAt:
          type: integer
        slackToken:
          type: string
        opsChannel:
          type: string
    steps:
      - stepId: schedule-send
        description: Schedule the email send in SendGrid.
        operationId: $sourceDescriptions.sendgridScheduledSendsApi.CreateScheduledSend
        requestBody:
          contentType: application/json
          payload:
            batch_id: $inputs.batchId
            status: pending
            send_at: $inputs.sendAt
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          scheduledBatchId: $response.body#/batch_id
          scheduledStatus: $response.body#/status
      - stepId: notify-ops
        description: Notify the marketing operations Slack channel of the queued send.
        operationId: $sourceDescriptions.slackChatApi.postChatPostmessage
        parameters:
          - name: token
            in: header
            value: $inputs.slackToken
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            channel: $inputs.opsChannel
            text: Email batch $steps.schedule-send.outputs.scheduledBatchId is now $steps.schedule-send.outputs.scheduledStatus
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/ok == true
        outputs:
          notifyTs: $response.body#/ts
    outputs:
      scheduledBatchId: $steps.schedule-send.outputs.scheduledBatchId
      notifyTs: $steps.notify-ops.outputs.notifyTs