feat(automation): structured parallel block (ADR-0031, task 3)#1489
Merged
Conversation
Add engine execution for the `parallel` block — a structured construct with an implicit join (ADR-0031 §Decision 2), building on the loop container PR. - new builtin/parallel-node.ts: runs config.branches[] regions concurrently in the enclosing variable scope via engine.runRegion() and continues once when all complete — no author-visible split/join gateway. Branch failure fails the block (→ fault edge / error handling); durable pause inside a branch is a clear error. - registered as a built-in node executor (builtin/index.ts). - well-formedness (>=2 branches, single-entry/single-exit regions) is already enforced at registerFlow() by validateControlFlow (shipped with the loop PR). - showcase FanOutNotifyFlow demonstrates the parallel block; changeset added. https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 1, 2026
This was referenced Jun 2, 2026
os-zhuang
added a commit
that referenced
this pull request
Jun 2, 2026
The structured control-flow constructs (loop/parallel/try-catch) and the BPMN interop mapping are implemented and merged (#1482, #1489, #1499, #1500; docs #1497). Flip ADR-0031 from Proposed to Accepted and record the implementing PRs and the deferred follow-ups (#1504 BPMN XML plugin, #1505 region step logs). https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ADR-0031 task 3 (issue #1479) — engine execution for the structured
parallelblock with an implicit join. Builds on the merged loop-container PR (#1482), which already shipped the construct schemas (ParallelConfigSchema), region well-formedness analysis, andAutomationEngine.runRegion().What's in this PR
@objectstack/service-automation—builtin/parallel-node.ts(new)parallelnode declares N branch regions inconfig.branches[]. The executor runs every branch concurrently (Promise.all, viarunRegion) in the enclosing variable scope and continues once when all branches complete — the join is implicit at block end, engine-synchronized. No author-visible split/join gateway to mis-wire or deadlock; the node's ordinary out-edges are the after-block continuation.awaitpoints and the sharedvariablesmap is never torn. Branches should write distinct variables (last-writer-wins on collision, same as the engine's existing unconditional-edge fan-out).Well-formedness (≥2 branches; each branch single-entry/single-exit, acyclic) is already enforced at
registerFlow()byvalidateControlFlowfrom the loop PR.Showcase / changeset
FanOutNotifyFlow— notifies the owner and Slack concurrently, joining before completion.Tests
builtin/parallel-node.test.ts— 6 tests: all-branches-run + implicit join, join waits for the slowest branch, multi-node branch ordering, branch-failure fails the block, and two register-time rejections (<2 branches; malformed branch region).Roadmap (#1479)
https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
Generated by Claude Code