Skip to main content

Recover failed Stripe payments with OpenAI, Gmail, Sheets and Slack

Workflow preview

Workflow preview
100%
Recover failed Stripe payments with OpenAI, Gmail, Sheets and Slack preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow triggers on failed Stripe invoice payments, uses OpenAI to generate an escalating dunning email, sends it through Gmail, logs the attempt to Google Sheets, and notifies...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.stripetrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.gmail, n8n-nodes-base.googlesheets

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by TakatoYamada.

Original n8n.io source

1.1 Workflow description

Title
Recover failed Stripe payments with OpenAI, Gmail, Sheets and Slack
Workflow name
Recover failed Stripe payments with OpenAI, Gmail, Sheets and Slack

Quick Overview

This workflow triggers on failed Stripe invoice payments, uses OpenAI to generate an escalating dunning email, sends it through Gmail, logs the attempt to Google Sheets, and notifies the owner in Slack when the final reminder threshold is reached.

How it works

  1. Triggers when Stripe emits an invoice.payment_failed event.
  2. Extracts and normalizes key invoice fields like customer email/name, amount due, currency, attempt count, and hosted invoice URL.
  3. Uses OpenAI (GPT-4o-mini) to draft a structured dunning email with a subject and body that escalates tone based on the attempt number.
  4. Sends the generated email to the customer via Gmail with the AI-produced subject and message.
  5. Appends the email attempt details to a Google Sheets spreadsheet for tracking.
  6. If the attempt count is 3 or higher, posts an escalation message to a designated Slack channel.

Setup

  1. Connect your Stripe account in the Stripe Trigger node so it can receive invoice.payment_failed events.
  2. Add OpenAI credentials for the GPT-4o-mini chat model used to generate the dunning email content.
  3. Add Gmail credentials and confirm the sending mailbox used by the Gmail node.
  4. Add Google Sheets credentials and replace the placeholder spreadsheet URL/ID, ensuring a sheet named “Dunning” exists.
  5. Add Slack credentials and set the target channel (for example, #billing) for final-attempt escalation messages.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - When Payment Fails (Stripe)

Type / Role
n8n-nodes-base.stripeTrigger - stripeTrigger
Config choices
Version 1

Block 7 - Prepare Invoice Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Draft Dunning Email

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.5

Block 9 - OpenAI Dunning Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 10 - Configure Dunning Output

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 11 - Send Email via Gmail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 12 - Append to Dunning Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

Block 13 - If Final Attempt Reached

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 14 - Notify Owner on Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.2

3. Summary Table

Workflow Recover failed Stripe payments with OpenAI, Gmail, Sheets and Slack
Complexity intermediate
Nodes 14
Categories Invoice Processing, AI Summarization
Author TakatoYamada
Published 03 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16083/16083.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Recover failed Stripe payments with OpenAI, Gmail, Sheets and Slack do?

Quick Overview This workflow triggers on failed Stripe invoice payments, uses OpenAI to generate an escalating dunning email, sends it through Gmail, logs the attempt to Google Sheets, and notifies...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.