Skip to main content

Recover overdue invoices with GPT-4o-mini, Gmail, Google Sheets, and Slack

Workflow preview

Workflow preview
100%
Recover overdue invoices with GPT-4o-mini, Gmail, Google Sheets, and Slack preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow runs daily to read overdue invoices from Google Sheets, uses OpenAI (GPT 4o mini) to draft personalized reminder emails and determine escalation level, sends emails via...

Best for

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

Tools used

n8n-nodes-base.stickynote, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.gmail, n8n-nodes-base.scheduletrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.code

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Recover overdue invoices with GPT-4o-mini, Gmail, Google Sheets, and Slack
Workflow name
Recover overdue invoices with GPT-4o-mini, Gmail, Google Sheets, and Slack

Quick overview

This workflow runs daily to read overdue invoices from Google Sheets, uses OpenAI (GPT-4o-mini) to draft personalized reminder emails and determine escalation level, sends emails via Gmail, posts Slack alerts for no-invoice runs or AI errors, and logs results back to Google Sheets.

How it works

  1. Runs every 24 hours on a schedule.
  2. Reads rows from the “invoices” tab in Google Sheets and, if no invoice value is found, posts a “no overdue invoices” message to Slack.
  3. For each invoice, sends the invoice details to OpenAI (GPT-4o-mini) to determine an escalation level, draft an HTML email, and recommend whether to escalate.
  4. Parses the AI’s JSON response (falling back to a default reminder if parsing fails) and sends the recovery email to the client via Gmail.
  5. If the AI recommends escalation, sends an internal escalation email via Gmail to the legal/AR team with invoice details and the AI summary.
  6. Updates the original invoice row in Google Sheets with the escalation level and summary, then appends an audit row to the “Recovery sheet” tab including the email subject, summary, and sent message label ID.
  7. If the AI step errors, posts an error alert to Slack and continues processing.

Setup

  1. Add Google Sheets OAuth2 credentials and replace YOUR_GOOGLE_SHEET_ID, ensuring the “invoices” and “Recovery sheet” tabs and columns (Invoice, Client, Email, Amount, Due Date, Days Overdue, Reminders Sent, plus row_number) match the workflow.
  2. Add an OpenAI credential for the GPT-4o-mini model.
  3. Add Gmail OAuth2 credentials and set the reply-to address ([email protected]) and escalation recipient ([email protected]) to your real emails.
  4. Add Slack OAuth2 credentials, replace YOUR_SLACK_CHANNEL_ID, and choose the channel that should receive status and error alerts.

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 - Overview

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

Block 2 - Section: Trigger

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

Block 3 - Section: AI Agent

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

Block 4 - Section: Email

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

Block 5 - Section: Logging

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

Block 6 - Section: Security

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

Block 7 - AI Recovery Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 8 - Send Recovery Email to Client

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

Block 9 - Send Escalation Alert to Legal Team

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

Block 10 - Daily Invoice Check

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 11 - Read Overdue Invoices

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

Block 12 - Any Overdue Invoices?

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

Block 13 - GPT-4o-mini Language Model

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

Block 14 - Parse & Structure AI Response

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

Block 15 - Needs Escalation?

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

Block 16 - Update Invoice Status in Sheet

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

Block 17 - Append Row to Recovery Log

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

Block 18 - Slack: AI Error Alert

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

Block 19 - Slack: No Invoices Found Alert

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

3. Summary Table

Workflow Recover overdue invoices with GPT-4o-mini, Gmail, Google Sheets, and Slack
Complexity advanced
Nodes 19
Categories Invoice Processing, AI Summarization
Author Rahul Joshi
Published 17 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16460/16460.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 overdue invoices with GPT-4o-mini, Gmail, Google Sheets, and Slack do?

Quick overview This workflow runs daily to read overdue invoices from Google Sheets, uses OpenAI (GPT 4o mini) to draft personalized reminder emails and determine escalation level, sends emails via...

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.