Repository navigation
Description
Summary
A run does one thing at a time: one step after another, and a forEach one item after another. A model call that meets a provider rate limit fails its step and a person retries it. This issue is about three things the owner asked for on 2026-10-08 that all live in the walk: steps that do not need each other running side by side, a forEach working on several items at once, and a failed step trying again after a wait that survives a restart. #4936 has the larger picture and #4927 is the walk they would be built on.
Anchors are at main da3b98b730 (2026-10-13) unless stated.
What the repo says today
- Steps: a live run takes the first node without a checkpoint, one at a time (
services/platform/backend/core/automations/stepper.ts:1047); the in-process walker does the same (services/platform/lib/engine/core/execute/index.ts:191). - Items: one at a time inside the node's turn (
stepper.ts:1472,:1486); the cursor is saved between items when the turn hands off. - A node has no
concurrencyorretryfield (services/platform/lib/engine/core/types.ts:54-135). - A model call is not retried (
services/platform/backend/core/automations/llm_call.tshas no retry or attempt handling; each call reserves budget before and books usage after). A connector failure arrives folded intoconnector_error(services/platform/backend/domains/automations/shim.ts:352-376). Anagentnode retries inside its own machinery (services/platform/backend/core/automations/agent_retry.ts). - The switches that exist are
AUTOMATION_ORG_CONCURRENCY(services/platform/backend/env.ts:75) andAUTOMATION_RUNNER_PROCESSES(:87). Nothing yet for steps, items or an in-flight limit per process.
What it could be worth (modelled, not measured on a deployment)
From the design pass of 2026-10-09. These are arithmetic on a stated latency model (model call 2.5 s, read 0.4 s, write 0.5 s, transform 8 ms, commit 4 ms, 20 items per forEach), not measurements:
| Document | Today | Items 8 at a time | Plus 4 steps at once |
|---|---|---|---|
| github/triage-issues | 50.4 s | 7.9 s | 7.9 s |
| github/review-pull-requests | 68.5 s | 10.7 s | 10.7 s |
| gmail, outlook, imap-smtp triage-inbox | 63.4 s | 12.4 s | 12.4 s |
| a fan-out (3 reads, 3 model calls, a merge, a write) | 9.2 s | 9.2 s | 3.4 s |
Item concurrency is what the shipped packs would gain; steps at once pay off for fan-out documents that authors write themselves. The repo's benchmark (services/platform/lib/engine/core/execute/perf.bench.ts) is where these would be measured.
Not examined: provider rate limits under parallel model calls; budget reservations (each concurrent call reserves its maximum, so a run with items at a time can be refused a call it would have made one at a time).
The forks
The design pass assumed the first answer of each so slices could proceed. Each is the owner's to change, and a different answer only changes the slice named.
| # | Question | Options | Touches |
|---|---|---|---|
| 1 | Writes next to reads | Barrier: a step that can act outside the run (a write or unknown connector action, an agent, a subautomation) waits for every step above it and holds every step below it, so the writes happen in exactly the order they do now. Lane: writes are ordered among themselves and a read after a write may run beside it (at most 0.5 s gained on the packs in the model; a read could run before a write it relies on without naming it). | the scheduler's ordering rules, the docs |
| 2 | Steps at once in the first release | 1: the scheduler ships and runs one step at a time, and the switch flips to 4 in the next release after a canary on one deployment. 4: at once from the start. | the default of AUTOMATION_PARALLEL_STEPS |
| 3 | A model step without retry |
Retry a rate limit or an unreachable provider (3 tries, 5 s then 10 s, retry: false opts out). Leave as today: the step fails and a person retries. |
the model step's failure path |
| 4 | The shipped packs | Set concurrency: 5 on their model and read forEach steps (writes stay 1). Or leave them as they are. |
the pack documents |
| 5 | Largest concurrency |
10, or higher (20) | validation |
What the design pass proposed beyond the forks (open to change)
concurrencyfrom 1 to 10 onforEach(default 1, refused onrepeatUntil); output and effects stay in item order.retry: {attempts, delay, backoff, maxDelay, on}on model and connector steps. Failures are classed (rate limited, unavailable, timeout, invalid output, failed). A wait of 15 s or less happens inside the turn; a longer one parks the run and survives a restart. A write that is not idempotent retries only on a rate limit.- When a step fails, nothing new starts below it, in-flight steps finish, and the reported failure is the first failing step in document order.
- One commit lane per run, so concurrent steps cannot overwrite each other's record rows or the cursor.
- Everything additive: no engine protocol bump and no migration; an old worker in a rolling deploy steps the same run one thing at a time.
- The canvas and the Steps view show what ran at the same time; the docs and manual boxes say so; the benchmarks prove the budget before the default flips.
Constraints
- A step that waits for a person (approval, a question, an agent) never shares a wave with siblings, and only one step that iterates at a time holds the run's single cursor (
services/platform/backend/core/automations/checkpoints.ts). - Budget enforcement reserves before each call; the per-organization limit across workers stays.
- A document that uses
concurrencyorretryis refused by an old API replica during a rolling deploy (unknown node field): a release note.
Not examined
Behaviour under real parallel load at a provider; what the per-run commit lane costs the database at scale; how many existing documents have independent steps worth running side by side beyond the fan-out example.
Activity
yannickmonney commentedon Nov 14, 2026
Decision
This is built on the feature line (
release/0.6, throughfeature-train), on top of the shared walker. #4927 has landed, and #5258 (the durable stepper as a host on that walker) must land first.The forks
AUTOMATION_PARALLEL_STEPSships with a default of 1. A separate change raises it to 4 after the benchmark and a canary on one deployment.retry: Retry on a rate limit or an unavailable provider. That is 3 attempts, 5 s then 10 s, with Retry-After honoured up tomaxDelay.retry: falseopts out. Connector steps retry only whenretryis written. No action declares idempotency today, so every write retries on a rate limit only.forEachsteps getconcurrency: 5.concurrency: 10.Rules
concurrencyis an integer from 1 to 10, onforEachonly. Validation refuses it onrepeatUntil, and refuses a value above 1 on any barrier type instead of quietly ignoring it. Output, effects, item errors andonItemErroroutcomes stay in item order.retryis allowed on model and connector steps only:{attempts 1-5, delay 1s-1h, backoff fixed|exponential, maxDelay up to 1h, on}orfalse.invalid_outputapplies to model steps only.forEach, retries apply per item, and an item counts as failed foronItemErroronly after its attempts are used up. Every attempt reuses the idempotency key. An approval granted for a write covers its attempts.AUTOMATION_ORG_CONCURRENCYstays. There is no protocol bump and no migration. An old API replica refuses the new fields, and the release notes say so.Why. The barrier makes concurrency a pure speed change for anything that touches the outside world. Refusing
concurrencywhere it cannot apply keeps documents honest. The park, retry-order and approval rules close the gaps where concurrency and retries meet. Parallel steps, the riskiest part, start at 1 and change only after a canary, while item concurrency, where the packs gain 5-6x, ships first. Model retries fit AUTO-R13. A cap of 10 can be raised later without breaking documents.Implementation units (base
feature-train). Each behaviour unit carries its own spec rule, named tests, docs and manual box.concurrencyandretry: types, validation, analysis, the editor's schema and a release note.forEachstep's items several at a time, with the budget-wait rule and at most 10 in flight.AUTOMATION_PARALLEL_STEPS(default 1): the barrier and the failure rule.forEachsteps run five items at a time.Cross-issue amendments (decisions taken together with #4936, #4929):