N8n Architecture Questions

Hi n8n Team,

After reading the n8n architecture documentation, I’m still left with a bunch of open questions that I hope someone more knowledgable than I could help answer:

I understand from the Scaling docs that Queue Mode is the best way to make n8n performant in the long-term, but I’m trying to understand if there’s any middle ground here.

Specifically, if I start up a small cluster of n8n containers that:

  • are all running in EXECUTIONS_MODE=regular and
  • they’re all connected to the same PostgreSQL database and
  • they’re all behind the same load balancer, then…
  1. It seems logically that this configuration would support a large number of n8n users being able to interact with the n8n Editor UI…

  2. And it seems logical for any external webhook processing, that the load balancer might evenly balance those requests across the cluster…

  3. But, for scheduled workflows, is the n8n codebase smart enough to distribute those tasks evenly across all containers? Or will only one container ever run those scheduled workflows?

  4. If scheduled workflows do happen to get evenly distributed across containers, does that coordination happen in the PostgreSQL DB? Or would you still need to configure the containers to coordinate via Redis? Or, do the containers not even bother using Redis unless EXECUTIONS_MODE=queue is enabled?

In short, the documentation does a good job of telling you what EXECUTIONS_MODE=queue does, but the documentation doesn’t really explain clearly what EXECUTIONS_MODE=regular does when in a cluster configuration.

I’m hoping someone can help fill in the blanks here.

Thanks in advance!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: 1.29.0
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_MODE setting (default: own, main): regular
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Google Cloud Run

Hello @dkindlund

Well… when the n8n is running in regular mode, I suppose the cluster is not supported, so every n8n would require its DB, or you could have something like a split-brain scenario. But let’s wait for someone from the Team.

Thanks, @barn4k. To be crystal clear, I’m talking about a simple cluster of n8n containers running in regular mode all using the same PostgreSQL database instance. The working theory is that each container is using the same PostgreSQL database for coordination and orchestration.

Still waiting on an n8n team member to chime in here. Thanks in advance!

The real quick answer is don’t point multiple main instances of n8n at the same database in regular mode or you will have a lot of problems.

The 2 options are regular 1 main instance with 1 database either Postgres or SQlite or queue mode which will allow multiple main instances and workers pointing to one database (or database cluster) with redis.

1 Like

Got it; thanks for the sanity check!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.