n8n_create_workflow
Create a new workflow in n8n by defining nodes and connections to automate tasks and integrate systems.
Instructions
Create a new workflow
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Workflow name | |
| nodes | Yes | Array of workflow nodes | |
| connections | No | Node connections | |
| settings | No | Workflow settings | |
| active | No | Whether workflow is active |
Implementation Reference
- src/index.ts:72-80 (handler)The MCP request handler case for 'n8n_create_workflow', which calls the n8nClient.createWorkflow method.
case 'n8n_create_workflow': { if (!args?.name || !args?.nodes) { throw new Error('name and nodes are required'); } const result = await n8nClient.createWorkflow(args); return { content: [{ type: 'text', text: formatResponse(result) }], }; } - src/n8n-client.ts:61-64 (helper)The n8nClient method that performs the actual POST request to the n8n API to create a workflow.
async createWorkflow(data: any): Promise<any> { const response = await this.client.post('/workflows', data); return response.data; } - src/index.ts:468-481 (registration)The tool definition and input schema registration for 'n8n_create_workflow'.
name: 'n8n_create_workflow', description: 'Create a new workflow', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Workflow name' }, nodes: { type: 'array', description: 'Array of workflow nodes' }, connections: { type: 'object', description: 'Node connections' }, settings: { type: 'object', description: 'Workflow settings' }, active: { type: 'boolean', description: 'Whether workflow is active' }, }, required: ['name', 'nodes'], }, },