Cross-Provider Workflow

Stripe Payout to SendGrid Statement and Slack Notify

Version 1.0.0

Create a Stripe payout, email a statement, then notify Slack ops.

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

Providers Orchestrated

stripe sendgrid slack

Workflows

payout-statement-and-notify
Create a Stripe payout, email a SendGrid statement, notify Slack.
Creates a payout in Stripe, emails an accounting contact a statement via SendGrid, and posts a Slack notification.
3 steps inputs: accountingEmail, amount, channel, currency outputs: emailStatus, payoutId, slackPosted
1
create-payout
$sourceDescriptions.stripeApi.postPayouts
Initiate a payout from the Stripe balance.
2
email-statement
$sourceDescriptions.sendgridApi.SendMail
Email the accounting contact a payout statement via SendGrid.
3
slack-notify
$sourceDescriptions.slackApi.postChatPostmessage
Post a payout confirmation into a Slack channel.

Source API Descriptions

Arazzo Workflow Specification

pay-stripe-payout-to-sendgrid-and-slack-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Payout to SendGrid Statement and Slack Notify
  summary: Create a Stripe payout, email a statement, then notify Slack ops.
  description: >-
    A three-provider finance workflow that initiates a payout through Stripe's
    Payouts API, emails an accounting contact a payout statement via SendGrid's Mail
    Send API, and posts a confirmation into a Slack channel. Gives finance both a
    durable email record and a real-time team notification for every payout.
  version: 1.0.0
sourceDescriptions:
  - name: stripeApi
    url: https://raw.githubusercontent.com/api-evangelist/stripe/refs/heads/main/openapi/stripe-payouts-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: slackApi
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-openapi.yml
    type: openapi
workflows:
  - workflowId: payout-statement-and-notify
    summary: Create a Stripe payout, email a SendGrid statement, notify Slack.
    description: >-
      Creates a payout in Stripe, emails an accounting contact a statement via
      SendGrid, and posts a Slack notification.
    inputs:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
        accountingEmail:
          type: string
        channel:
          type: string
    steps:
      - stepId: create-payout
        description: Initiate a payout from the Stripe balance.
        operationId: $sourceDescriptions.stripeApi.postPayouts
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            amount: $inputs.amount
            currency: $inputs.currency
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          payoutId: $response.body#/id
          payoutAmount: $response.body#/amount
      - stepId: email-statement
        description: Email the accounting contact a payout statement via SendGrid.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.accountingEmail
                subject: Payout statement
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: Payout $steps.create-payout.outputs.payoutId for $steps.create-payout.outputs.payoutAmount has been initiated.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
      - stepId: slack-notify
        description: Post a payout confirmation into a Slack channel.
        operationId: $sourceDescriptions.slackApi.postChatPostmessage
        requestBody:
          contentType: application/json
          payload:
            channel: $inputs.channel
            text: Payout $steps.create-payout.outputs.payoutId initiated and statement emailed.
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          posted: $response.body#/ok
    outputs:
      payoutId: $steps.create-payout.outputs.payoutId
      emailStatus: $steps.email-statement.outputs.emailStatus
      slackPosted: $steps.slack-notify.outputs.posted