Requests cooperative cancellation of the workflow. Unlike
terminate() (which terminates immediately), cancel() sets
a durable flag that the workflow detects at its next durable
operation (sleep, proxyActivities, executeChild, etc.).
The workflow receives a CancelledFailure error that it can
catch to perform cleanup before exiting.
const handle = await client.workflow.start({ ... });
await handle.cancel();
// Workflow will throw CancelledFailure at its next durable operation
Export the raw workflow state as a DurableJobExport with five sections:
0 = complete, > 0 = pending, < 0 = error)Use allow / block to limit sections and values: false to strip payloads.
Optionaloptions: ExportOptionsExport the workflow as a structured event history (WorkflowExecution).
Returns a chronologically ordered event list with Temporal-style typed events, back-references between scheduled/completed pairs, and a summary with counts.
Event types: activity_task_scheduled/completed/failed,
child_workflow_execution_started/completed/failed, timer_started/fired,
workflow_execution_started/completed/failed/signaled
Modes:
sparse (default) — single query, transforms timeline markers into eventsverbose — recursively fetches child workflows as nested childrenOptions: exclude_system, omit_results, enrich_inputs, allow_direct_query
Optionaloptions: ExecutionExportOptionsBlocks until the workflow completes and returns the result. If the
workflow failed, the error is rethrown (with stack trace) unless
throwOnError: false is set, in which case the error object is
returned directly.
Optionalconfig: { Optionalstate?: booleanOptionalthrowDelivers a named signal to the workflow. If the workflow is paused
on Durable.workflow.condition(signalId), it resumes with the
provided data.
If the signal arrives before the workflow has registered its hook
(race condition under load), it is buffered as a pending signal
for up to expire (default 10 minutes). Use a longer duration
when signaling "early on purpose" (e.g., depositing a payload
hours before the workflow starts).
Matches the signalId passed to condition().
Payload delivered to the waiting workflow.
Optionalexpire: stringOptional pending signal TTL (e.g., '1h', '30d'). Default '10m'.
Returns the current workflow state. For a completed workflow this is the final output; for a running workflow it reflects the latest persisted state (may change as activities complete).
If true, returns the full job envelope including
internal metadata alongside the data.
Immediately terminates the workflow. The job is marked as interrupted, subscribers are notified, and the job hash is expired. Unlike cancel, this does not give the workflow a chance to run cleanup code.
Optionaloptions: JobInterruptOptions
Handle to a running or completed workflow execution. Returned by
client.workflow.start()andclient.workflow.getHandle().Example