Relationships
#1781 `workflow resume --from` does nothing for forEach steps whose template name contains `${{ }}`
Opened by randybias · 8/22/2026· Shipped 8/26/2026
Summary
swamp workflow resume <wf> --run <id> --from '<template>' is documented to re-expand a forEach step and let each iteration's guard decide. It works for a plain template name (deploy → deploy-dev, deploy-qa) but is a silent no-op when the template name contains an expression, e.g. deploy-${{ self.env }} — which is the naming pattern the manual itself recommends ("Resume from a specific step", "Recover forEach iterations").
Steps to reproduce
- forEach step named
deploy-${{ self.env }}over[dev, qa]; make theqaiteration exit 1. swamp workflow run wf --input failStep=true→deploy-qafailed, run failed.swamp workflow resume wf --run <id> --from 'deploy-${{ self.env }}' --input failStep=false- Output shows only downstream jobs re-running;
deploy-qastaysfailed; run endsfailedagain. No error, no warning.
Same workflow with the step renamed to deploy (expanded deploy-dev/deploy-qa): --from deploy re-runs the failed iteration as documented.
Likely cause
computeStepsToReset() in src/domain/workflows/execution_service.ts matches persisted forEach expansions with name.startsWith(tmpl + "-"). For tmpl = "deploy-${{ self.env }}" the prefix deploy-${{ self.env }}- never matches deploy-qa. No test covers templated names.
Suggested fix
Match expansions through the run record's forEachTemplate (already emitted in step_skipped/step events) rather than by name prefix, or store the template name on each expanded StepRun when replaceExpandedSteps() runs. Emit an error when --from resolves to zero persisted steps instead of silently proceeding.
Environment
swamp 20260822.011157.0-sha.06b61472, Linux x86_64.
Shipped
Click a lifecycle step above to view its details.
stack72 commented 8/26/2026, 10:59:09 PM
Thanks @randybias for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.