n8n_activate_workflow
Activate an n8n workflow to enable automated task execution by making it ready for triggering through its configured nodes.
Instructions
Activate a workflow so it can be triggered. The workflow must have a valid trigger node.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The workflow ID to activate |
Implementation Reference
- src/tools/workflow-tools.ts:336-363 (handler)The handler function that executes the tool logic: validates the workflow ID, calls client.activateWorkflow(id), and returns a formatted success response with workflow details.n8n_activate_workflow: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const id = args.id as string; if (!id) { throw new Error('Workflow ID is required'); } const workflow = await client.activateWorkflow(id); return { content: [ { type: 'text' as const, text: JSON.stringify({ success: true, message: `Workflow "${workflow.name}" activated successfully`, workflow: { id: workflow.id, name: workflow.name, active: workflow.active, }, }, null, 2), }, ], }; },
- src/tools/workflow-tools.ts:131-144 (schema)The ToolDefinition object specifying the tool's name, description, and inputSchema (requiring a string 'id'). This is part of the workflowTools array used for tool listing.{ name: 'n8n_activate_workflow', description: 'Activate a workflow so it can be triggered. The workflow must have a valid trigger node.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The workflow ID to activate', }, }, required: ['id'], }, },
- src/server.ts:122-125 (registration)Runtime dispatch/registration logic in the MCP server's handleToolCall method that checks if the tool name exists in workflowToolHandlers and invokes the corresponding handler with the N8nApiClient and arguments.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }