Skip to main content

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