Postgres Job Queue With Retries And Dead Letter Table
What this workflow does
The workflow contains these steps: Every Minute → Run Once to Create Tables → Queue Settings → Check Settings → Settings Valid? → Stop: Invalid Settings → Create Tables Run? → Create Queue Tables → Release Stuck Jobs → Claim Job Batch → Job Claimed? → Do the Work → Mark Job Done → Schedule Retry or Dead-Letter → Find Unreported Dead Letters → Build Digest Email → Email Dead Letter Digest → Mark Dead Letters Reported → Stop: Digest Email Failed.
What you need
- An n8n instance to import and run the workflow.
- StickyNote access for the StickyNote steps listed in this workflow.
- Schedule access for the Schedule steps listed in this workflow.
- ManualTrigger access for the ManualTrigger steps listed in this workflow.
- Set access for the Set steps listed in this workflow.
- Code access for the Code steps listed in this workflow.
- IF access for the IF steps listed in this workflow.
- StopAndError access for the StopAndError steps listed in this workflow.
- Postgres access for the Postgres steps listed in this workflow.
- HTTP Request access for the HTTP Request steps listed in this workflow.
- EmailSend access for the EmailSend steps listed in this workflow.
Workflow nodes
- Every Minute (n8n-nodes-base.scheduleTrigger)
- Run Once to Create Tables (n8n-nodes-base.manualTrigger)
- Queue Settings (n8n-nodes-base.set)
- Check Settings (n8n-nodes-base.code)
- Settings Valid? (n8n-nodes-base.if)
- Stop: Invalid Settings (n8n-nodes-base.stopAndError)
- Create Tables Run? (n8n-nodes-base.if)
- Create Queue Tables (n8n-nodes-base.postgres)
- Release Stuck Jobs (n8n-nodes-base.postgres)
- Claim Job Batch (n8n-nodes-base.postgres)
- Job Claimed? (n8n-nodes-base.if)
- Do the Work (n8n-nodes-base.httpRequest)
- Mark Job Done (n8n-nodes-base.postgres)
- Schedule Retry or Dead-Letter (n8n-nodes-base.postgres)
- Find Unreported Dead Letters (n8n-nodes-base.postgres)
- Build Digest Email (n8n-nodes-base.code)
- Email Dead Letter Digest (n8n-nodes-base.emailSend)
- Mark Dead Letters Reported (n8n-nodes-base.postgres)
- Stop: Digest Email Failed (n8n-nodes-base.stopAndError)
StickyNoteScheduleManualTriggerSetCodeIFStopAndErrorPostgresHTTP RequestEmailSend
24 nodesData Processing
Need this workflow customized or debugged? Book a 30-min scope call →
Want this set up for you? Book a 30-min scope call
I build and fix n8n workflows for agencies and SaaS teams. 30-minute scope call — bring the problem, leave with an estimate.
Related workflows
Postgres Sales Dashboard With Period Comparison Via Webhook
25 nodesStickyNoteManualTriggerPostgres
N8n Data Tables Daily Backup To Postgres
34 nodesStickyNoteManualTriggerPostgres
Postgres Smtp Approval Requests With Approve Reject Email Links
40 nodesStickyNoteManualTriggerPostgres
Manual Postgres Automate Triggered
4 nodesManualTriggerSetPostgres