import { EventProcessor } from '../../../events/processor.js'; import type { Event } from '../../../events/types.js'; import type { Mastra } from '../../../mastra/index.js'; import type { StepResult, TimeTravelExecutionParams, WorkflowRunState } from '../../../workflows/types.js'; import type { Workflow } from '../../../workflows/workflow.js'; export type ProcessorArgs = { activeSteps: Record; workflow: Workflow; workflowId: string; runId: string; executionPath: number[]; stepResults: Record>; resumeSteps: string[]; prevResult: StepResult; requestContext: Record; timeTravel?: TimeTravelExecutionParams; resumeData?: any; parentWorkflow?: ParentWorkflow; parentContext?: { workflowId: string; input: any; }; retryCount?: number; perStep?: boolean; format?: 'legacy' | 'vnext'; state?: Record; outputOptions?: { includeState?: boolean; includeResumeLabels?: boolean; }; forEachIndex?: number; nestedRunId?: string; }; export type ParentWorkflow = { workflowId: string; runId: string; executionPath: number[]; resume: boolean; stepResults: Record>; parentWorkflow?: ParentWorkflow; stepId: string; }; export declare class WorkflowEventProcessor extends EventProcessor { private stepExecutor; private abortControllers; private parentChildRelationships; private runFormats; constructor({ mastra }: { mastra: Mastra; }); /** * Get or create an AbortController for a workflow run */ private getOrCreateAbortController; /** * Cancel a workflow run and all its nested child workflows */ private cancelRunAndChildren; /** * Clean up abort controller and relationships when a workflow completes. * Also cleans up any orphaned child entries that reference this run as parent. */ private cleanupRun; __registerMastra(mastra: Mastra): void; private errorWorkflow; protected processWorkflowCancel({ workflowId, runId }: ProcessorArgs): Promise; protected processWorkflowStart({ workflow, parentWorkflow, workflowId, runId, resumeSteps, prevResult, resumeData, timeTravel, executionPath, stepResults, requestContext, perStep, format, state, outputOptions, forEachIndex, }: ProcessorArgs & { initialState?: Record; }): Promise; protected endWorkflow(args: ProcessorArgs, status?: 'success' | 'failed' | 'canceled' | 'paused'): Promise; protected processWorkflowEnd(args: ProcessorArgs): Promise; protected processWorkflowSuspend(args: ProcessorArgs): Promise; protected processWorkflowFail(args: ProcessorArgs): Promise; protected processWorkflowStepRun({ workflow, workflowId, runId, executionPath, stepResults, activeSteps, resumeSteps, timeTravel, prevResult, resumeData, parentWorkflow, requestContext, retryCount, perStep, state, outputOptions, forEachIndex, }: ProcessorArgs): Promise; protected processWorkflowStepEnd({ workflow, workflowId, runId, executionPath, resumeSteps, timeTravel, prevResult, parentWorkflow, stepResults, activeSteps, parentContext, requestContext, perStep, state, outputOptions, forEachIndex, nestedRunId, }: ProcessorArgs): Promise; loadData({ workflowId, runId, }: { workflowId: string; runId: string; }): Promise; process(event: Event, ack?: () => Promise): Promise; } //# sourceMappingURL=index.d.ts.map