Browse docsMenu

SDK

Workflows and Functions

Start workflows, poll runs, resume human waits, and call deterministic functions from app surfaces.

Workflow hooks

JobHook
Start a run with schema supportuseWorkflowStart
Start or poll one known workflowuseWorkflowRun
List runsuseWorkflowRuns
Show waits assigned to current pod memberuseWorkflowRunWaitAssignments
Resume a runuseWorkflowResume
Legacy flow naminguseFlowSession, useFlowRunHistory

Start a workflow

tsxcopy
const workflow = useWorkflowRun({
  client,
  workflowName: "approve_ticket",
});

await workflow.start({ ticket_id: "ticket_123" });

Run a function

tsxcopy
const escalation = useFunctionRun({
  client,
  functionName: "escalate-ticket",
});

await escalation.run({
  ticket_id: "ticket_123",
  reason: "SLA breach risk",
});