Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYes

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'] } },
  • 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) }] }; }
  • 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; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get2knowio/n8n-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server