# Run bounded dunning for Lago payment failures: n8n workflow

> Started by an event in a connected app, and works across Email and n8n data table. 25 steps, 2 branches: large, and worth reading before you trust it with...

Source: https://millionrounds.com/workflow/run-bounded-dunning-for-lago-payment-failures (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Money admin](https://millionrounds.com/workflows?category=Money+admin#library)

# Run bounded dunning for Lago payment failures

Started by an event in a connected app, and works across Email and n8n data table. 25 steps, 2 branches: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Frun-bounded-dunning-for-lago-payment-failures)

**25 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Logic 13 Service 11

The steps in the order they run, from what starts it.

- 1 **When Lago Reports a Payment Event** Lago trigger *Starts it*
- 2 **Normalize Billing Event** Code *Logic*
- 3 **Route Billing Event** Switch *Logic*
- 4 **Get Failed Invoice** Lago *Service*
- 5 **Load Customer Action State** Data Table *Service*
- 6 **Load Recovery State** Data Table *Service*
- 7 **Record Why the Event Was Ignored** Set *Logic*
- 8 **Get Billing Customer** Lago *Service*
- 9 **Build Customer Action State** Code *Logic*
- 10 **Build Recovered Payment State** Code *Logic*
- 11 **Load Retry State** Data Table *Service*
- 12 **Save Customer Action State** Data Table *Service*
- 13 **Save Recovered Payment State** Data Table *Service*
- 14 **Decide Whether To Retry** Code *Logic*
- 15 **Prepare Customer Action Alert** Set *Logic*
- 16 **Prepare Recovery Alert** Set *Logic*
- 17 **If Retry Limit Allows** If *Logic*
- 18 **Send Billing Alert** Email Send *Service*
- 19 **Retry Failed Payment** Lago *Service*
- 20 **Build Manual Review State** Code *Logic*
- 21 **Build Retry State** Code *Logic*
- 22 **Save Manual Review State** Data Table *Service*
- 23 **Save Retry State** Data Table *Service*
- 24 **Prepare Manual Review Alert** Set *Logic*
- 25 **Prepare Retry Alert** Set *Logic*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 25, with 2 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Email, n8n data table
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own Email account. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 25 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 25 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Frun-bounded-dunning-for-lago-payment-failures)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Email](https://millionrounds.com/workflows?service=Email#library)[n8n data table](https://millionrounds.com/workflows?service=n8n+data+table#library)

## Workflows like it

Also money admin, with the same services where possible, closest in size first.

- [**Sync and validate invoices with KSeF 2.0** 27 steps · n8n data table](https://millionrounds.com/workflow/sync-and-validate-invoices-with-ksef-2-0)
- [**Automate invoice creation & smart reminders with Jotform** 27 steps · calls a model · Outlook, n8n data table](https://millionrounds.com/workflow/automate-invoice-creation-and-smart-reminders-with-jotform)
- [**Convert legal timesheets to LEDES and PDF invoices with OpenAI** 27 steps · calls a model · Email, Excel](https://millionrounds.com/workflow/convert-legal-timesheets-to-ledes-and-pdf-invoices-with-open)
- [**Create Zoho Books invoices from email attachments** 23 steps · calls a model · Email](https://millionrounds.com/workflow/create-zoho-books-invoices-from-email-attachments)
- [**Generate invoices and send AI-powered reminders with Jotform** 23 steps · calls a model · Email, n8n data table](https://millionrounds.com/workflow/generate-invoices-and-send-ai-powered-reminders-with-jotform)
- [**Generate invoices and send AI-summarized reminders** 27 steps · calls a model · Email, n8n data table](https://millionrounds.com/workflow/generate-invoices-and-send-ai-summarized-reminders)
