n8n/packages/@n8n/node-engine-compatibility/src
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
..
__tests__ feat(engine): Add engine v2 tracing spans and a benchmark NoOp opt-in 2026-10-16 00:46:50 +02:00
constants.ts feat(engine): Support Split In Batches loops (no-changelog) (#36723) 2026-08-26 10:46:04 +00:00
engine-step-data-loader.ts perf(engine): Cut database round trips on the step settle and run paths 2026-10-16 15:01:28 +02:00
errors.ts feat(engine): Declare a deadline wait when a v1 node waits for a date (no-changelog) (#39164) 2026-09-25 08:23:46 +00:00
guards.ts feat(engine): Prepare engine v2 for credential resolution (no-changelog) (#37876) 2026-09-07 10:34:43 +00:00
index.ts feat(engine): Add engine v2 tracing spans and a benchmark NoOp opt-in 2026-10-16 00:46:50 +02:00
io.ts chore: Update eslint configuration (#38307) 2026-09-10 14:40:35 +03:00
types.ts feat(engine): Add engine v2 tracing spans and a benchmark NoOp opt-in 2026-10-16 00:46:50 +02:00
v1-adapters.ts feat(engine): Declare a deadline wait when a v1 node waits for a date (no-changelog) (#39164) 2026-09-25 08:23:46 +00:00
v1-execution-read.ts feat(engine): Store the execution's waiting status (no-changelog) (#39093) 2026-09-25 13:13:59 +00:00
v1-response-hooks.ts feat(core): Send streaming webhook chunks from engine v2 (no-changelog) (#39947) 2026-09-30 09:50:04 +00:00
v1-run-data.ts feat(engine): Return run data for engine 2.0 executions (#37486) 2026-09-03 15:41:04 +00:00
v1-step-executor.ts feat(engine): Add engine v2 tracing spans and a benchmark NoOp opt-in 2026-10-16 00:46:50 +02:00
v1-workflow-converter.ts chore(engine): Use engine v2 naming (#39582) 2026-09-25 07:54:48 +00:00