Skip to content

Feature/support prior return value in when clause#3990

Open
yippie wants to merge 5 commits into
SFDO-Tooling:devfrom
yippie:feature/support-prior-return-for-when
Open

Feature/support prior return value in when clause#3990
yippie wants to merge 5 commits into
SFDO-Tooling:devfrom
yippie:feature/support-prior-return-for-when

Conversation

@yippie
Copy link
Copy Markdown
Contributor

@yippie yippie commented May 28, 2026

Adds the ability to reference output of tasks to determine if subsequent tasks should be run or not.

This pull request enhances the flow runner to support dynamic substitution of prior step return values within a step's when clause, allowing for more flexible and data-driven conditional execution of steps. It also introduces comprehensive tests to validate this new behavior.

Enhancements to flow runner conditional logic:

  • Added support for referencing prior step return values in a step's when clause using the ^^path.key syntax. The flow runner now parses and substitutes these references with the actual return values from previous steps before evaluating the condition. [1] [2] [3]

Testing and validation:

  • Introduced a new task class _TaskReturnsBoolStr in the test suite to facilitate testing of return value substitution.
  • Registered the new return_bool test task in the test project configuration.
  • Added multiple tests to verify the new substitution logic, including:
    • Step runs or is skipped based on the substituted value.
    • Multiple substitutions in a single when clause.
    • Proper error handling when a referenced prior step does not exist.

@yippie yippie requested a review from a team as a code owner May 28, 2026 18:45
@salesforce-cla
Copy link
Copy Markdown

Thanks for the contribution! It looks like @davidmreed is an internal user so signing the CLA is not required. However, we need to confirm this.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants