{"product_id":"durable-postgres-job-runner-for-n8n-claude-whatsapp","title":"Durable Postgres Job Runner for n8n: Claude + WhatsApp","description":"\u003ch3\u003eDurable Postgres Job Runner for n8n—Powered by Claude + WhatsApp Approvals\u003c\/h3\u003e\n\u003cp\u003eTurn long-running, multi-step automations in n8n into resilient “durable jobs” backed by Postgres—complete with automatic recovery, pause\/resume\/cancel controls, and approval gates sent via WhatsApp using Anthropic Claude.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow exposes two webhooks to manage reliable execution of tasks across multiple steps:\u003c\/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives and validates work:\u003c\/strong\u003e Accepts a POST request on \u003ccode\u003e\/webhook\/durable-job\u003c\/code\u003e, validates the task and steps, creates an idempotent job record, and stores the initial job state in \u003cstrong\u003ePostgres\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eClaims an atomic lease:\u003c\/strong\u003e Uses guarded\/atomic logic in Postgres to claim a lease, then decides what to do next based on the latest saved state and any requested control action.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExecutes runnable steps with Claude:\u003c\/strong\u003e For runnable steps, it sends the current prompt to the \u003cstrong\u003eAnthropic Messages API\u003c\/strong\u003e (optionally using \u003cstrong\u003eweb_search\u003c\/strong\u003e), and records output, token usage, and cost back into Postgres as a checkpoint.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHandles approval-required steps:\u003c\/strong\u003e Marks the job as \u003cem\u003eawaiting approval\u003c\/em\u003e in Postgres, then sends approve\/reject links via \u003cstrong\u003eWhatsApp\u003c\/strong\u003e. It waits up to \u003cstrong\u003e24 hours\u003c\/strong\u003e for a webhook-based decision.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eApplies control actions:\u003c\/strong\u003e Accepts POST requests on \u003ccode\u003e\/webhook\/durable-job-control\u003c\/code\u003e to pause, resume, cancel, retry, approve, or reject—using guarded SQL updates—then re-queues the job when appropriate.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAuto-recovery loop:\u003c\/strong\u003e Runs every minute to find stale\/interrupted jobs, re-claims them for recovery, and fails jobs that exceed the configured recovery limit.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTerminal notifications:\u003c\/strong\u003e On completion or failure, updates final state in Postgres and sends a terminal notification via WhatsApp.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eRun production-grade n8n pipelines that can survive crashes and expired leases.\u003c\/li\u003e\n  \u003cli\u003eRequire human approval for high-risk steps (e.g., outbound messages or irreversible actions) via WhatsApp links.\u003c\/li\u003e\n  \u003cli\u003eGuarantee exactly-once-like behavior with idempotent job records and checkpointed Claude outputs.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes:\u003c\/strong\u003e if, set, code, wait, switch, webhook\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBackends:\u003c\/strong\u003e Postgres for job state, leases, checkpoints, and guarded SQL updates\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI integration:\u003c\/strong\u003e Anthropic Messages API (with optional \u003cem\u003eweb_search\u003c\/em\u003e)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eApprovals + notifications:\u003c\/strong\u003e WhatsApp via webhook-driven approve\/reject links\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46154021372083,"sku":"N8N-20286","price":50.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/qyot4z7njhhAIiq2t9yWC_BEy65L3G.png?v=1790932732","url":"https:\/\/buyflowscripts.com\/products\/durable-postgres-job-runner-for-n8n-claude-whatsapp","provider":"N8N Commerce","version":"1.0","type":"link"}