{"product_id":"n8n-checkpoint-resume-workflow-postgres-slack-alerts","title":"n8n Checkpoint Resume Workflow: Postgres + Slack Alerts","description":"\u003ch3\u003eRestart failed n8n pipelines automatically with Postgres checkpoints + Slack alerts\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow implements a checkpoint-and-resume system for multi-stage executions. It stores each stage’s outputs in \u003cstrong\u003ePostgres\u003c\/strong\u003e, automatically resumes failed or stalled runs, and sends \u003cstrong\u003eSlack\u003c\/strong\u003e alerts when stages fail or recovery completes.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eStarts runs\u003c\/strong\u003e via \u003cem\u003eManual Trigger\u003c\/em\u003e, a \u003cem\u003ewebhook\u003c\/em\u003e (POST request), or a \u003cem\u003eschedule\u003c\/em\u003e that runs every 10 minutes to sweep for resumable executions.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEnsures required Postgres tables\u003c\/strong\u003e exist for runs, checkpoints, and run events.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFor scheduled sweeps\u003c\/strong\u003e, queries Postgres for failed runs whose retry time has passed or for running runs whose lease has expired, then calls this workflow’s webhook to resume each run.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFor manual\/webhook runs\u003c\/strong\u003e, loads run state and completed checkpoints from Postgres, restores prior stage outputs into context, and determines the first stage that still needs to run.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUses a lease-based lock\u003c\/strong\u003e in Postgres to ensure only one execution owns the run; if the run is already completed or locked elsewhere, it exits.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExecutes pipeline stages in order\u003c\/strong\u003e (validate order, reserve inventory, charge payment, create shipment, send confirmation), saving a Postgres checkpoint and run event after each successful stage.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOn failure\u003c\/strong\u003e, retries the stage inline with exponential backoff when allowed; otherwise marks the run failed\/dead-lettered in Postgres and sends a \u003cstrong\u003eSlack\u003c\/strong\u003e alert.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOn completion\u003c\/strong\u003e, marks the run completed and finalizes status in Postgres.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eResuming long-running SaaS workflows after transient errors (e.g., payment or shipping failures).\u003c\/li\u003e\n  \u003cli\u003ePreventing duplicate processing using Postgres lease locks.\u003c\/li\u003e\n  \u003cli\u003eProviding operations visibility with Slack failure\/recovery alerts for checkpointed n8n executions.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTriggers:\u003c\/strong\u003e Manual Trigger, Webhook, scheduled sweep (every 10 minutes).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLogic \u0026amp; control:\u003c\/strong\u003e \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003eswitch\u003c\/code\u003e, \u003ccode\u003ewait\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNotifications:\u003c\/strong\u003e Slack node for stage failure\/dead-letter and alerting.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePersistence:\u003c\/strong\u003e Postgres tables for runs, checkpoints, and run events; lease-based locking for safe checkpointed resume.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46157929250995,"sku":"N8N-20354","price":52.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/BaKDGAQz8iKk14tvmmrcK_xONJNL8l.png?v=1791018657","url":"https:\/\/buyflowscripts.com\/products\/n8n-checkpoint-resume-workflow-postgres-slack-alerts","provider":"N8N Commerce","version":"1.0","type":"link"}