deactivate_workflow
Stop an active n8n workflow from running by providing its ID. This action prevents the workflow from executing automated tasks and processes.
Instructions
Deactivate an n8n workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:427-432 (handler)MCP tool handler: resolves workflow ID (supports aliases), delegates to N8nClient.deactivateWorkflow(), attaches numeric alias to result, formats as MCP content 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/index.ts:75-75 (registration)Tool registration in listTools response: defines name, description, and input schema (id: string|number).{ name: 'deactivate_workflow', description: 'Deactivate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
- src/n8n-client.ts:227-231 (helper)N8nClient helper: performs POST /workflows/{id}/deactivate API call, normalizes response to return workflow object.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; }