Workflows hooks
Hand-written shim. Generated CRUD via ./workflows.gen. The hooks below cover the workflow-run sub-resource and graph-replace mutation that the manifest pipeline doesn't model.
Hooks
useCreateWorkflow mutation
Create a workflow.
useCreateWorkflow(options?: MutationOpts<Workflow, CreateWorkflowParams>)Types: Workflow · CreateWorkflowParams
useDeleteWorkflow mutation
Soft-delete a workflow.
useDeleteWorkflow(options?: MutationOpts<SuccessResponse, string>)Types: SuccessResponse
useGetWorkflowRun query
Fetch a single workflow run by workflow and run ID.
useGetWorkflowRun(workflowId: string, runId: string, options?: QueryOpts<WorkflowRun>)Types: WorkflowRun
const { data: run } = useGetWorkflowRun("wfl_abc123", "run_abc123");useListWorkflows query
List workflows.
useListWorkflows(params?: Omit<ListWorkflowsParams, | > & { filter?: WorkflowFilter; orderBy?: WorkflowOrderBy[]; } & WorkflowShorthands, options?: QueryOpts<Page<Workflow>>)Types: ListWorkflowsParams · WorkflowFilter · WorkflowOrderBy · WorkflowShorthands · Page · Workflow
usePurgeWorkflow composite
Permanently delete a soft-deleted workflow.
usePurgeWorkflow(options?: MutationOpts<SuccessResponse, PurgeWorkflowParams>)Types: SuccessResponse · PurgeWorkflowParams
usePutWorkflowGraph composite
Replace the entire graph (nodes + edges) of a workflow. Auto-invalidates workflow queries.
usePutWorkflowGraph(options?: MutationOpts<Workflow, PutWorkflowGraphParams>)Types: Workflow
const put = usePutWorkflowGraph();
put.mutate({ id: "wfl_abc123", nodes: [...], edges: [...] });useRestoreWorkflow composite
Restore a soft-deleted workflow.
useRestoreWorkflow(options?: MutationOpts<Workflow, string>)Types: Workflow
useRetrieveWorkflow query
Get a workflow by ID.
useRetrieveWorkflow(id: string, options?: QueryOpts<Workflow>)Types: Workflow
useStartWorkflowRun composite
Start a new run for a workflow. Auto-invalidates workflow and run queries.
useStartWorkflowRun(options?: MutationOpts<Run, StartWorkflowRunParams>)Types: Run
const start = useStartWorkflowRun();
start.mutate({ workflowId: "wfl_abc123", input: {} });useUpdateWorkflow mutation
Update a workflow.
useUpdateWorkflow(options?: MutationOpts<Workflow, UpdateWorkflowParams>)Types: Workflow · UpdateWorkflowParams
useWorkflowRunAction composite
Perform an action on a workflow run (pause, resume, retry, cancel). Auto-invalidates workflow and run queries.
useWorkflowRunAction(options?: MutationOpts<Run, WorkflowRunActionParams>)Types: Run
const act = useWorkflowRunAction();
act.mutate({ runId: "run_abc123", action: "cancel" });