feat: add parallel step type for concurrent workflow execution (#25) - #27
Conversation
Workflows previously executed steps strictly sequentially. This adds a declarative 'parallel' step type that runs child steps concurrently via a fork-join bash pattern. Changes: - Add ParallelStep model to models.py with min_length=1 validation - Add model_rebuild() call after Step union definition - Add ParallelStep branch in render_step() using fork-join bash pattern - Add ParallelStep title to default_step_title() - Import ParallelStep in render.py - Add 8 tests: parse, validation rejection, render assertions, execution, failure propagation, and sequential coexistence Fixes #25
Automated Code ReviewSummaryThe implementation correctly adds FindingsStrengths
Suggestions (non-blocking)
Security
Checklist
Self-reviewed by Claude • Ready for human review |
PR #27 Code Review — feat: add parallel step type for concurrent workflow executionAuthor: tbrandenburg SummaryThis PR introduces a The implementation closely mirrors the Validation Results
Strengths
Issues FoundMedium — VarsStep inside parallel: exported variables silently disappearFile: The model accepts - type: parallel
steps:
- type: vars
values:
RESULT: echo computed
- type: bash
run: echo $RESULT # RESULT is never set herewill get a silently empty Recommendation: Either (a) add a Pydantic validator on Low —
|
Summary
Workflows previously executed steps strictly sequentially. This adds a declarative
parallelstep type that wraps child steps (vars,bash,agent) and runs them concurrently via a fork-join bash pattern (&+$!+wait). The generated artifact remains plain bash with no new runtime dependencies.Root Cause
The
Stepunion inmodels.pyonly includedVarsStep | BashStep | AgentStep | ForStep, with noParallelStepmodel or renderer branch.Changes
src/flowsh_cli/models.pyParallelStepmodel withtype: "parallel"andsteps: list[Step](min 1 child); updateStepunion; addmodel_rebuild()src/flowsh_cli/render.pyParallelStep; addelif isinstance(step, ParallelStep)branch with fork-join bash generation; add title branch indefault_step_title()tests/test_workflow_to_harness.pyTesting
Validation
Issue
Fixes #25
Implementation Details
Followed investigation artifact from issue #25 comment (tbrandenburg, 2026-06-03).
The
ForStepprecedent in the codebase was mirrored exactly: prefix-function emission for children,model_rebuild()after theStepunion, andrun_step(notrun_stateful_step) for the parallel wrapper.Deviations from plan
None — implementation followed the artifact exactly.
Automated implementation from investigation artifact