Text dunning iMessages from Sendblue when Stripe charges fail

When a Stripe charge fails, send a friendly, AI-drafted iMessage with a retry link from Sendblue and log the attempt on the matching HubSpot contact.

Agentic Task
StripeSendblueHubSpotFinanceCustomer SupportNotifications & AlertsEmail Automation

Build an agent workflow that recovers failed Stripe payments by texting the customer an iMessage from Sendblue and logging the attempt in HubSpot.

Trigger: a Stripe webhook on the charge.failed event. The webhook payload is the failed charge, including the customer id, amount, currency, and failure reason.

When the trigger fires, the agent should:

1. Call Stripe Retrieve Customer with the customer id from the webhook to get the customer's email and name.

2. Call HubSpot Search Contacts on that email to find the matching contact. Pull back the phone number, lifecycle stage, and any properties that indicate past dunning history (for example, the number of recent failed payment notes on the contact). If no contact is found, stop and do nothing.

3. Decide whether to send. Skip sending if the contact has no phone number, or if the failed amount is below a configurable threshold (default: $10 USD equivalent). When you skip, still record a HubSpot note explaining why no message was sent.

4. Compose the message. Draft a short, friendly iMessage that opens with the customer's first name, explains that the card on file just declined on a charge of [amount] for [product or invoice description if available], gives the human-readable failure reason in plain language (for example, "your bank declined the card" instead of generic_decline), and includes a retry payment link. Choose tone based on past dunning attempts: first failure stays casual and apologetic, repeat failures (two or three) get more direct, and after four or more failures keep the tone calm but explicit that the account is at risk.

5. Send the message via Sendblue Send Message to the customer's phone number from your configured Sendblue line. Use E.164 format for the number.

6. Call HubSpot Create Note on the matched contact recording: the failure reason from Stripe, the charge amount and currency, a link to the charge in Stripe, the exact iMessage that was sent, and the Sendblue message id for traceability.

Make the threshold amount and the retry link template configurable inputs so I can tune them without editing the workflow. Where the customer is not in HubSpot, the workflow should exit cleanly and not error.

Additional information

What does this prompt do?
  • Catches every failed Stripe charge the moment it happens and starts a recovery flow without anyone in finance lifting a finger.
  • Drafts a short, friendly iMessage that explains what failed, includes a retry link, and adjusts tone based on whether this is a first slip or a repeat issue.
  • Skips sending automatically when the customer's phone number is missing or the failed amount is below a threshold you set.
  • Logs the failure reason, amount, and the exact message you sent as a note on the customer's HubSpot contact so support and revenue can see the full picture.
What do I need to use this?
  • A Stripe account where you can receive payment events.
  • A Sendblue account with an iMessage line ready to send from.
  • A HubSpot login with permission to read contacts and create notes.
  • Customer phone numbers stored on your HubSpot contacts so the message can find a recipient.
How can I customize it?
  • Change the minimum amount that triggers a text, so small failed charges quietly retry on their own.
  • Adjust the tone ladder, for example casual on the first try, firmer after two or three failures, and an internal escalation after five.
  • Swap the retry link for your billing portal, an Apple Pay link, or a Stripe-hosted update card page.
  • Add a follow-up step like creating a HubSpot task for your CS team when a customer has failed three or more times.

Frequently asked questions

Why iMessage instead of email for payment recovery?
Failed payment emails get lost in promotions tabs and spam filters. An iMessage lands in the customer's main thread next to friends and family, which is why teams that switch to text dunning typically see meaningfully higher recovery rates.
What if I do not have the customer's phone number?
The workflow checks HubSpot for a phone number before sending. If there isn't one, it skips the text and still logs a note on the contact so your team knows the failure happened and that no message went out.
Will this spam customers who already paid?
No. The flow only fires on a confirmed failed charge from Stripe, and you can set a minimum amount so trivial failures do not bother anyone. You can also pause the workflow from your dashboard at any time.
Does it work with HubSpot Free?
Yes. The workflow only needs to read contact properties and add notes, which are supported on every HubSpot tier including Free.
Can I keep my own brand voice in the message?
Yes. The draft is generated by the agent, but you can pin a tone, a signature, and a few example messages so every text sounds like your company.

Stop losing revenue to silent failed charges.

Connect Stripe, Sendblue, and HubSpot once, and Geni texts every customer with a failed charge before they even notice.