How do I watch a workflow that takes its time?

Table of Contents

The long-running configuration of the identity workflow. The ores-shell block below is tangled into the runnable script library as identity_long_running.ores.

1. Question

How do I watch a workflow while it is running?

2. Answer

Each step waits before it reports, so the instance sits at in_progress long enough to poll. Run workflow wait in one shell and workflow_steps by-workflow-id in another to see the steps advance.

workflow start identity_workflow '{"steps":[{"name":"one","delay_seconds":5},{"name":"two","delay_seconds":5}]}' --instance-id 10000000-0000-4000-8000-000000000006
workflow wait 10000000-0000-4000-8000-000000000006 --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_long_running.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_long_running.ores against a running fleet.

5. See also

Emacs 29.3 (Org mode 9.6.15)