quotaOptional
WorkflowQuotaPause | undefined
Quota pause resumed by this attempt, with the captured conversation and retained branch when known; present only on the first attempt after the pause and never persisted separately.
interactionOptional
TaskInteractionContext | undefined
Durable state and suspension operations, supplied only for tasks declaring an interaction.
idempotencyKeyRequired
string
Stable SHA-256 identity of executionId and task key, preserved across retries and checkpoint replay. Pass it to an effect service with persistent deduplication.
observationOptional
ObservationHub | undefined
Task-scoped hub with workflow execution, task key and attempt; pass it to custom nested work such as speculate.
signalRequired
AbortSignal
Aborted when the workflow is cancelled, stops on an error or times out, or when this attempt’s timeoutMs expires.
attemptRequired
number
One-based attempt number, cumulative across retries and checkpoint resumes; 0 in condition and cache key callbacks.
executionIdRequired
string
Identity of the workflow execution, preserved across checkpoint resumption.
reportUsageRequired
(usage: Usage) => void
Add token usage to the workflow budget; throws outside the active attempt. Agent task definitions report their usage themselves.
reportUsageOnceOptional
((receipt: string, usage: Usage) => void) | undefined
Add token usage only if the receipt ID has not already been recorded, including across checkpoint resumes.
checkpointOptional
(() => Promise<void>) | undefined
Save the workflow state now; does nothing without a checkpoint.
valueRequired
<T>(dependency: Task<T>) => T
Return the output of a task listed in after; throws for an undeclared dependency.