How do I run a workflow with many steps?
Table of Contents
The fan-out configuration of the identity workflow. The ores-shell block
below is tangled into the runnable script library as identity_fan_out.ores.
1. Question
How do I run a workflow with more steps than I can watch one at a time?
2. Answer
Each of the request's five steps reads the one before it, so the engine dispatches them in the order the request declares. The run's own chain – its plan steps and the dependencies between them – is what a restart re-dispatches, so a run is always judged by the chain it was started with.
workflow start identity_workflow '{"steps":[{"name":"one"},{"name":"two"},{"name":"three"},{"name":"four"},{"name":"five"}]}' --instance-id 10000000-0000-4000-8000-000000000002
workflow wait 10000000-0000-4000-8000-000000000002 --timeout 60 --expect-state completed
workflow wait fails unless the instance reaches the state named, so this
script fails when the path it covers does nothing.
3. Script
projects/ores.shell/scripts/library/workflow/identity_fan_out.ores –
generated from this recipe by compass build --direct tangle_shell_scripts
(do not edit the .ores by hand).
4. Tested by
Manual: compass shell -f identity_fan_out.ores against a running fleet.
5. See also
- Add the identity workflow and the commands that drive it – the fixture.