n8n_deactivate_workflow
Stop a workflow from being triggered by deactivating it using its ID. This prevents automated processes from running until reactivated.
Instructions
Deactivate a workflow to stop it from being triggered.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The workflow ID to deactivate |
Implementation Reference
- src/tools/workflow-tools.ts:365-392 (handler)The main execution handler for the n8n_deactivate_workflow tool. Extracts the workflow ID from arguments, calls the N8nApiClient.deactivateWorkflow method, and returns a formatted success response with the updated workflow details.n8n_deactivate_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.deactivateWorkflow(id); return { content: [ { type: 'text' as const, text: JSON.stringify({ success: true, message: `Workflow "${workflow.name}" deactivated successfully`, workflow: { id: workflow.id, name: workflow.name, active: workflow.active, }, }, null, 2), }, ], }; },
- src/tools/workflow-tools.ts:145-159 (schema)Tool schema definition specifying the name, description, and input schema requiring a single 'id' string parameter.{ name: 'n8n_deactivate_workflow', description: 'Deactivate a workflow to stop it from being triggered.', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'The workflow ID to deactivate', }, }, required: ['id'], }, }, ];
- src/server.ts:60-64 (registration)MCP server registration for listing tools. Responds to ListToolsRequestSchema by returning the allTools array, which includes the n8n_deactivate_workflow tool schema.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
- src/server.ts:122-125 (registration)Tool call dispatch registration. Routes execution requests for workflow tools, including n8n_deactivate_workflow, to the corresponding handler in workflowToolHandlers.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }