Add workflow composition normalization - #9
Draft
sezallagwal wants to merge 2 commits into
Draft
Conversation
dhairyashiil
requested changes
Jul 1, 2026
dhairyashiil
left a comment
Collaborator
There was a problem hiding this comment.
Hi Sezal, could we adjust the FOR_EACH / AS alias handling here?
Right now aliases like AS ch are treated globally during normalization. So a later step that is not inside that loop can still write {{ch.name}}, and it gets rewritten as {{steps.ch.name}}. That composes, but at runtime the alias does not exist there and the value becomes empty.
Could we scope the alias only to the step that owns the FOR_EACH, mainly inside that step’s inputMapping? Outside that scope, references like {{ch.name}} should probably fail validation.
This will make workflow behavior easier to reason about and avoid silent empty values later.
dhairyashiil
marked this pull request as draft
July 1, 2026 09:03
Aliases from `forEach ... as <x>` were normalized globally, so an out-of-scope `{{x.field}}` in an unrelated step was silently rewritten to `{{steps.x.field}}` and resolved to empty at runtime.
Scope alias rewriting to the owning step's inputMapping, treat the forEach collection expression as out of scope, and reject out-of-scope alias references with a clear ComposerError. Also fix pre-existing lint issues in the file and add unit tests covering the scoping behavior.
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.
Summary
Depends on
#8