deactivate-workflow
Stop a workflow from running by deactivating it using its ID. This prevents automated execution in n8n workflows.
Instructions
Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| id | Yes |
Implementation Reference
- src/index.ts:1099-1128 (handler)MCP tool handler for 'deactivate-workflow': validates arguments, retrieves N8nClient instance, calls deactivateWorkflow method, and returns success/error response.case "deactivate-workflow": { const { clientId, id } = args as { clientId: string; id: string }; const client = clients.get(clientId); if (!client) { return { content: [{ type: "text", text: "Client not initialized. Please run init-n8n first.", }], isError: true }; } try { const workflow = await client.deactivateWorkflow(id); return { content: [{ type: "text", text: `Successfully deactivated workflow:\n${JSON.stringify(workflow, null, 2)}`, }] }; } catch (error) { return { content: [{ type: "text", text: error instanceof Error ? error.message : "Unknown error occurred", }], isError: true }; }
- src/index.ts:495-506 (registration)Tool registration in listTools handler: defines name, description, and input schema for 'deactivate-workflow'.{ name: "deactivate-workflow", description: "Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.", inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] } },
- src/index.ts:498-505 (schema)Input schema definition for 'deactivate-workflow' tool: requires clientId and id as strings.inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] }
- src/index.ts:198-202 (helper)N8nClient helper method: makes POST request to n8n API endpoint /workflows/{id}/deactivate to deactivate the workflow.async deactivateWorkflow(id: string): Promise<N8nWorkflow> { return this.makeRequest<N8nWorkflow>(`/workflows/${id}/deactivate`, { method: 'POST', }); }