1. Repro
- Use Postgres node with SSH tunnel enabled, run a query, close the SSH client or let it idle past keepalive.
- Next execution hangs with no error, no timeout, no execution output.
2. Workarounds that unblock now
- Set SSH keepalive (ServerAliveInterval 30) on the tunnel host, or use a dedicated tunnel outside n8n (autossh) and point Postgres at localhost.
- In queue mode, ensure the worker, not just main, holds a live tunnel. A tunnel on main does not help a worker execution.
- Set an explicit statement timeout on Postgres so a hang surfaces as a catchable error:
SET statement_timeout = '15s'.
3. What not to do
- Do not add blind retry without fixing the tunnel — it just hangs again. Fix the transport first.
4. Verify the fix
Kill the SSH client, run the workflow again. With a healthy tunnel the query returns in <2s; with the bug it hangs past 15s and the statement timeout fires.
Grab the free diagnostic checklist — no email wall
Copy this pre-filled request, paste it wherever you asked for help, and you will get a targeted answer without sharing secrets. Nothing is tracked on this page.
Subject: n8n postgres ssh — diagnostic request Describe: - Webhook or HTTP Request node + method/path - Test URL works? Production URL status (curl -i)? - Activation + queue mode? Postgres SSH in use? Paste sanitized config (redact secrets) and I will reply with the exact fix. — myn8n-automation.org/guides/n8n-postgres-ssh-hang/
Claude Weekly Dev Summary for n8n ($29)
Want a production-tested automation ready to import today? Automatically turns any GitHub repo into an executive Friday 5pm summary delivered to Slack or Discord. 8 nodes, zero code, verified execution proof included.
Want a hands-on fix?
The diagnostic above is free to run. If you want me to diagnose and repair the workflow for you with test evidence and handoff notes, direct checkout is available instantly.
Instant Diagnostic ($15) — Direct CheckoutTruth disclosure: This guide shows owned capability and a demo eight-node GitHub activity → Claude-assisted weekly summary → Slack/Discord workflow with local JSON/README/image evidence. No client result, sale, review, accepted bounty, earnings, or production customer outcome is claimed. The named preview businesses did not commission this work.