Repository navigation
Python: What is the recommended way to show the path a workflow run took, for past and paused runs? #10294
Replies: 1 comment
|
There isn't an official, persistable "path this run took" API today. A checkpoint stores the latest workflow state (messages, executor state, iteration, and The robust approach is to persist the event stream yourself:
Events that are useful for a run timeline include A few caveats that matter for paused or restored runs:
DevUI's |
Uh oh!
There was an error while loading. Please reload this page.
Python: What is the recommended way to show the path a workflow run took, for past and paused runs?
What we're trying to do
We draw our workflows as a graph (one node per executor) and want to show, for a given run, the path it actually took:
ctx.request_info).We need this in two situations:
request_inforequests, possibly on two parallel branches at once. Someone opens it and should see where it is waiting. Later it is resumed from a checkpoint, possibly in another process, and the view continues from there.Runs are started both with
workflow.run(..., stream=True)and withstream=False.What makes it hard
executor_invoked/executor_completeddon't say where the message came from. The edge taken has to be inferred from the graph, which is ambiguous when an executor has several incoming edges, and for fan-in.ctx.request_infois still reportedexecutor_completedwhen its handler returns, although it is waiting for an answer. Whether it is "done" or "waiting" isn't visible from that event.run()calls, so linking "this executor asked" with "this executor resumed on the answer" isn't obvious from events.request_infoevents are emitted again.stream=False, events are only available afterrun()returns.executor.process,message.send, edge group spans, span links) seem to contain the path. However, they are exported asynchronously, are absent when tracing is disabled, and don't express "waiting for a human".Questions
request_info? Is there an existing or planned API for a persisted execution history?stream=Falsebe handled?Thanks!
All reactions