Templates / Run bounded dunning for Lago payment failures with email alerts

Run bounded dunning for Lago payment failures with email alerts

Unknown

by Black Swamp AI ✓ · 0 views · created 2026-08-24 · Invoice Processing

Unknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What 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).

  1. Normalize Billing Event (Code): runs custom JavaScript code
  2. Route Billing Event (Switch): routes items into branches
  3. Get Failed Invoice (Lago): get (invoice)
  4. Load Customer Action State (Data table): get
  5. Load Recovery State (Data table): get
  6. Record Why the Event Was Ignored (Edit Fields (Set)): sets 2 fields: handled, result
  7. Get Billing Customer (Lago): get
  8. Build Customer Action State (Code): runs custom JavaScript code
  9. Build Recovered Payment State (Code): runs custom JavaScript code
  10. Load Retry State (Data table): get

…plus 14 more steps. See the full node list below.

Services it uses

Lago (community)

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).
Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (8)

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…

Excerpt from Black Swamp AI's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.