import type { RequestContext } from '@mastra/core/request-context'; import type { Body, PathParams, QueryParams, RouteResponse } from '../route-types.generated.js'; import type { ClientOptions, GetWorkflowResponse, ListWorkflowRunsResponse, ListWorkflowRunsParams, GetWorkflowRunByIdResponse } from '../types.js'; import { BaseResource } from './base.js'; import { Run } from './run.js'; type WorkflowId = PathParams<'GET /workflows/:workflowId'>['workflowId']; type WorkflowRunId = PathParams<'GET /workflows/:workflowId/runs/:runId'>['runId']; export declare class Workflow extends BaseResource { private workflowId; constructor(options: ClientOptions, workflowId: WorkflowId); /** * Retrieves details about the workflow * @param requestContext - Optional request context to pass as query parameter * @returns Promise containing workflow details including steps and graphs */ details(requestContext?: RequestContext | Record): Promise; /** * Retrieves all runs for a workflow * @param params - Parameters for filtering runs * @param requestContext - Optional request context to pass as query parameter * @returns Promise containing workflow runs array */ runs(params?: ListWorkflowRunsParams, requestContext?: RequestContext | Record): Promise; /** * Retrieves a specific workflow run by its ID * @param runId - The ID of the workflow run to retrieve * @param options - Optional configuration * @param options.requestContext - Optional request context to pass as query parameter * @param options.fields - Optional array of fields to return (e.g., ['result', 'steps']). Available fields: result, error, payload, steps, activeStepsPath, serializedStepGraph. Metadata fields (runId, workflowName, resourceId, createdAt, updatedAt) and status are always included. * @param options.withNestedWorkflows - Whether to include nested workflow data in steps. Defaults to true. Set to false for better performance when you don't need nested workflow details. * @returns Promise containing the workflow run details with metadata and processed execution state */ runById(runId: WorkflowRunId, options?: { requestContext?: RequestContext | Record; fields?: string[]; withNestedWorkflows?: boolean; }): Promise; /** * Deletes a specific workflow run by its ID * @param runId - The ID of the workflow run to delete * @returns Promise containing a success message */ deleteRunById(runId: WorkflowRunId): Promise>; /** * Retrieves the input/output schema for the workflow * @returns Promise containing parsed inputSchema and outputSchema, or null if not defined */ getSchema(): Promise<{ inputSchema: Record | null; outputSchema: Record | null; }>; /** * Creates a new workflow run * @param params - Optional object containing the optional runId * @returns Promise containing the Run instance */ createRun(params?: QueryParams<'POST /workflows/:workflowId/create-run'> & Body<'POST /workflows/:workflowId/create-run'>): Promise; /** * Creates a new ReadableStream from an iterable or async iterable of objects, * serializing each as JSON and separating them with the record separator (\x1E). * * @param records - An iterable or async iterable of objects to stream * @returns A ReadableStream emitting the records as JSON strings separated by the record separator */ static createRecordStream(records: Iterable | AsyncIterable): ReadableStream; } export {}; //# sourceMappingURL=workflow.d.ts.map