@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
62 lines • 2.6 kB
TypeScript
import type { RequestContext } from '../../di/index.js';
import type { PubSub } from '../../events/pubsub.js';
import type { Mastra } from '../../mastra/index.js';
import { ExecutionEngine } from '../../workflows/execution-engine.js';
import type { ExecutionEngineOptions, ExecutionGraph } from '../../workflows/execution-engine.js';
import type { SerializedStepFlowEntry, StepResult, RestartExecutionParams, TimeTravelExecutionParams } from '../types.js';
import type { WorkflowEventProcessor } from './workflow-event-processor/index.js';
export declare class EventedExecutionEngine extends ExecutionEngine {
protected eventProcessor: WorkflowEventProcessor;
constructor({ mastra, eventProcessor, options, }: {
mastra?: Mastra;
eventProcessor: WorkflowEventProcessor;
options: ExecutionEngineOptions;
});
__registerMastra(mastra: Mastra): void;
/**
* Internal workflows (registered via `Mastra.__registerInternalWorkflow`)
* are resolvable from the workflow event processor but `Mastra.getWorkflow`
* intentionally only sees public ones. The `execute` resume/time-travel
* branches need access to the workflow's step graph by id, so prefer the
* internal registry when present.
*/
private resolveWorkflow;
/**
* Executes a workflow run with the provided execution graph and input
* @param graph The execution graph to execute
* @param input The input data for the workflow
* @returns A promise that resolves to the workflow output
*/
execute<TState, TInput, TOutput>(params: {
workflowId: string;
runId: string;
resourceId?: string;
graph: ExecutionGraph;
serializedStepGraph: SerializedStepFlowEntry[];
input?: TInput;
initialState?: TState;
restart?: RestartExecutionParams;
timeTravel?: TimeTravelExecutionParams;
resume?: {
steps: string[];
stepResults: Record<string, StepResult<any, any, any, any>>;
resumePayload: any;
resumePath: number[];
forEachIndex?: number;
};
pubsub?: PubSub;
requestContext: RequestContext;
retryConfig?: {
attempts?: number;
delay?: number;
};
abortController: AbortController;
format?: 'legacy' | 'vnext' | undefined;
outputOptions?: {
includeState?: boolean;
includeResumeLabels?: boolean;
};
perStep?: boolean;
}): Promise<TOutput>;
}
//# sourceMappingURL=execution-engine.d.ts.map