Cross-Provider Workflow

Stripe Charge Dispute to Slack and SendGrid Alert

Version 1.0.0

Retrieve a disputed Stripe charge, alert Slack, then email the finance team with SendGrid.

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

Providers Orchestrated

stripe slack sendgrid

Workflows

dispute-alert-fanout
Fetch a disputed Stripe charge, then alert Slack and email finance.
Retrieves a Stripe charge under dispute, posts a chargeback alert to a Slack channel, and emails the finance team a review notice via SendGrid.
3 steps inputs: chargeId, financeEmail, slackChannel, slackToken outputs: emailStatus, messageTs
1
get-charge
$sourceDescriptions.stripeApi.getChargesCharge
Retrieve the disputed Stripe charge.
2
post-slack-alert
$sourceDescriptions.slackApi.postChatPostmessage
Post a chargeback alert to the Slack channel.
3
email-finance
$sourceDescriptions.sendgridApi.SendMail
Email the finance team a dispute review notice via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

shop-dispute-alert-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Charge Dispute to Slack and SendGrid Alert
  summary: Retrieve a disputed Stripe charge, alert Slack, then email the finance team with SendGrid.
  description: >-
    A risk-operations workflow that retrieves a Stripe charge under dispute,
    posts an alert to a Slack channel, and emails the finance team a notice
    through SendGrid so a chargeback can be reviewed quickly. Demonstrates
    fanning a payment-risk signal out to a team chat provider and an email
    provider.
  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: dispute-alert-fanout
    summary: Fetch a disputed Stripe charge, then alert Slack and email finance.
    description: >-
      Retrieves a Stripe charge under dispute, posts a chargeback alert to a
      Slack channel, and emails the finance team a review notice via SendGrid.
    inputs:
      type: object
      properties:
        chargeId:
          type: string
        slackToken:
          type: string
        slackChannel:
          type: string
        financeEmail:
          type: string
    steps:
      - stepId: get-charge
        description: Retrieve the disputed Stripe charge.
        operationId: $sourceDescriptions.stripeApi.getChargesCharge
        parameters:
          - name: charge
            in: path
            value: $inputs.chargeId
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          chargeAmount: $response.body#/amount
          disputed: $response.body#/disputed
      - stepId: post-slack-alert
        description: Post a chargeback alert to the Slack channel.
        operationId: $sourceDescriptions.slackApi.postChatPostmessage
        parameters:
          - name: token
            in: header
            value: $inputs.slackToken
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            channel: $inputs.slackChannel
            text: A charge is under dispute. Finance review required.
        successCriteria:
          - condition: $statusCode == 200
          - condition: $response.body#/ok == true
        outputs:
          messageTs: $response.body#/ts
      - stepId: email-finance
        description: Email the finance team a dispute review notice via SendGrid.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.financeEmail
                subject: Chargeback dispute opened
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: A Stripe charge is under dispute and needs review.
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      messageTs: $steps.post-slack-alert.outputs.messageTs
      emailStatus: $steps.email-finance.outputs.emailStatus