Repository navigation
Conversation
Add SwitchTask/ConditionTask, when= guards and first_of() joins so a workflow can choose a branch at run time. Tasks whose guard does not match are skipped (TaskStatus.SKIPPED, on_task_skip hook); skips propagate, collect() drops skipped members, and a skipped result task fails the job with ResultTaskSkippedError. Supported in the builder API, YAML (when:, first_of:), Mermaid (switch diamonds, dashed guard edges), describe JSON and the editable definition round-trip. Adds conditional_if and conditional_switch examples and documentation.
ContextFlag is a ConditionTask that is true when the context value under its configured key is truthy. Runner.run checks that every configured key is registered before any task runs and raises WorkflowDefinitionError otherwise; the CLI reports this as a configuration error. Adds ExecutionContext.has().
…eneric switch bases Add tests for the remaining uncovered error branches and edge cases in conditional execution, bringing line coverage to 100%. Fix SwitchTask label resolution so a concrete subclass of a generic switch base (e.g. MySwitch[Literal["a", "b"]]) gets its branches and output model; previously it silently ended up with no labels.
Register condition.compare, condition.is_true and condition.path_exists as ready-made ConditionTasks for use in workflows and UIs.
kriben
force-pushed
the
conditional-branches
branch
from
October 28, 2026 11:50
705ac7c to
c516be8
Compare
This branch has not been deployed
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.
Fixes #16.