tRPC v2 Workflows API
tRPC Endpoints
tRPC v2 Workflows API
Workflow authoring and lifecycle APIs for webapp-v2
POST
tRPC v2 Workflows API
The
v2.workflows.* namespace is the workflow authoring surface for agentic
workflow drafts.
- Base endpoint:
POST /v1/trpc - Namespace:
v2.workflows.* - Auth: wallet session or API key
- Auth gates: wallet/API authentication plus owner checks in the workflow facade
Enabled Procedure Groups
v2.workflows.listv2.workflows.getv2.workflows.drafts.*liststartstartFromWorkflowgetanswercancel
v2.workflows.authoring.*validatepreviewcommit
v2.workflows.construction.*startrefineanswersetExecutionPolicyreadvalidatesimulatecommit
v2.workflows.drafts.commitv2.workflows.createv2.workflows.updatev2.workflows.pausev2.workflows.resumev2.workflows.runNowv2.workflows.archivev2.workflows.monitor.*tickrecord
v2.workflows.executions.*listgetgetByWorkflow
Availability Notes
v2.workflows.construction.*is the canonical workflow construction draft facade for webapp-v2. It returns typed construction drafts, readiness, diagnostics, and simulation placeholders; activation remains blocked until readiness explicitly allows it.- Older authored-source procedure groups may still use their existing runtime feature gates while they are being consolidated into the construction facade.
Lifecycle Notes
The current public lifecycle supports:- Starting and iterating on workflow drafts from free text or existing workflows. Authored drafts can now include a source-derived graph preview on the draft plan before commit.
- Validating, previewing, and committing authored workflow modules when the
authored SDK flag is enabled.
When
platform-apiis configured with the Cloudflare control-plane worker, authored commit now also activates the portfolio-scopedStrategyFacetruntime from the compiler-producedAuthoredAgentMetadataenvelope before the workflow is treated as committed. - Creating, updating, listing, and inspecting canonical workflows.
- Pausing, resuming, running, archiving, and monitoring workflows.
- Reading workflow execution history for canonical workflows.
construction.* procedures are the platform-owned draft boundary for the
new workflow construction AI rail. start, refine, answer, and
setExecutionPolicy return canonical typed construction drafts for the
collaborative rail. Simulation and commit are gated by typed readiness and
return diagnostics when the current draft version cannot be enabled.
v2.workflows.construction.refine accepts structured rail edits through
field and fieldValue. Asset edits may also pass fieldLabel as an optional
display-label fallback when fieldValue is a canonical asset id or CAIP-style
machine id that resolves without token-list symbol metadata. fieldLabel does
not replace the canonical asset id used for validation, preview, or execution.
Direct create/update currently target the canonical workflow rail for:
rebalance_portfoliobuy_assetsell_assetcash_sweeprecurring_depositwithdraw_funds
v2.workflows.list supports workflow-kind filtering via kind and
trigger-kind filtering via triggerKind. Monitor discovery should use
triggerKind for trigger semantics such as price_condition and
authored_sdk.
This keeps the rollout centered on the top-level workflow surface flag, with
additional authored-SDK gating only for authored-module flows.
Workflow Detail Runtime Notes
v2.workflows.get exposes monitor-state runtime annotations for trigger-driven
workflows, and now overlays live automation-engine runtime when the committed
workflow execution ref points at an automation run.
monitorState.waitingUntilremains the source for time-based sleeps and wait windows.monitorState.waitingForEventTypeis the explicit event-driven wait surface:trigger_matchedfor armed trigger waitsexecution_completedfor in-flight execution continuations
monitorState.metadata.triggerEventKindandmonitorState.metadata.routeKeyremain auxiliary runtime annotations for the authored graph and workflow detail UI.currentAutomationRunis the canonical live authored-run overlay when the workflow has been dispatched intoautomation-engine.executionHistory[*].automationRunmirrors the same automation-engine handle per workflow execution ref, so UI surfaces can show step-level authored progress without re-queryingv2.automationRuns.*.