{"product_id":"n8n-workflow-run-lago-bounded-dunning-email-alerts","title":"n8n Workflow: Run Lago Bounded Dunning \u0026 Email Alerts","description":"\u003ch3\u003eAutomate Lago dunning with automatic retries and billing email alerts (in n8n)\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow listens for verified, deduplicated payment webhooks from \u003cstrong\u003eLago\u003c\/strong\u003e, automatically retries failed invoice collections up to \u003cstrong\u003ethree times\u003c\/strong\u003e, tracks dunning state in an n8n \u003cstrong\u003eData Table\u003c\/strong\u003e, and sends plain-text \u003cstrong\u003eemail alerts\u003c\/strong\u003e when billing action is needed—or when a payment is recovered.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives payment webhooks\u003c\/strong\u003e from Lago via a webhook trigger, using verified and deduplicated events.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalizes the payload\u003c\/strong\u003e to extract the \u003cstrong\u003einvoice ID\u003c\/strong\u003e, customer identifiers, payment status, and the recommended handling action.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRetries failed collections (max 3 attempts)\u003c\/strong\u003e:\n    \u003cul\u003e\n      \u003cli\u003eFetches the invoice and customer from Lago.\u003c\/li\u003e\n      \u003cli\u003eLoads the current retry count from an \u003cstrong\u003en8n Data Table\u003c\/strong\u003e.\u003c\/li\u003e\n      \u003cli\u003eIf the invoice is still unpaid and the 3-attempt cap hasn’t been reached, it retries the invoice payment in Lago.\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePersists durable dunning state\u003c\/strong\u003e in the Data Table (e.g., retry requested vs. manual review required) and prepares a billing notification.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHandles customer authentication-required events\u003c\/strong\u003e by preserving the retry count and including the payment \u003cstrong\u003eaction URL\u003c\/strong\u003e in the alert.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMarks recovered payments\u003c\/strong\u003e in the Data Table while retaining the accumulated retry count.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends plain-text emails\u003c\/strong\u003e to the billing address for retry, manual review, customer action required, and recovery outcomes.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eReduce involuntary churn by automatically retrying Lago invoice collections after payment failures.\u003c\/li\u003e\n  \u003cli\u003eRoute billing issues to your team when manual review is required after three unsuccessful attempts.\u003c\/li\u003e\n  \u003cli\u003eSend targeted alerts when customers must authenticate via a payment action URL.\u003c\/li\u003e\n  \u003cli\u003eConfirm recovery automatically and keep your dunning history consistent using an n8n Data Table.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLago webhook trigger\u003c\/strong\u003e (verified and deduplicated events)\u003c\/li\u003e\n  \u003cli\u003eNodes: \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003eswitch\u003c\/strong\u003e, \u003cstrong\u003eData Table\u003c\/strong\u003e, \u003cstrong\u003eemail send\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003eRequires: \u003cstrong\u003eLago API credentials\u003c\/strong\u003e for the trigger and Lago nodes (get invoices\/customers, retry payments), plus an \u003cstrong\u003eSMTP credential\u003c\/strong\u003e for sending email\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45895372767411,"sku":"N8N-18655","price":55.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/dduPcSD51eElLd7Sc7L52_i2M2NaS3.png?v=1787649052","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-run-lago-bounded-dunning-email-alerts","provider":"N8N Commerce","version":"1.0","type":"link"}