n8n_run_workflow
Execute a specific n8n workflow manually by providing its ID and optional input data to trigger automation processes.
Instructions
Execute a workflow manually with optional input data.
Args:
id (string): Workflow ID to run
data (object, optional): Input data to pass to the workflow's first node
Returns: Execution result with:
executionId: ID of this execution
status: Current status
data: Output data from the workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Workflow ID to run | |
| data | No | Input data to pass to the workflow |
Implementation Reference
- src/tools/workflows.ts:336-345 (handler)The handler function for n8n_run_workflow that executes the workflow via a POST request.
async (params: z.infer<typeof RunWorkflowSchema>) => { const body = params.data ? { data: params.data } : undefined; const execution = await post<N8nExecution>(`/workflows/${params.id}/run`, body); const text = `🚀 Workflow execution started!\n\n- Execution ID: ${execution.id}\n- Status: ${execution.status}\n- Started: ${execution.startedAt}`; return { content: [{ type: 'text', text }], structuredContent: execution }; - src/tools/workflows.ts:313-335 (registration)Registration of the n8n_run_workflow tool.
server.registerTool( 'n8n_run_workflow', { title: 'Run n8n Workflow', description: `Execute a workflow manually with optional input data. Args: - id (string): Workflow ID to run - data (object, optional): Input data to pass to the workflow's first node Returns: Execution result with: - executionId: ID of this execution - status: Current status - data: Output data from the workflow`, inputSchema: RunWorkflowSchema, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true } }, - src/schemas/index.ts:118-123 (schema)Schema definition for the n8n_run_workflow input parameters.
export const RunWorkflowSchema = z.object({ id: z.string().min(1) .describe('Workflow ID to run'), data: z.record(z.unknown()).optional() .describe('Input data to pass to the workflow') }).strict();