n8n/packages/@n8n/engine
Florian Gößler 1908b5cf4c
perf(engine): Cut database round trips on the step settle and run paths
Each queue on the data plane handles one message at a time, so every
sequential round trip adds to the time per execution.

- createSteps: move the failed-step test into the INSERT. The test still
  runs as a statement after the execution-row lock, so it sees a failure
  that commits while the insert waits for the lock. 5 round trips become 4.
- step:settled: read hasFailedSteps in parallel with loadStep and
  loadExecution. A failure that lands after the probe still stops
  planning, because createSteps refuses to insert after a failure.
- step:settled: skip refreshLiveStatus when it cannot change the status:
  after the handler finishes the execution, and after it queues steps for
  an execution that is running.
- v1 step data loader: load the execution and its steps in parallel.

Durability and ordering guarantees do not change. One visible effect:
if a branch suspends while another branch queues steps, the execution
can show 'waiting' instead of 'running' until the next settlement. The
engine treats both statuses as live, so only the reporting API sees it.

Webhook -> 3 NoOps: about 12 fewer sequential round trips on the
orchestrator and 3 fewer on the step worker per execution.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 15:01:28 +02:00
..
docs/adr docs(engine): Add ADR on binary data access from a data plane in a separate process (no-changelog) (#40179) 2026-10-05 12:55:40 +00:00
src perf(engine): Cut database round trips on the step settle and run paths 2026-10-16 15:01:28 +02:00
.dockerignore chore(core): Add @n8n/engine HTTP server and harness (no-changelog) (#29913) 2026-05-08 14:08:11 +00:00
.gitignore
AGENTS.md chore(engine): Use engine v2 naming (#39582) 2026-09-25 07:54:48 +00:00
eslint.config.mjs chore: Migrate database and engine lint to Oxlint (no-changelog) (#39841) 2026-09-29 12:24:22 +00:00
oxlint.config.mts chore: Migrate database and engine lint to Oxlint (no-changelog) (#39841) 2026-09-29 12:24:22 +00:00
package.json 🚀 Release 2.43.0 (#40376) 2026-10-06 07:10:16 +00:00
README.md chore(engine): Use engine v2 naming (#39582) 2026-09-25 07:54:48 +00:00
tsconfig.build.json chore: More Typescript 7 migrations (#34228) 2026-07-16 07:44:11 +00:00
tsconfig.json chore: More Typescript 7 migrations (#34228) 2026-07-16 07:44:11 +00:00
vitest.config.ts chore(core): Add @n8n/engine HTTP server and harness (no-changelog) (#29913) 2026-05-08 14:08:11 +00:00
vitest.integration.config.ts chore(core): Add @n8n/engine HTTP server and harness (no-changelog) (#29913) 2026-05-08 14:08:11 +00:00

@n8n/engine

n8n workflow execution engine (v2).

See the Engine v2 project for context. Public API and core interfaces are still being defined; the package is currently a scaffold and is not yet wired into n8n.

Dependencies

Be careful adding dependencies here. This package should not have runtime dependencies on other n8n components, only interfaces. If there is some functionality that should be shared, it should be factored into a common library.