ApprovalDecision to the configured output:
Import
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | (required) | Unique node id within the workflow. |
output | z.ZodObject | Table | string | (required) | Where to persist the decision. Zod schema from outputs (recommended), Drizzle table, or string key. |
outputSchema | z.ZodObject | approvalDecisionSchema | Override the decision schema (manual DB API). |
request | { title: string; summary?: string; metadata?: Record<string, unknown> } | (required) | Human-facing request. title becomes the node label. |
onDeny | "fail" | "continue" | "skip" | "fail" | Behavior after denial. "continue" and "skip" still persist the denial. |
dependsOn | string[] | undefined | Task IDs that must complete first. |
needs | Record<string, string> | undefined | Named deps. Keys become context keys, values are task IDs. |
skipIf | boolean | false | Skip this node entirely. |
timeoutMs | number | undefined | Max wait in ms. Node fails on timeout. |
retries | number | 0 | Retry attempts before failure. |
retryPolicy | RetryPolicy | undefined | { backoff?: "fixed" | "linear" | "exponential", initialDelayMs?: number } |
continueOnFail | boolean | false | Workflow continues even if this node fails. |
cache | CachePolicy | undefined | { by?: (ctx) => unknown, version?: string }. Skip re-execution on cache hit. |
label | string | request.title | Display label override. |
meta | Record<string, unknown> | undefined | Extra metadata merged with request fields. |
Schema-driven Example
Manual API Example
PassoutputSchema={approvalDecisionSchema} when output is a Drizzle table.
Behavior
- Workflow enters
waiting-approvalwhen this node is reached. smithers approve/smithers denyupdates the record durably.- On resume, the node resolves to a decision object; downstream JSX branches on the value.
onDeny="fail"— hard gate.onDeny="continue"— branch ondecision.approved.
<Approval> vs needsApproval
| Use | When |
|---|---|
<Approval> | Decision must be persisted as data and consumed by downstream nodes. |
needsApproval on <Task> | Simple pause before a task; no separate decision value needed. |