import type { Normalized } from "../../shared/schema-utils/index.js"; import type { WorkflowBlockConfigFriendlyStruct, WorkflowBlockConfigFriendlyValueOf } from "../../shared/workflow/config-schema/index.js"; import type { WorkflowOutcomeDataNode, WorkflowOutcomeDataRuntimeValueOf } from "../../shared/workflow/outcome-data-schema/index.js"; import type { WorkflowOutcomeIdentifier } from "../../shared/workflow/outcome-identifier.js"; export type WorkflowBlockExecutorConfig = WorkflowBlockConfigFriendlyValueOf>; /** * Runtime metadata passed into a step block's `execute` handler. */ export type WorkflowBlockExecutorMetadata = { workflowId: string; workflowVersionId: string; workflowBlockId: string; workflowRunId: string; uniqueExecutionId: string; workflowTitle: string; workflowUrl: string; runUrl: string; /** Used to finish a deferred workflow block execution. */ finishCallbackUrl: string; }; export type WorkflowBlockExecutorReturn = ({ /** Finish the block execution with an outcome. */ type: "outcome"; data: WorkflowOutcomeDataRuntimeValueOf | null; } & WorkflowOutcomeIdentifier) | { /** Finish the block execution without an outcome. */ type: "exit"; } | { /** Raise an error. */ type: "error"; errorMessage: string; retryable?: boolean; } | { /** Keep this block execution running until it is finished later via `finishCallbackUrl`. */ type: "defer"; }; /** Context passed into a step block's `execute` handler. */ export type WorkflowBlockExecutorContext = { config: WorkflowBlockExecutorConfig; metadata: WorkflowBlockExecutorMetadata; }; export type WorkflowBlockExecutor = (ctx: WorkflowBlockExecutorContext) => Promise | WorkflowBlockExecutorReturn; //# sourceMappingURL=execute.d.ts.map