Cross-Provider Workflow

Slack Alert to SendGrid Email

Version 1.0.0

Post an alert to a Slack channel, then email the same alert via SendGrid.

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

Providers Orchestrated

slack sendgrid

Workflows

slack-alert-and-email
Post a Slack alert, then email the same alert through SendGrid.
Posts a message to a Slack channel and, on a successful post, emails the same alert content to an on-call address through SendGrid.
2 steps inputs: alertText, channel, onCallEmail, slackToken outputs: emailStatus, messageTs
1
post-slack-alert
$sourceDescriptions.slackChatApi.postChatPostmessage
Post the alert message to the Slack channel.
2
email-alert
$sourceDescriptions.sendgridMailApi.SendMail
Email the same alert to the on-call address via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

msg-slack-alert-to-sendgrid-email.yml Raw ↑
arazzo: 1.0.1
info:
  title: Slack Alert to SendGrid Email
  summary: Post an alert to a Slack channel, then email the same alert via SendGrid.
  description: >-
    A cross-provider workflow that broadcasts an operational alert to a Slack
    channel using the Slack Chat API and then emails the identical alert to an
    on-call distribution list through SendGrid's Mail Send API. Demonstrates
    fanning a single alert out across a team chat channel and email in one
    Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: slackChatApi
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-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: slack-alert-and-email
    summary: Post a Slack alert, then email the same alert through SendGrid.
    description: >-
      Posts a message to a Slack channel and, on a successful post, emails the
      same alert content to an on-call address through SendGrid.
    inputs:
      type: object
      properties:
        slackToken:
          type: string
        channel:
          type: string
        alertText:
          type: string
        onCallEmail:
          type: string
    steps:
      - stepId: post-slack-alert
        description: Post the alert message to the Slack channel.
        operationId: $sourceDescriptions.slackChatApi.postChatPostmessage
        parameters:
          - name: token
            in: header
            value: $inputs.slackToken
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            channel: $inputs.channel
            text: $inputs.alertText
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/ok == true
        outputs:
          messageTs: $response.body#/ts
          postedChannel: $response.body#/channel
      - stepId: email-alert
        description: Email the same alert to the on-call address via SendGrid.
        operationId: $sourceDescriptions.sendgridMailApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.onCallEmail
                subject: On-call alert
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: $inputs.alertText
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      messageTs: $steps.post-slack-alert.outputs.messageTs
      emailStatus: $steps.email-alert.outputs.emailStatus