Cross-Provider Workflow

Stripe Failed Payment to Twilio Dunning SMS

Version 1.0.0

Attempt a Stripe PaymentIntent, then text a dunning reminder on failure.

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

Providers Orchestrated

stripe twilio

Workflows

failed-payment-dunning
Create a Stripe PaymentIntent, then SMS a dunning reminder.
Creates and confirms a PaymentIntent in Stripe and, when the status indicates the payment did not succeed, texts the customer a dunning reminder via Twilio.
2 steps inputs: accountSid, amount, currency, fromNumber, paymentMethod, toNumber outputs: dunningMessageSid, paymentId, paymentStatus
1
attempt-payment
$sourceDescriptions.stripeApi.postPaymentIntents
Attempt to create and confirm a PaymentIntent in Stripe.
2
dunning-sms
$sourceDescriptions.twilioApi.createMessage
Send a dunning reminder SMS via Twilio Messaging.

Source API Descriptions

Arazzo Workflow Specification

pay-stripe-failed-payment-to-twilio-dunning-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Stripe Failed Payment to Twilio Dunning SMS
  summary: Attempt a Stripe PaymentIntent, then text a dunning reminder on failure.
  description: >-
    A cross-provider dunning workflow that attempts to confirm a PaymentIntent in
    Stripe and, when the payment requires a new method or fails, sends the customer
    an SMS dunning reminder through Twilio's Messaging API asking them to update
    their payment details. Recovers failed revenue without manual follow-up.
  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: twilioApi
    url: https://raw.githubusercontent.com/api-evangelist/twilio/refs/heads/main/openapi/twilio-messaging-openapi.yml
    type: openapi
workflows:
  - workflowId: failed-payment-dunning
    summary: Create a Stripe PaymentIntent, then SMS a dunning reminder.
    description: >-
      Creates and confirms a PaymentIntent in Stripe and, when the status indicates
      the payment did not succeed, texts the customer a dunning reminder via Twilio.
    inputs:
      type: object
      properties:
        amount:
          type: integer
        currency:
          type: string
        paymentMethod:
          type: string
        accountSid:
          type: string
        fromNumber:
          type: string
        toNumber:
          type: string
    steps:
      - stepId: attempt-payment
        description: Attempt to create and confirm a PaymentIntent in Stripe.
        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 == "requires_payment_method"
        outputs:
          paymentId: $response.body#/id
          paymentStatus: $response.body#/status
      - stepId: dunning-sms
        description: Send a dunning reminder SMS via Twilio Messaging.
        operationId: $sourceDescriptions.twilioApi.createMessage
        requestBody:
          contentType: application/x-www-form-urlencoded
          payload:
            AccountSid: $inputs.accountSid
            From: $inputs.fromNumber
            To: $inputs.toNumber
            Body: Your payment $steps.attempt-payment.outputs.paymentId could not be processed. Please update your card.
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          messageSid: $response.body#/sid
          messageStatus: $response.body#/status
    outputs:
      paymentId: $steps.attempt-payment.outputs.paymentId
      paymentStatus: $steps.attempt-payment.outputs.paymentStatus
      dunningMessageSid: $steps.dunning-sms.outputs.messageSid