Skip to content

Python and shell script - #20

Open
kriben wants to merge 5 commits into
mainfrom
python-and-shell-script
Open

kriben wants to merge 5 commits into
mainfrom
python-and-shell-script

Conversation

@kriben

@kriben kriben commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

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.
Add taskmaestro.python and taskmaestro.command entry-point tasks that run
a Python script or an executable/shell command as a subprocess. Upstream
data is passed as JSON via TASKMAESTRO_INPUT (keyed collect into
`inputs`), and scripts may write a JSON result to TASKMAESTRO_OUTPUT.
Failures, timeouts and invalid output raise ScriptError.

Report unknown root-task config fields before uncovered required fields,
so a typo in input.yaml names the misspelled key.

Includes an example under examples/scripts/, a design doc in
docs/script-tasks.md, and README/AGENTS.md updates.

Closes #1

This branch has not been deployed

No deployments
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.

1 participant