gxwf draft-next-step
Deterministic next-step picker for the per-step authoring loop. Wraps nextDraftStep from @galaxy-tool-util/schema. Native (.ga) input is rejected — drafts are format2-only.
The harness loop reads as: while (next = gxwf draft-next-step <wf>).draft: invoke per-step skill on next.step.
Output
Default output is pretty JSON — the agent-loop wire format. Same input → byte-identical output. --output-format markdown renders a human-glance checklist instead.
JSON fields:
draft(bool) —truewhile a drafty step remains,falseat the terminal cases below.step(string array) — the picked step’s path: a single id at top level (["merge assembled transcripts"]), or the full path through containing subworkflow steps when the pick is nested. The leaf (last element) is the step to work on.work(string array) — the chosen step’s remainingTODO[...]sentinels followed by its_plan_*fields, in checklist order.
At the terminal cases the object is just { "draft": false } — no step or work keys.
Two terminal cases both surface as draft: false:
- The workflow’s class is already
GalaxyWorkflow(concretization complete, class promoted). - The class is still
GalaxyWorkflowDraftbut every step is fully resolved (noTODO_*, no_plan_*). The harness’s next move is draft-extract (which callspromoteFullyConcreteDraftsto flip the class) followed by terminal validate.
Examples
gxwf draft-next-step workflow.gxwf.yml
gxwf draft-next-step workflow.gxwf.yml --output-format markdown
Harness loop sketch:
while [ "$(gxwf draft-next-step workflow.gxwf.yml | jq -r .draft)" = "true" ]; do
step=$(gxwf draft-next-step workflow.gxwf.yml | jq -r '.step | last')
# invoke per-step skill on step, which mutates workflow.gxwf.yml in place
done
Gotchas
- Pick order is topological (a step waits until its
in:sources are concretized) with alphabetical tiebreak on step id at the same level. Same input across runs returns the same pick — safe to call repeatedly without state. - Descends into draft subworkflows; the returned
steparray is the full path through containing subworkflow steps (leaf last). - A
draft: falseresult does not mean the workflow has passed validate yet. It means the per-step authoring loop is done; the harness still owns the promote + terminal-validate pass. - This command does not mutate the workflow file. It’s a pure observer.
- Insertion order of step dicts does not affect output — semantically equal workflows produce identical picks.