Recover failed Stripe payments with WhatsApp via Heyy

By General Input

When a Stripe payment fails, add the customer to Heyy with the right recovery label so WhatsApp does the dunning, and ping revenue ops in Slack.

Integrations

  • Stripe
  • Heyy
  • Slack

Type

Agentic Task

Categories

  • Finance
  • Operations

Build an agent workflow that turns failed Stripe payments into a labeled WhatsApp recovery flow in Heyy and a structured alert in Slack #revenue-ops. The label-routing judgement is the reason this is an agent, not a code workflow.

Trigger: incoming webhook from Stripe on the invoice.payment_failed event. The agent should also handle charge.failed payloads sent to the same webhook if I forward them.

When the webhook fires, the agent should:

1. Use Stripe Retrieve Customer with the customer id from the event payload to get the customer's name, email, and phone.

2. Use Stripe Retrieve Invoice with the invoice id from the event payload to get the invoice amount due and the attempt count. Skip this step gracefully if the event is a charge.failed without an invoice attached.

3. Decide a recovery label using this judgement: if invoice amount_due is at or above a high-value threshold (default 50000 cents, i.e. $500, expose as a config knob), use payment-failed-high-value. Otherwise, if attempt_count is 1, use payment-failed-soft. If attempt_count is 2 or more, use payment-failed-urgent. The label names should be configurable so I can match the labels I've already set up in Heyy.

4. Use Heyy Create Contact with the customer's phone number (required) and email, attaching the chosen label so my existing Heyy WhatsApp automations pick them up. If the customer has no phone on file in Stripe, skip the Heyy step and note that in the Slack alert.

5. Use Slack Send a Message to post to #revenue-ops with a structured summary: customer name and email, invoice amount in dollars, attempt count, the Heyy label that was applied (or a note that no Heyy contact was created because phone was missing), and a link back to the customer in the Stripe dashboard. Format it as a single readable message so the team can scan and decide whether to escalate.

Configuration knobs to expose: the high-value threshold in cents, the three label names (soft, urgent, high-value), and the Slack channel name.

Error handling: if Stripe Retrieve Customer or Retrieve Invoice fails, still post a degraded Slack alert with whatever information is available from the raw webhook payload so revenue ops is never blind to a failure.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerCustomer lifecycle inspector for Loops, Stripe and PostHogChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downMonth-end Stripe finance pack, stored and shared in SlackNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollments