Cross-Provider Workflow

Payment to Receipt Email and Slack Notice

Version 1.0.0

Charge with Stripe, email a SendGrid receipt, then notify finance in Slack.

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

Providers Orchestrated

stripe sendgrid slack

Workflows

charge-receipt-notify
Charge a customer, email a receipt, and notify Slack.
Creates and confirms a PaymentIntent in Stripe, emails the customer a receipt via SendGrid, and posts a notification to a finance Slack channel.
3 steps inputs: amount, channel, currency, customerEmail, paymentMethod outputs: emailStatus, messageTs, paymentId
1
create-payment
$sourceDescriptions.stripeApi.postPaymentIntents
Create and confirm a PaymentIntent for the customer's order.
2
email-receipt
$sourceDescriptions.sendgridApi.SendMail
Email the customer a receipt via SendGrid Mail Send.
3
notify-finance
$sourceDescriptions.slackChatApi.postChatPostmessage
Notify the finance team that a payment was received.

Source API Descriptions

Arazzo Workflow Specification

geo-stripe-payment-sendgrid-slack-receipt.yml Raw ↑
arazzo: 1.0.1
info:
  title: Payment to Receipt Email and Slack Notice
  summary: Charge with Stripe, email a SendGrid receipt, then notify finance in Slack.
  description: >-
    A high-value cross-domain order workflow that takes a payment through Stripe's
    PaymentIntents API, emails the customer a receipt via SendGrid's Mail Send API, and
    notifies a finance team in Slack. Demonstrates orchestrating a payments provider, an
    email provider, and a team messaging provider in a single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: stripeApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-payment-intents-api-openapi.yml
    type: openapi
  - name: sendgridApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_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: charge-receipt-notify
    summary: Charge a customer, email a receipt, and notify Slack.
    description: >-
      Creates and confirms a PaymentIntent in Stripe, emails the customer a receipt via
      SendGrid, and posts a notification to a finance Slack channel.
    inputs:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
        paymentMethod:
          type: string
        customerEmail:
          type: string
        channel:
          type: string
    steps:
      - stepId: create-payment
        description: Create and confirm a PaymentIntent for the customer's order.
        operationId: $sourceDescriptions.stripeApi.postPaymentIntents
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            amount: $inputs.amount
            currency: $inputs.currency
            confirm: true
            payment_method: $inputs.paymentMethod
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/status == "succeeded"
        outputs:
          paymentId: $response.body#/id
          chargeStatus: $response.body#/status
      - 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 for your payment.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
      - stepId: notify-finance
        description: Notify the finance team that a payment was received.
        operationId: $sourceDescriptions.slackChatApi.postChatPostmessage
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            channel: $inputs.channel
            text: A customer payment was received and a receipt was emailed.
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/ok == true
        outputs:
          messageTs: $response.body#/ts
    outputs:
      paymentId: $steps.create-payment.outputs.paymentId
      emailStatus: $steps.email-receipt.outputs.emailStatus
      messageTs: $steps.notify-finance.outputs.messageTs