import type { WorkflowBlockConfigFriendlyStruct } 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"; import type { WorkflowBlockExecutorConfig, WorkflowBlockExecutorMetadata } from "./execute.js"; export type WorkflowBlockFinisherReturn = ({ /** Finish the block execution with an outcome. */ type: "outcome"; data: WorkflowOutcomeDataRuntimeValueOf | null; } & WorkflowOutcomeIdentifier) | { /** Finish the block execution without an outcome. */ type: "exit"; } | { /** * Raise an unclassified error. * * With no `id`, the run retries when `retryable` is set, then fails, or follows the * catch-all error path when the workflow author has turned on continue-on-error. */ type: "error"; errorMessage: string; retryable?: boolean; } | ({ /** * Raise a classified error. * * `id` must match an `` in the configurator. The workflow author decides * whether this outcome is handled. `data` is that outcome's payload. Pass `null` when * the outcome has no payload. */ type: "error"; errorMessage: string; retryable?: boolean; data: WorkflowOutcomeDataRuntimeValueOf | null; } & WorkflowOutcomeIdentifier) | { /** Return without updating the block execution. */ type: "no-op"; }; /** Context passed into a step block's `finish` handler, alongside the request. */ export type WorkflowBlockFinisherContext = { config: WorkflowBlockExecutorConfig; metadata: WorkflowBlockExecutorMetadata; }; export type WorkflowBlockFinisher = (req: Request, ctx: WorkflowBlockFinisherContext) => Promise | WorkflowBlockFinisherReturn; //# sourceMappingURL=finish.d.ts.map