Skip to main content
Glama

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

Implementation Reference

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

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