activate-workflow
Trigger workflow execution on the MCP-N8N server by providing a workflow ID and client ID. Input must be in compact, single-line JSON format.
Instructions
Activate a workflow by ID. This will enable the workflow to run. IMPORTANT: Arguments must be provided as compact, single-line JSON without whitespace or newlines.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clientId | Yes | ||
| id | Yes |
Implementation Reference
- src/index.ts:1067-1097 (handler)MCP server tool handler for 'activate-workflow': validates client, calls N8nClient.activateWorkflow(id), formats and returns response or error.case "activate-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.activateWorkflow(id); return { content: [{ type: "text", text: `Successfully activated 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:192-196 (helper)N8nClient helper method implementing the activation logic via POST to n8n REST API /workflows/{id}/activate.async activateWorkflow(id: string): Promise<N8nWorkflow> { return this.makeRequest<N8nWorkflow>(`/workflows/${id}/activate`, { method: 'POST', }); }
- src/index.ts:484-494 (registration)Tool registration in list-tools response: defines name, description, and input schema for 'activate-workflow'.name: "activate-workflow", description: "Activate a workflow by ID. This will enable the workflow to run. 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"] } },
- src/index.ts:486-493 (schema)Input schema definition for 'activate-workflow' tool: requires clientId (string) and id (string).inputSchema: { type: "object", properties: { clientId: { type: "string" }, id: { type: "string" } }, required: ["clientId", "id"] }