Skip to content

Expose the current step's status to SEL for conditional branching - #231

Merged
akashdw merged 1 commit into
mainfrom
ad/step-status-in-sel
Jul 31, 2026
Merged

Expose the current step's status to SEL for conditional branching#231
akashdw merged 1 commit into
mainfrom
ad/step-status-in-sel

Conversation

@akashdw

@akashdw akashdw commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew build --write-locks to refresh dependencies)
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

A step transition condition is evaluated in the context of the step it is attached to, so it can already read that step's own params, but it had no way to read that step's status. The status was only reachable for a different step, through the two-arg params.getFromStep('<step>', 'MAESTRO_STEP_STATUS'), which needs the referenced step to be already finished and therefore cannot be the step the condition hangs off.

This adds the status to the single-arg current-step accessor, so a transition condition can branch on how its own step ended:

params.getFromStep('MAESTRO_STEP_STATUS') == 'COMPLETED_WITH_ERROR'

StepInstanceAttributes carries the status from the step's runtime state, and fromStep(String) returns it under the existing MAESTRO_STEP_STATUS key, alongside MAESTRO_STEP_ERROR_RETRIES which is already exposed there. The SEL language guide documents the single-arg overload, which was previously undocumented.

@rdeepak2002 rdeepak2002 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! TIL that evaluateNextConditionParams is called only after the step is already in a terminal state

@akashdw
akashdw merged commit 96afc2f into main Jul 31, 2026
1 check passed

@praneethy91 praneethy91 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants