Follow-up to ADR-0031 / #1479 (now complete).
AutomationEngine.runRegion() (the executor for the loop body, parallel branches, and try_catch regions) currently runs each region against a region-local StepLogEntry[] that is not merged into the parent run's step log. There's a TODO(#1479) marking this in packages/services/service-automation/src/engine.ts:
// TODO(#1479): merge region step logs into the parent run log so
// per-iteration body steps surface in run observability.
const regionSteps: StepLogEntry[] = [];
Impact
Run logs (listRuns / getRun) show the container node (loop/parallel/try_catch) as a single step, but not the body/branch/handler steps that executed inside it, nor per-iteration detail for loops. This is a gap for debugging and audit.
Scope
- Thread the parent
steps array (or a child grouping) into runRegion so body steps are recorded.
- Decide on representation: flat append vs nested/grouped (e.g.
parentNodeId + iteration index on each entry) so a loop's N iterations are distinguishable.
- Extend
StepLogEntry if grouping metadata is needed; update engine.test.ts accordingly.
- Mind concurrency for
parallel branches (single-threaded JS, but interleaved at await points — appends must stay consistent).
Executors don't currently receive the steps array, so this is a deliberate engine-level change.
Follow-up to ADR-0031 / #1479 (now complete).
AutomationEngine.runRegion()(the executor for theloopbody,parallelbranches, andtry_catchregions) currently runs each region against a region-localStepLogEntry[]that is not merged into the parent run's step log. There's aTODO(#1479)marking this inpackages/services/service-automation/src/engine.ts:Impact
Run logs (
listRuns/getRun) show the container node (loop/parallel/try_catch) as a single step, but not the body/branch/handler steps that executed inside it, nor per-iteration detail for loops. This is a gap for debugging and audit.Scope
stepsarray (or a child grouping) intorunRegionso body steps are recorded.parentNodeId+ iteration index on each entry) so a loop's N iterations are distinguishable.StepLogEntryif grouping metadata is needed; updateengine.test.tsaccordingly.parallelbranches (single-threaded JS, but interleaved atawaitpoints — appends must stay consistent).Executors don't currently receive the
stepsarray, so this is a deliberate engine-level change.