Cross-Provider Workflow

Stripe Charge to Slack Alert and SendGrid Receipt

Version 1.0.0

Charge with Stripe, alert Slack ops, then email the customer a receipt.

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

Providers Orchestrated

stripe slack sendgrid

Workflows

charge-alert-and-receipt
Charge in Stripe, alert Slack, then email a SendGrid receipt.
Creates a charge in Stripe, posts a sale alert to a Slack channel, and emails the customer a receipt via SendGrid.
3 steps inputs: amount, channel, currency, customerEmail, source outputs: chargeId, receiptStatus, slackPosted
1
create-charge
$sourceDescriptions.stripeApi.postCharges
Create a charge for the order in Stripe.
2
slack-alert
$sourceDescriptions.slackApi.postChatPostmessage
Post a sale alert into a Slack ops channel.
3
email-receipt
$sourceDescriptions.sendgridApi.SendMail
Email the customer a receipt via SendGrid Mail Send.

Source API Descriptions

Arazzo Workflow Specification

pay-stripe-charge-to-slack-and-sendgrid-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Charge to Slack Alert and SendGrid Receipt
  summary: Charge with Stripe, alert Slack ops, then email the customer a receipt.
  description: >-
    A three-provider workflow that captures a payment through Stripe's Charges API,
    posts an internal sale alert into a Slack channel for the operations team, and
    emails the customer a receipt through SendGrid's Mail Send API. Demonstrates
    fanning a single payment event out to both internal ops and the customer.
  version: 1.0.0
sourceDescriptions:
  - name: stripeApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-charges-api-openapi.yml
    type: openapi
  - name: slackApi
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-openapi.yml
    type: openapi
  - name: sendgridApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: charge-alert-and-receipt
    summary: Charge in Stripe, alert Slack, then email a SendGrid receipt.
    description: >-
      Creates a charge in Stripe, posts a sale alert to a Slack channel, and emails
      the customer a receipt via SendGrid.
    inputs:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
        source:
          type: string
        channel:
          type: string
        customerEmail:
          type: string
    steps:
      - stepId: create-charge
        description: Create a charge for the order in Stripe.
        operationId: $sourceDescriptions.stripeApi.postCharges
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            amount: $inputs.amount
            currency: $inputs.currency
            source: $inputs.source
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/status == "succeeded"
        outputs:
          chargeId: $response.body#/id
          chargeStatus: $response.body#/status
      - stepId: slack-alert
        description: Post a sale alert into a Slack ops channel.
        operationId: $sourceDescriptions.slackApi.postChatPostmessage
        requestBody:
          contentType: application/json
          payload:
            channel: $inputs.channel
            text: New charge $steps.create-charge.outputs.chargeId succeeded.
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          messageTs: $response.body#/ts
          posted: $response.body#/ok
      - stepId: email-receipt
        description: Email the customer a receipt via SendGrid Mail Send.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.customerEmail
                subject: Your receipt
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: Thank you. Charge $steps.create-charge.outputs.chargeId confirmed.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      chargeId: $steps.create-charge.outputs.chargeId
      slackPosted: $steps.slack-alert.outputs.posted
      receiptStatus: $steps.email-receipt.outputs.emailStatus