deactivate_workflow
Stop an active n8n workflow from executing by providing its ID. This tool halts workflow automation processes in the n8n platform.
Instructions
Deactivate an n8n workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:75-75 (registration)Registration of the 'deactivate_workflow' tool in the MCP server tool list, including name, description, and input schema.{ name: 'deactivate_workflow', description: 'Deactivate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
- src/index.ts:427-432 (handler)Primary MCP tool handler method that resolves workflow ID alias, calls N8nClient.deactivateWorkflow, adds numeric alias, and returns success response.private async handleDeactivateWorkflow(args: { id: string | number }) { const id = this.resolveWorkflowId(args.id); const workflow = await this.n8nClient.deactivateWorkflow(id); this.withAlias(workflow); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(workflow), null, 2) }] }; }
- src/n8n-client.ts:227-231 (handler)Core implementation in N8nClient: makes POST request to n8n API endpoint `/workflows/${id}/deactivate` to deactivate the workflow.async deactivateWorkflow(id: string | number): Promise<N8nWorkflow> { const response = await this.api.post<N8nApiResponse<N8nWorkflow> | N8nWorkflow>(`/workflows/${id}/deactivate`); const payload: any = response.data as any; return (payload && typeof payload === 'object' && 'data' in payload) ? payload.data : payload; }