Run bounded dunning for Lago payment failures with email alerts
UnknownWhat this workflow does
This workflow has 25 nodes and runs on Lago events (invoice.payment failure, invoice.payment status updated, payment.requires action). Along the way it connects Lago (community).
How it runs
Trigger: On Lago events (invoice.payment failure, invoice.payment status updated, payment.requires action).
- Normalize Billing Event (Code): runs custom JavaScript code
- Route Billing Event (Switch): routes items into branches
- Get Failed Invoice (Lago): get (invoice)
- Load Customer Action State (Data table): get
- Load Recovery State (Data table): get
- Record Why the Event Was Ignored (Edit Fields (Set)): sets 2 fields: handled, result
- Get Billing Customer (Lago): get
- Build Customer Action State (Code): runs custom JavaScript code
- Build Recovered Payment State (Code): runs custom JavaScript code
- Load Retry State (Data table): get
…plus 14 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
We can't fully verify this one: it relies on 2 community packages, and n8n 3.0 turns unverified community packages off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
- Check that @blackswampai/n8n-nodes-lago is verified or supports 3.0 (used in When Lago Reports a Payment Event).
- Check that @blackswampai/n8n-nodes-lago is verified or supports 3.0 (used in Get Failed Invoice, Get Billing Customer, Retry Failed Payment).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (8)
- Lago Trigger
@blackswampai/n8n-nodes-lago.lagoTrigger - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Lago
@blackswampai/n8n-nodes-lago.lago - Data table
n8n-nodes-base.dataTable - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set - Send Email
n8n-nodes-base.emailSend
From the author
Quick overview This workflow listens to Lago payment webhooks, retries failed invoice collections up to three times, stores a durable dunning state in an n8n Data Table, and emails billing when a retry is requested, customer action is required, or a payment…