activate_workflow
Activate an n8n workflow by providing its ID to start automated processes and trigger workflow execution.
Instructions
Activate an n8n workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:420-425 (handler)Main MCP tool handler: resolves workflow ID alias, activates via n8nClient, adds numeric alias to response, returns JSON-formatted workflow.private async handleActivateWorkflow(args: { id: string | number }) { const id = this.resolveWorkflowId(args.id); const workflow = await this.n8nClient.activateWorkflow(id); this.withAlias(workflow); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(workflow), null, 2) }] }; }
- src/n8n-client.ts:221-225 (helper)N8nClient helper: Performs the core HTTP POST to n8n API /workflows/{id}/activate endpoint and normalizes the response.async activateWorkflow(id: string | number): Promise<N8nWorkflow> { const response = await this.api.post<N8nApiResponse<N8nWorkflow> | N8nWorkflow>(`/workflows/${id}/activate`); const payload: any = response.data as any; return (payload && typeof payload === 'object' && 'data' in payload) ? payload.data : payload; }
- src/index.ts:74-74 (registration)Tool registration in list_tools response: defines name, description, and input schema (id: string|number required).{ name: 'activate_workflow', description: 'Activate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
- src/index.ts:236-237 (registration)Dispatch routing in CallToolRequest handler: matches tool name and invokes the handler method.case 'activate_workflow': return await this.handleActivateWorkflow(request.params.arguments as { id: string | number });