Cross-Provider Workflow

WhatsApp to Teams and SendGrid Escalation

Version 1.0.0

Reply on WhatsApp, alert a Teams channel, then escalate by email.

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

Providers Orchestrated

whatsapp microsoft-teams sendgrid

Workflows

whatsapp-teams-email-escalation
Reply on WhatsApp, alert Teams, then escalate by email.
Replies to a customer over WhatsApp, alerts the support team in a Microsoft Teams channel, and escalates the case to a supervisor by email via SendGrid.
3 steps inputs: caseSummary, customerNumber, phoneNumberId, replyText, supervisorEmail, teamId, teamsChannelId outputs: emailStatus, teamsMessageId, waMessageId
1
reply-whatsapp
$sourceDescriptions.whatsappCloudApi.sendMessage
Reply to the customer over WhatsApp.
2
alert-teams
$sourceDescriptions.teamsGraphApi.sendChannelMessage
Alert the support team in the Microsoft Teams channel.
3
escalate-email
$sourceDescriptions.sendgridMailApi.SendMail
Escalate the case to a supervisor by email via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

msg-whatsapp-to-teams-and-sendgrid-escalation.yml Raw ↑
arazzo: 1.0.1
info:
  title: WhatsApp to Teams and SendGrid Escalation
  summary: Reply on WhatsApp, alert a Teams channel, then escalate by email.
  description: >-
    A cross-provider support workflow that replies to a customer over the
    WhatsApp Cloud API, alerts the support team in a Microsoft Teams channel
    through the Teams Graph API, and escalates the case to a supervisor by email
    through SendGrid's Mail Send API. Demonstrates a three-provider support
    escalation chain in a single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: whatsappCloudApi
    url: https://raw.githubusercontent.com/api-evangelist/whatsapp/refs/heads/main/openapi/whatsapp-cloud-api-openapi.yml
    type: openapi
  - name: teamsGraphApi
    url: https://raw.githubusercontent.com/api-evangelist/microsoft-teams/refs/heads/main/openapi/microsoft-teams-graph-api.yaml
    type: openapi
  - name: sendgridMailApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: whatsapp-teams-email-escalation
    summary: Reply on WhatsApp, alert Teams, then escalate by email.
    description: >-
      Replies to a customer over WhatsApp, alerts the support team in a Microsoft
      Teams channel, and escalates the case to a supervisor by email via SendGrid.
    inputs:
      type: object
      properties:
        phoneNumberId:
          type: string
        customerNumber:
          type: string
        replyText:
          type: string
        teamId:
          type: string
        teamsChannelId:
          type: string
        caseSummary:
          type: string
        supervisorEmail:
          type: string
    steps:
      - stepId: reply-whatsapp
        description: Reply to the customer over WhatsApp.
        operationId: $sourceDescriptions.whatsappCloudApi.sendMessage
        parameters:
          - name: phone-number-id
            in: path
            value: $inputs.phoneNumberId
        requestBody:
          contentType: application/json
          payload:
            messaging_product: whatsapp
            to: $inputs.customerNumber
            type: text
            text:
              body: $inputs.replyText
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          waMessageId: $response.body#/messages/0/id
      - stepId: alert-teams
        description: Alert the support team in the Microsoft Teams channel.
        operationId: $sourceDescriptions.teamsGraphApi.sendChannelMessage
        parameters:
          - name: team-id
            in: path
            value: $inputs.teamId
          - name: channel-id
            in: path
            value: $inputs.teamsChannelId
        requestBody:
          contentType: application/json
          payload:
            body:
              contentType: html
              content: $inputs.caseSummary
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          teamsMessageId: $response.body#/id
      - stepId: escalate-email
        description: Escalate the case to a supervisor by email via SendGrid.
        operationId: $sourceDescriptions.sendgridMailApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.supervisorEmail
                subject: Support case escalation
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: $inputs.caseSummary
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      waMessageId: $steps.reply-whatsapp.outputs.waMessageId
      teamsMessageId: $steps.alert-teams.outputs.teamsMessageId
      emailStatus: $steps.escalate-email.outputs.emailStatus