Skip to main content
Glama

deactivate-workflow

Stop a workflow from running by deactivating it using its ID. This prevents automated execution in n8n workflows.

Instructions

Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientIdYes
idYes

Implementation Reference

  • MCP tool handler for 'deactivate-workflow': validates arguments, retrieves N8nClient instance, calls deactivateWorkflow method, and returns success/error response.
    case "deactivate-workflow": {
      const { clientId, id } = args as { clientId: string; id: string };
      const client = clients.get(clientId);
      if (!client) {
        return {
          content: [{
            type: "text",
            text: "Client not initialized. Please run init-n8n first.",
          }],
          isError: true
        };
      }
    
      try {
        const workflow = await client.deactivateWorkflow(id);
        return {
          content: [{
            type: "text",
            text: `Successfully deactivated workflow:\n${JSON.stringify(workflow, null, 2)}`,
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: error instanceof Error ? error.message : "Unknown error occurred",
          }],
          isError: true
        };
      }
  • src/index.ts:495-506 (registration)
    Tool registration in listTools handler: defines name, description, and input schema for 'deactivate-workflow'.
    {
      name: "deactivate-workflow",
      description: "Deactivate a workflow by ID. This will prevent the workflow from running. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.",
      inputSchema: {
        type: "object",
        properties: {
          clientId: { type: "string" },
          id: { type: "string" }
        },
        required: ["clientId", "id"]
      }
    },
  • Input schema definition for 'deactivate-workflow' tool: requires clientId and id as strings.
    inputSchema: {
      type: "object",
      properties: {
        clientId: { type: "string" },
        id: { type: "string" }
      },
      required: ["clientId", "id"]
    }
  • N8nClient helper method: makes POST request to n8n API endpoint /workflows/{id}/deactivate to deactivate the workflow.
    async deactivateWorkflow(id: string): Promise<N8nWorkflow> {
      return this.makeRequest<N8nWorkflow>(`/workflows/${id}/deactivate`, {
        method: 'POST',
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must cover behavioral traits. It states the effect ('prevent the workflow from running') and a formatting requirement for arguments, but lacks details on permissions, reversibility, side effects, or error handling, which are critical for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: one for the core action and effect, one for a technical requirement. It's front-loaded with the main purpose, though the second sentence could be integrated more smoothly. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations, no output schema, and 0% schema coverage, the description is incomplete. It misses key details like what 'deactivate' entails operationally, success/error responses, and how it differs from other workflow modifications, leaving gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should compensate. It mentions 'ID' but not 'clientId', and adds a formatting constraint for arguments ('compact, single-line JSON'), which provides some value beyond the bare schema. However, it doesn't fully explain both parameters' purposes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('deactivate') and resource ('workflow by ID'), with the effect 'prevent the workflow from running'. It distinguishes from sibling 'activate-workflow' by specifying deactivation, though not explicitly contrasting with other workflow tools like 'delete-workflow' or 'update-workflow'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like 'delete-workflow' or 'update-workflow', nor prerequisites such as workflow state. The description only mentions the action without context for selection among siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/illuminaresolutions/n8n-mcp-server'

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