Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

start()

The start function begins execution of a workflow run. It processes all steps in the defined workflow order, handling parallel execution, branching logic, and step dependencies.

UsageDirect link to Usage

const { runId, start } = workflow.createRun();
const result = await start({
triggerData: { inputValue: 42 },
});

ParametersDirect link to Parameters

config?:

object
Configuration for starting the workflow run

configDirect link to config

triggerData:

Record<string, any>
Initial data that matches the workflow's triggerSchema

ReturnsDirect link to Returns

results:

Record<string, any>
Combined output from all completed workflow steps

status:

'completed' | 'error' | 'suspended'
Final status of the workflow run

Error HandlingDirect link to Error Handling

The start function may throw several types of validation errors:

try {
const result = await start({ triggerData: data });
} catch (error) {
if (error instanceof ValidationError) {
console.log(error.type); // 'circular_dependency' | 'no_terminal_path' | 'unreachable_step'
console.log(error.details);
}
}

On this page