Recover Failed Stripe Payments with Gmail and Gemini: A Dunning Workflow

Illustration of a failed card payment leading to an email and a follow-up checklist

A failed Stripe payment can turn into a lost renewal when nobody follows up. A dunning workflow gives your team a repeatable way to respond. The Sitetrail Stripe Connector for Google Workspace Studio starts a flow when a payment fails. Gemini drafts a short, personalised message, Gmail routes it for review or sends it, and Google Tasks gives the flow owner a follow-up to act on.

Start with a human review for eligible Stripe Billing customers. The customer gets a clear way to update their payment method, and your team can see which cases still need attention. This workflow uses Google’s native Gemini, Gmail and Tasks steps inside Studio.

1. Start with the failed-payment event

In Workspace Studio, create a flow with the connector’s Payment failed starter. Select the Stripe account and [TEST] connection. If this is your first Stripe starter, use Authorize background delivery and reopen the card if prompted. Use the connector’s failed-payment setup guide to install the add-on, activate the subscription and connect your sandbox with a restricted key.

Enable your Stripe customer portal login link for the Billing customers who can use it. Keep separate test and live links. Start with a flow limited to customers you know are eligible. If you handle both subscriptions and one-off sales on the same account and cannot distinguish them reliably in Studio, route the message to a reviewer who can check the payment in Stripe. A failed card payment by itself does not establish portal eligibility.

2. Create the follow-up task before the email branch

Add Google Tasks → Create a task immediately after the starter. Use a title such as Review failed payment [Payment ID] and map paymentId through Variables +. In the task details, add the event reference eventId, the date and enough context to locate the case. Google’s guide to Studio starters and steps explains that the task is added to the flow owner’s primary Google Tasks list. Set an optional due date, and tell the billing team who owns the queue.

Put the task above Check if so the owner still gets a follow-up when Stripe supplies no customer email. For a shared queue, add an internal Chat notification to a private billing space. Keep failureCode and declineCode in the internal task or Chat message, where the team can use them to triage the case.

3. Ask Gemini to draft the customer message

Add Check if for a usable customerEmail. Inside the condition, add Ask Gemini and select a text response. Insert customerName if available and use amountDisplay only if you want the verified amount in the message. Keep the email address in the Gmail recipient field, and insert the verified, mode-specific Stripe link separately from Gemini’s output.

Prompt to paste into Ask Gemini

Write the body of a short, friendly billing email. Say that a recent payment didn’t go through. Ask the customer to follow the secure billing link supplied below the message. Use the customer name only if provided. If it is missing, start with “Hello”. If they have already resolved the payment, tell them they can ignore the email. Use the amount only if it is supplied. Return the email body only. Omit decline codes, guesses about why the payment failed, deadlines, promises, and any invented links. Never ask the customer to send card details by email.

Customer name: [insert customerName]
Amount, if applicable: [insert amountDisplay]

4. Choose who sends the email

Human review. Use Gmail’s Notify me by email step to send Gemini’s proposed copy to the flow owner. Include the customer address and payment ID in a clearly marked internal section. The reviewer checks the case in Stripe, confirms the recovery route, then copies the approved text into a new Gmail message and sends it. Google’s Draft an email step is designed to draft a reply to an existing Gmail conversation. A Stripe event does not supply that conversation.

Automatic send for eligible cases. After testing, use Gmail’s Send an email inside the condition. Set To to customerEmail, use a fixed subject like Update your payment method, and place Gemini’s text above the verified Stripe portal link. Configure one customer-send path per failure. If your Workspace admin requires approval for that Gmail step, Studio pauses it for approval or rejection. Keep the explicit human review route if your process requires someone to edit every message.

For a one-off purchase, check the original order first. The connector can create a fresh Stripe payment link from an existing price. That link starts a new payment, so match it to the original order during follow-up. Stripe’s automatic billing retries are configured in Stripe. The Studio flow handles communication and follow-up.

Test the workflow before using it with customers

  • Turn on the test flow and trigger a declined payment in Stripe’s sandbox. Use a customer email address you control and the test portal link.
  • Check Activity in Studio to confirm that the task was created, the right email branch ran and the payment ID matches the sandbox case. If Google pauses the send for approval, test that path too.
  • Try a failure without a customer email. The task should still appear and the customer-send branch should be skipped. Then check the wording and secure link in a test email.
  • Connect a separate restricted live key, select [LIVE] on the starter, replace the test portal link and verify the destination before enabling the live flow.

Measure recovered payments

Track one recovery case per invoice or order. Use the event ID to spot a repeated delivery and the payment or invoice reference to group multiple attempts. Before sending a follow-up, check Stripe for a later successful payment or a paid invoice. Close the task when payment is confirmed and record the amount recovered. Calculate the recovery rate by dividing confirmed recoveries by eligible failed cases in the same time window. Report the money recovered by currency.

Use Invoice overdue for a separate reminder on an open manual-payment invoice. That starter checks invoices daily against your overdue threshold. It serves a different point in the billing process from a failed payment attempt.

Actual Workspace Studio screenshot showing the separate Invoice overdue starter
The connector’s separate Invoice overdue starter handles open manual-payment invoices that have passed a configured threshold.

Frequently asked questions

Does this workflow retry the failed Stripe payment?

The Studio workflow sends a recovery message and creates a follow-up task. Configure automatic subscription and invoice retries in Stripe Billing.

Can a person review the message before it goes out?

Yes. Notify the flow owner with Gemini’s copy so they can check it and send it manually in Gmail. Studio can also pause the Send an email step when your Workspace administrator applies an approval policy.

What happens when Stripe supplies no customer email?

Put Create a task before the email condition. The task still appears, and the customer email branch is skipped.

Do Gmail, Gemini and Google Tasks add connector runs?

Native Google steps add zero connector runs. A Stripe starter delivery to one enabled flow counts as one run, and each successful Stripe connector action counts as another.

Start with the review path and one type of billing failure. Find other ways to use Stripe events in our 100 Stripe Automations for Google Workspace Studio guide, or see availability and pricing for the Stripe Connector for Google Workspace Studio.

Picture of Adriaan Brits

Adriaan Brits

Adriaan Brits (MSC, MBA) is the CEO of Sitetrail.com. He has over a decade of experience in consulting with clients around the world on digital marketing strategy and PR. His latest research evolves around generative engine optimization.

Accelerated PR & SEO Plan

Maximize Your Online Visibility with AI-Optimized SEO, Google News, and Digital PR—Designed to Dominate Search Engines and Fast-Growing AI Platforms.

Plugin Downloaded Congratulations Installation Guide: 

  1. In WordPress, go to Plugins → Add New Plugin.
  2. Click Upload Plugin and select the downloaded ZIP file.
  3. Click Install Now, then Activate Plugin.

 

Your free trial starts automatically. No license key is needed yet.