Skip to main content

get_workflow_state

Function get_workflow_state 

Source
pub async fn get_workflow_state<S: WorkflowStore>(
    __arg0: State<Arc<AppState<S>>>,
    __arg1: Path<String>,
) -> Result<Json<Value>, AppError>
Expand description

Read the latest snapshot of a workflow’s query-handler state.

Populated by workflow code that calls ctx:register_query(name, fn) — each worker replay re-evaluates the registered handlers and persists the combined result. Returns 404 if no workflow run has written a snapshot yet (either the workflow hasn’t registered any queries, or the first replay hasn’t completed).