Run, Observe & Retrieve
Goal. Run a published script version, watch it execute, and pull back the complete result — including large outputs that come back truncated.
When to use. Production runs against a known version, manual operation or testing, and any workflow whose output is large enough to need streaming retrieval.
1. Run and watch in one command
thread run creates the thread, streams its progress live, and (with
--result) prints the final output when it finishes:
dodil scriptum thread run invoice-parser \
--version 3 \
--input @./prod/invoice_42.json \
--env \
--resultPinning --version (instead of 0 for the active version) makes the run
reproducible. The command attempts a watch stream first and falls back to
polling if the stream cannot be established.
2. Save the full output and step files
Capture everything to disk for the record — this also handles large outputs:
dodil scriptum thread result thr_abc123 --save ./out/thr_abc123--save writes output.json, summary.json, and a steps/ directory. If the
unary result is flagged truncated, --save automatically streams the full
payload before writing it.
3. Inspect step detail
# Summary table
dodil scriptum thread steps thr_abc123
# Full input/output for every step
dodil scriptum thread steps thr_abc123 --detail
# One step by path
dodil scriptum thread steps thr_abc123 --step 1.2.0Decoupled variant: create now, retrieve later
For scheduled or fire-and-forget runs, create the thread and come back for it:
# Kick it off, capture the thread id
dodil scriptum thread create invoice-parser --version 3 --input @./input.json -o json
# Later: check status, then fetch the result
dodil scriptum thread get thr_abc123
dodil scriptum thread result thr_abc123 --save ./out/thr_abc123A thread is durable — its state persists after every step, so you can retrieve the result at any time after it completes.
Verification checklist
- The thread reaches completed status.
thread resultoutput is present and parses as JSON.- If the output was truncated, the
--savereconstruction is complete. - Step inspection confirms the expected critical path ran.
See also
- Debugging a Failed Thread — when a run fails.
- CLI Guide — Threads & Results — every flag.
- API Reference — Threads & Results — result streaming.