N8n intermittently goes Offline after update — /healthz and REST endpoints returning 504 Gateway Timeout

Hi everyone,

I’m investigating an issue that started after updating my self-hosted n8n instance.

The n8n editor intermittently switches to “Offline” and displays:

“No network connection. Workflow changes will be saved once the connection is restored.”

My internet connection remains stable and the n8n UI itself is still accessible.

From the browser DevTools, I captured the following behavior:

  • WebSocket client repeatedly attempts to reconnect:
    “[WebSocketClient] Attempting to reconnect in 1000ms”

  • REST requests intermittently return:
    504 Gateway Timeout

Examples:

GET /healthz → 504 Gateway Timeout

GET /rest/executions?.. → 504 Gateway Timeout

Other requests also retry and eventually return 504.

The issue seems to be intermittent.

My setup:

  • Self-hosted n8n
  • Docker
  • EasyPanel
  • PostgreSQL

PostgreSQL appears to be running and accepting connections.

I also found an unrelated SQL error in one of my workflows:

“column v.ticket_id does not exist”

However, since /healthz itself is returning 504, I don’t believe the workflow SQL error is the root cause of the n8n Offline issue.

The behavior started after updating n8n.

At this point, I’m trying to determine whether this is:

  1. A regression in the new n8n version
  2. A WebSocket/push connection issue
  3. A reverse proxy / EasyPanel / Traefik timeout issue
  4. n8n becoming temporarily unresponsive

Has anyone experienced something similar after updating n8n?

What logs or configuration should I check next to determine where the 504 is originating from?

Thanks!

Hi @Gustavo_Carvalho Welcome!
/healthz does not touch the database, so a 504 on it rules out Postgres and the ticket_id error, and a plain GET does not use the WebSocket, so it rules out the push connection. Traefik returning 504 rather than 502 means the process is up and did not answer in time, which is your option 4. Your screenshots show it: two executions started in the same second, both still Running at 38s.
Regular mode puts no cap on concurrent production executions, so a burst thrashes the event loop and everything including /healthz stops responding. Set a limit and restart:

N8N_CONCURRENCY_PRODUCTION_LIMIT=10

The executions tab then shows the active count against the limit, which is what confirms a burst is behind each drop.

Thank you for the detailed explanation — that makes sense, especially regarding the 504 on /healthz and the fact that PostgreSQL and the WebSocket push connection can be ruled out as the direct cause.

However, there is one important detail I should clarify: the issue also happens when there is only a single production execution running.

I initially considered concurrent executions as a possible cause, but I have observed the same behavior with only one active workflow execution.

In those cases:

  • Only one execution is running
  • The execution is still in progress
  • The n8n editor eventually switches to Offline
  • /healthz starts returning 504 Gateway Timeout
  • REST requests also begin returning 504
  • The WebSocket client starts attempting to reconnect

So I don’t think an execution burst is necessarily required to reproduce the issue.

Could a single long-running or blocking execution cause the main n8n process/event loop to become unresponsive in the same way?

I’m going to monitor the number of active executions when the issue happens again and collect the n8n logs at the exact time of the 504.

Thanks again for pointing me in the right direction.

Yes, though what matters is what the execution is doing rather than how long it runs. In regular mode the API and the execution share one event loop, and waiting does not block it: an HTTP request or a Postgres query yields, so a run sitting ten minutes on a slow endpoint never touches /healthz. Synchronous CPU work and garbage collection are what freeze it.
GC gives your exact pattern. n8n keeps every node’s output for the whole run in the main process heap and frees it only when the execution ends, so a single workflow carrying a large result set climbs toward the heap ceiling and V8’s stop-the-world collections stretch until nothing is served for seconds, then clear once the run finishes.
When it next happens, watch the container’s memory in EasyPanel, not just the number of executions. Memory rising through the run with the 504s starting near the ceiling is the confirmation, and since the process never dies there is no OOM line in the logs to find.
Queue mode moves production executions into a worker process, so nothing an execution does can block the main one. It needs Redis alongside your Postgres:

EXECUTIONS_MODE=queue