Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End step enhancements #9

Open
lucamrgs opened this issue Apr 16, 2024 · 1 comment
Open

End step enhancements #9

lucamrgs opened this issue Apr 16, 2024 · 1 comment

Comments

@lucamrgs
Copy link

Concerns:

  • Branching steps (if, while, parallel) have multiple branches: on_true, on_false, on_completion, next_steps.
  • All branches must end in an end_step.
  • All end steps in all branches should be interpreted as “end of the workflow branch, continue to the next workflow command” (details of on_true in e.g. 4.8: “This branch MUST reference a unique end step when that branch has completed processing. This allows implementations to know when to return to the original if condition step that started that branch to look for any on_completion, on_success, or on_failure actions.”)
  • Workflow branch end steps should hence be used to back-track to the branching step (if, while, parallel), to then trigger the on_completion (/success/failure) step.
  • This requires that if a playbook has complex and nested conditional logic, all the conditional steps must be back-tracked by the implementation that executes the playbook. Hence, this introduces a great overhead for execution implementations.
  • As related consideration, it may be the case that the entire playbook execution should terminate upon reaching a condition “nested deep” in the conditional logic, without having to backtrack the previous condition nodes.
  • This is alike to using a return value inside nested or otherwise complex conditional logic in programming.
    Possible ways to address
  • Introduce the concepts of playbook-end step and branch-end step.
  • A “branch-end” step should provides necessary information for back-tracing.
  • If a playbook reaches a playbook-end step, no more processing is needed. If a playbook reaches a branch-end step, the execution can be back-traced.
  • Must add fall-back back-track from branching step back to branching step
  • Nice to note: this would be retro-compatible.

Possible ways to address

  • Introduce the concepts of playbook-end step and branch-end step.
  • A “branch-end” step should provide necessary information for back-tracing.
  • If a playbook reaches a playbook-end step, no more processing is needed. If a playbook reaches a branch-end step, the execution can be back-traced.
  • Note: it is not needed that a branching step itself points to a previous branching step. Instead, the on_completion step can continue the current-level branch sequence, and eventually point to a branch_end step, which in turn points to the branching step (if any) which initiated the current-level branch.
  • Nice to note: this would be retro-compatible.

image

@jordan2175
Copy link
Contributor

We did this, but there may be a problem with on_success and on_completion that we need to look at

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

No branches or pull requests

2 participants