Skip to main content
Glama

n8n_deactivate_workflow

Stop a workflow from being triggered by deactivating it using its ID. This prevents automated processes from running until reactivated.

Instructions

Deactivate a workflow to stop it from being triggered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe workflow ID to deactivate

Implementation Reference

  • The main execution handler for the n8n_deactivate_workflow tool. Extracts the workflow ID from arguments, calls the N8nApiClient.deactivateWorkflow method, and returns a formatted success response with the updated workflow details.
    n8n_deactivate_workflow: async (
      client: N8nApiClient,
      args: Record<string, unknown>
    ): Promise<ToolResult> => {
      const id = args.id as string;
      if (!id) {
        throw new Error('Workflow ID is required');
      }
    
      const workflow = await client.deactivateWorkflow(id);
    
      return {
        content: [
          {
            type: 'text' as const,
            text: JSON.stringify({
              success: true,
              message: `Workflow "${workflow.name}" deactivated successfully`,
              workflow: {
                id: workflow.id,
                name: workflow.name,
                active: workflow.active,
              },
            }, null, 2),
          },
        ],
      };
    },
  • Tool schema definition specifying the name, description, and input schema requiring a single 'id' string parameter.
      {
        name: 'n8n_deactivate_workflow',
        description: 'Deactivate a workflow to stop it from being triggered.',
        inputSchema: {
          type: 'object',
          properties: {
            id: {
              type: 'string',
              description: 'The workflow ID to deactivate',
            },
          },
          required: ['id'],
        },
      },
    ];
  • src/server.ts:60-64 (registration)
    MCP server registration for listing tools. Responds to ListToolsRequestSchema by returning the allTools array, which includes the n8n_deactivate_workflow tool schema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: allTools,
      };
    });
  • src/server.ts:122-125 (registration)
    Tool call dispatch registration. Routes execution requests for workflow tools, including n8n_deactivate_workflow, to the corresponding handler in workflowToolHandlers.
    if (name in workflowToolHandlers) {
      const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers];
      return handler(client, args);
    }

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/alicankiraz1/cursor-n8n-builder'

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