remora-monorepo / lib / ExecuteWorkflowOptions
Interface: ExecuteWorkflowOptions<ExecutionContext, ApprovalRequestDecisionDetails>
Defined in: packages/core/src/executor/executor-types.ts:57
Options for executeWorkflow.
Type Parameters
ExecutionContext
ExecutionContext extends Record<string, unknown> = Record<string, unknown>
ApprovalRequestDecisionDetails
ApprovalRequestDecisionDetails extends Record<string, unknown> = Record<string, unknown>
Properties
agent?
optionalagent:Agent<any,any,any>
Defined in: packages/core/src/executor/executor-types.ts:72
An AI SDK Agent to use for agent-loop steps. When provided, agent-loop steps use the Agent's own tools and describe the expected output shape in the prompt. The bare model is then used to coerce the Agent's text output into the structured format. Only applies to agent-loop steps.
approvalBackoffMultiplier?
optionalapprovalBackoffMultiplier:number
Defined in: packages/core/src/executor/executor-types.ts:102
Backoff multiplier applied to the polling interval after each attempt.
See
DEFAULT_APPROVAL_BACKOFF_MULTIPLIER
approvalIntervalMs?
optionalapprovalIntervalMs:number
Defined in: packages/core/src/executor/executor-types.ts:100
Initial polling interval in milliseconds for approval condition checks.
See
approvalMaxIntervalMs?
optionalapprovalMaxIntervalMs:number
Defined in: packages/core/src/executor/executor-types.ts:104
Maximum polling interval in milliseconds. The interval will never grow beyond this.
See
DEFAULT_APPROVAL_MAX_INTERVAL_MS
approvalTimeoutMs?
optionalapprovalTimeoutMs:number
Defined in: packages/core/src/executor/executor-types.ts:98
Timeout in milliseconds for approval requests before treating as rejection.
See
channel?
optionalchannel:WorkflowExecutionStateChannel
Defined in: packages/core/src/executor/executor-types.ts:86
Optional channel for publishing execution state snapshots. Publishes on every state transition, in addition to onStateChange.
context?
optionalcontext:DurableContext
Defined in: packages/core/src/executor/executor-types.ts:88
Injectable durable execution context. Default: simple in-process implementation.
executionContext?
optionalexecutionContext:ExecutionContext
Defined in: packages/core/src/executor/executor-types.ts:96
App-defined execution context passed to policy deciders (e.g. user, organization, session).
initialState?
optionalinitialState:object
Defined in: packages/core/src/executor/executor-types.ts:92
Previous execution state to resume from. When provided, completed steps are skipped and execution continues from the first incomplete step.
completedAt?
optionalcompletedAt:string="string"
durationMs?
optionaldurationMs:number="number"
error?
optionalerror:object=errorSnapshotSchema
error.category
category:
string="string"
error.code
code:
string="string"
error.isRetryable?
optionalisRetryable:boolean="boolean"
error.message
message:
string="string"
error.statusCode?
optionalstatusCode:number="number"
error.stepId?
optionalstepId:string="string"
output?
optionaloutput:unknown="unknown"
runId
runId:
string="string"
startedAt
startedAt:
string="string"
status
status:
"pending"|"running"|"completed"|"failed"=runStatusSchema
stepRecords
stepRecords:
object[]
workflowHash?
optionalworkflowHash:string="string"
inputs?
optionalinputs:Record<string,unknown>
Defined in: packages/core/src/executor/executor-types.ts:74
Input values passed to the workflow's start step. Validated against the start step's inputSchema.
limits?
optionallimits:ExecutorLimits
Defined in: packages/core/src/executor/executor-types.ts:90
Execution limits for sleep/wait/timeout bounds.
maxRetries?
optionalmaxRetries:number
Defined in: packages/core/src/executor/executor-types.ts:76
Maximum number of retries for recoverable errors (rate limits, network errors, parse failures). Defaults to 3.
model?
optionalmodel:LanguageModel
Defined in: packages/core/src/executor/executor-types.ts:67
An AI SDK LanguageModel for llm-prompt, extract-data, and agent-loop steps. Required if the workflow contains LLM steps.
onStateChange()?
optionalonStateChange: (state,delta) =>void
Defined in: packages/core/src/executor/executor-types.ts:84
Called on every state transition with the full execution state and the idempotent delta that produced it.
Parameters
state
completedAt?
string = "string"
durationMs?
number = "number"
error?
{ category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; } = errorSnapshotSchema
error.category
string = "string"
error.code
string = "string"
error.isRetryable?
boolean = "boolean"
error.message
string = "string"
error.statusCode?
number = "number"
error.stepId?
string = "string"
output?
unknown = "unknown"
runId
string = "string"
startedAt
string = "string"
status
"pending" | "running" | "completed" | "failed" = runStatusSchema
stepRecords
object[] = ...
workflowHash?
string = "string"
delta
{ runId: string; startedAt: string; type: "run-started"; } | { path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; startedAt: string; stepId: string; type: "step-started"; } | { completedAt: string; durationMs: number; output: unknown; path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; resolvedInputs?: unknown; stepId: string; trace?: ({ data?: unknown; message: string; type: "log"; } | { step: unknown; type: "agent-step"; })[]; type: "step-completed"; } | { durationMs: number; error: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; failedAt: string; path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; resolvedInputs?: unknown; stepId: string; type: "step-failed"; } | { path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; retry: { attempt: number; errorCode: string; errorMessage: string; failedAt: string; startedAt: string; }; stepId: string; type: "step-retry"; } | { completedAt: string; durationMs: number; output?: unknown; runId: string; type: "run-completed"; } | { durationMs: number; error: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; failedAt: string; runId: string; type: "run-failed"; } | { path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; requestedAt: string; sourcePolicyId: string; stepId: string; type: "step-awaiting-approval"; } | { approvedAt: string; path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; sourcePolicyId: string; stepId: string; type: "step-approved"; } | { deniedAt: string; path: ({ itemValue: unknown; iterationIndex: number; stepId: string; type: "for-each"; } | { matchedCaseIndex: number; matchedValue: unknown; stepId: string; type: "switch-case"; } | { pollAttempt: number; stepId: string; type: "wait-for-condition"; })[]; reason?: string; sourcePolicyId: string; stepId: string; type: "step-denied"; }
Returns
void
onStepComplete()?
optionalonStepComplete: (stepId,output) =>void
Defined in: packages/core/src/executor/executor-types.ts:82
Called when a step completes successfully.
Parameters
stepId
string
output
unknown
Returns
void
onStepStart()?
optionalonStepStart: (stepId,step) =>void
Defined in: packages/core/src/executor/executor-types.ts:80
Called when a step begins execution.
Parameters
stepId
string
step
{ description: string; id: string; name: string; nextStepId?: string; params: { toolInput: {[key: string]: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; toolName: string; }; type: "tool-call"; } | { description: string; id: string; name: string; nextStepId?: string; params: { outputFormat: object; prompt: string; }; type: "llm-prompt"; } | { description: string; id: string; name: string; nextStepId?: string; params: { outputFormat: object; sourceData: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; type: "extract-data"; } | { description: string; id: string; name: string; nextStepId?: string; params: { cases: object[]; switchOn: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; type: "switch-case"; } | { description: string; id: string; name: string; nextStepId?: string; params: { itemName: string; loopBodyStepId: string; target: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; type: "for-each"; } | { description: string; id: string; name: string; nextStepId?: string; params: { durationMs: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; type: "sleep"; } | { description: string; id: string; name: string; nextStepId?: string; params: { backoffMultiplier?: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; condition: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; conditionStepId: string; intervalMs?: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; maxAttempts?: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; timeoutMs?: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; type: "wait-for-condition"; } | { description: string; id: string; name: string; nextStepId?: string; params: { instructions: string; maxSteps?: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; outputFormat: object; tools: string[]; }; type: "agent-loop"; } | { description: string; id: string; name: string; nextStepId?: string; type: "start"; } | { description: string; id: string; name: string; nextStepId?: string; params?: { output: { type: "literal"; value: unknown; } | { expression: string; type: "jmespath"; } | { template: string; type: "template"; }; }; type: "end"; }
Returns
void
policies?
optionalpolicies:Policy<ExecutionContext,ApprovalRequestDecisionDetails>[]
Defined in: packages/core/src/executor/executor-types.ts:94
Authorization policies evaluated in order before each tool-call step. When absent, all steps execute freely.
retryDelayMs?
optionalretryDelayMs:number
Defined in: packages/core/src/executor/executor-types.ts:78
Base delay in milliseconds for exponential backoff between retries. Defaults to 1000.
tools
tools:
ToolSet
Defined in: packages/core/src/executor/executor-types.ts:65
Tool definitions. Every tool referenced by a tool-call step must be present with an execute function.