Skip to main content
Glama
AutomateLab-tech

automatelab-n8n-mcp

n8n_activate_workflow

Activate or deactivate an n8n workflow by providing its ID. Set active to false to stop it.

Instructions

Activate or deactivate a workflow on a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Pass active: false to deactivate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesWorkflow ID.
activeNoDefaults to true (activate). Set false to deactivate.

Implementation Reference

  • The activateWorkflow async function that executes the n8n_activate_workflow tool. Calls POST /workflows/{id}/{activate|deactivate} on the n8n REST API.
    export async function activateWorkflow(rawArgs: unknown) {
    	const cfg = getConfig();
    	if ("error" in cfg) return textResult(cfg.error);
    	const args = activateWorkflowZod.parse(rawArgs);
    	const action = args.active === false ? "deactivate" : "activate";
    	const r = await call(
    		cfg,
    		"POST",
    		`/workflows/${encodeURIComponent(args.id)}/${action}`,
    	);
    	if (!r.ok) return textResult(r.error);
    	return textResult(`Workflow ${args.id} ${action}d.`);
    }
  • Input JSON Schema for n8n_activate_workflow. Requires 'id' (string workflow ID), optional 'active' boolean (default true for activate, false for deactivate).
    export const activateWorkflowInputSchema = {
    	type: "object",
    	properties: {
    		id: { type: "string", description: "Workflow ID." },
    		active: {
    			type: "boolean",
    			description:
    				"Defaults to true (activate). Set false to deactivate.",
    		},
    	},
    	required: ["id"],
    } as const;
  • Zod validation schema for n8n_activate_workflow input, used at runtime to parse and validate arguments.
    const activateWorkflowZod = z.object({
    	id: z.string().min(1),
    	active: z.boolean().optional(),
    });
  • src/index.ts:82-87 (registration)
    Registration of the n8n_activate_workflow tool in the tools array, with its name, description, and inputSchema.
    {
    	name: "n8n_activate_workflow",
    	description:
    		"Activate or deactivate a workflow on a live n8n instance (requires N8N_API_URL + N8N_API_KEY). Pass `active: false` to deactivate.",
    	inputSchema: activateWorkflowInputSchema,
    },
  • src/index.ts:125-126 (registration)
    Dispatch in the CallToolRequestSchema handler that routes n8n_activate_workflow to the activateWorkflow function.
    case "n8n_activate_workflow":
    	return activateWorkflow(args ?? {});
  • Helper function getConfig() that reads N8N_API_URL and N8N_API_KEY from environment, used by the activateWorkflow handler.
    function getConfig(): ApiConfig | { error: string } {
    	const url = process.env.N8N_API_URL?.trim();
    	const key = process.env.N8N_API_KEY?.trim();
    	if (!url || !key) {
    		return {
    			error:
    				"n8n REST tools are not configured. Set N8N_API_URL (e.g. https://n8n.example.com) and N8N_API_KEY (n8n -> Settings -> API) in the MCP server's environment. The other 4 tools (generate, lint, scaffold, explain) work without these.",
    		};
    	}
    	const trimmed = url.replace(/\/$/, "").replace(/\/api\/v1$/, "");
    	return { baseUrl: `${trimmed}/api/v1`, apiKey: key };
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses that the tool operates on a live n8n instance and requires API keys. It mentions the effect of setting `active: false`. Additional details about side effects (e.g., stopping running workflows) would improve transparency.

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

Conciseness5/5

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

Description is concise (two sentences) and front-loaded with the primary action. No extraneous information; every sentence serves a purpose.

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

Completeness4/5

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

For a simple toggle tool with few parameters and no output schema, the description covers the core action and required configuration. It could optionally mention the expected return value (e.g., success status or updated workflow), but remains sufficiently complete.

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 coverage is 100% (both parameters described). Description adds that `active` defaults to true and can be set to false, which is mostly redundant with the schema description. No new semantic information is provided beyond what the schema already covers.

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

Purpose5/5

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

Description explicitly states 'Activate or deactivate a workflow', which is a specific verb+resource combination. It clearly distinguishes from sibling tools (e.g., n8n_create_workflow, n8n_get_workflow) by focusing on the activation toggling action.

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

Usage Guidelines4/5

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

Description provides necessary context: requires N8N_API_URL and N8N_API_KEY, and explains how to deactivate. However, it does not explicitly state when to use this tool versus alternatives (e.g., when to use n8n_get_workflow to check status).

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/AutomateLab-tech/n8n-mcp'

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