-
Notifications
You must be signed in to change notification settings - Fork 342
Open
Description
When building UIs for human-in-the-loop workflows, we need to distinguish between workflows that are actively processing vs. blocked waiting for an event (e.g., approval). Currently, the Cloudflare Workflows API returns "running" for both states.
Current Workaround
In the Agents SDK, we persist waitingForApproval in metadata.uiState when a workflow signals it's waiting (via reportProgress), and clear it when the event is sent. See examples/workflows for the implementation.
Upstream Dependency
This depends on the Workflows team exposing a distinct status (e.g., "waiting" or "waiting_for_event") from WorkflowInstance.status() when a workflow is blocked on step.waitForEvent().
When Resolved
Once the Workflows API exposes this status:
- Update
WorkflowStatustype inpackages/agents/src/workflow-types.ts - Remove
uiState.waitingForApprovalworkaround fromexamples/workflows - Update
mapStatus()to use the native status - Update documentation
Metadata
Metadata
Assignees
Labels
No labels