n8n_activate_workflow
Activate an n8n workflow to enable automated processes 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 n8n_activate_workflow tool. Validates the workflow ID, calls the N8nApiClient to activate the workflow, and returns a formatted success response.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 tool schema definition specifying the name, description, and input schema (requires 'id' string) for the n8n_activate_workflow tool.{ 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)The runtime registration/dispatch logic in the MCP server that checks if the tool name exists in workflowToolHandlers and invokes the corresponding handler with the API client.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }