remora-monorepo / viewer / UseWorkflowExecutionOptions
Interface: UseWorkflowExecutionOptions
Defined in: packages/ui/src/hooks/use-workflow-execution.ts:7
Properties
execute()
execute: (
params) =>AsyncIterable<{completedAt?:string;durationMs?:number;error?: {category:string;code:string;isRetryable?:boolean;message:string;statusCode?:number;stepId?:string; };output?:unknown;runId:string;startedAt:string;status:"pending"|"running"|"completed"|"failed";stepRecords:object[];workflowHash?:string; },any,any> |Promise<AsyncIterable<{completedAt?:string;durationMs?:number;error?: {category:string;code:string;isRetryable?:boolean;message:string;statusCode?:number;stepId?:string; };output?:unknown;runId:string;startedAt:string;status:"pending"|"running"|"completed"|"failed";stepRecords:object[];workflowHash?:string; },any,any>>
Defined in: packages/ui/src/hooks/use-workflow-execution.ts:9
Function that starts execution and returns an async iterable of state snapshots.
Parameters
params
initialState?
{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }
initialState.completedAt?
string
initialState.durationMs?
number
initialState.error?
{ category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }
initialState.error.category
string
initialState.error.code
string
initialState.error.isRetryable?
boolean
initialState.error.message
string
initialState.error.statusCode?
number
initialState.error.stepId?
string
initialState.output?
unknown
initialState.runId
string
initialState.startedAt
string
initialState.status
"pending" | "running" | "completed" | "failed"
initialState.stepRecords
object[]
initialState.workflowHash?
string
inputs
Record<string, unknown>
workflow
{ initialStepId: string; inputSchema?: object; outputSchema?: object; steps: ({ description: string; id: string; name: string; nextStepId?: string; params: { toolInput: {[x: 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: { 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: { 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: { 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"; })[]; }
workflow.initialStepId
string
workflow.inputSchema?
object
workflow.outputSchema?
object
workflow.steps
({ description: string; id: string; name: string; nextStepId?: string; params: { toolInput: {[x: 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: { 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: { 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: { 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
AsyncIterable<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }, any, any> | Promise<AsyncIterable<{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; }, any, any>>
persist?
optionalpersist:object
Defined in: packages/ui/src/hooks/use-workflow-execution.ts:16
Optional persistence layer for pause/resume across page reloads.
clear()
clear: (
hash) =>void
Parameters
hash
string
Returns
void
load()
load: (
hash) => {completedAt?:string;durationMs?:number;error?: {category:string;code:string;isRetryable?:boolean;message:string;statusCode?:number;stepId?:string; };output?:unknown;runId:string;startedAt:string;status:"pending"|"running"|"completed"|"failed";stepRecords:object[];workflowHash?:string; } |null
Parameters
hash
string
Returns
{ completedAt?: string; durationMs?: number; error?: { category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }; output?: unknown; runId: string; startedAt: string; status: "pending" | "running" | "completed" | "failed"; stepRecords: object[]; workflowHash?: string; } | null
save()
save: (
hash,state) =>void
Parameters
hash
string
state
completedAt?
string
durationMs?
number
error?
{ category: string; code: string; isRetryable?: boolean; message: string; statusCode?: number; stepId?: string; }
error.category
string
error.code
string
error.isRetryable?
boolean
error.message
string
error.statusCode?
number
error.stepId?
string
output?
unknown
runId
string
startedAt
string
status
"pending" | "running" | "completed" | "failed"
stepRecords
object[]
workflowHash?
string
Returns
void