n8n is a distributed node-based workflow automation tool (https://n8n.io/). n8n workflows can be executed in standalone mode or in queue mode. The queue mode allows to set-up master slave architecture with one main process and multiple worker processes such that multiple workflows can be executed in parallel. In queue mode, main process submits the execution requests to message broker and worker processes pick those requests and execute them. Standalone mode doesn’t have separation of main process and worker process (they are bundled together) and can be used if parallelism is not required.
Component Description
n8n Main Process
This provides the Editor UI, Internal APIs and workflow tiggers.
Editor UI — This is the n8n user interface where we can manually configure the workflows, execute them, monitor the execution status, set up credentials, etc
Internal APIs — These are set of APIs that allow CRUD operations on the workflows. N8n exposes REST APIs (https://docs.n8n.io/api/) for same
Triggers — There are several trigger nodes available in n8n to trigger workflow execution (e.g., cron, interval, webhook, etc)
Redis Message Broker
This is where queue is set up in high availability mode. Main process submits the workflow execution requests to the queue and worker nodes pick and execute those requests
n8n Worker Processes
One or more worker processes can be set-up to execute the workflows. These components do the heavy-lifting and must be configured appropriately since they have direct impact on performance and scaling. Some of the key aspects are listed below.
Memory and CPU allocation
Workflow execution concurrency
Number of worker processes
PostgreSQL Database
Workflows, executions and credentials are stored in the database. PostgreSQL DB can be used for same.
No comments:
Post a Comment