activate_workflow
Start an n8n workflow by providing its ID to execute automated processes and trigger workflow actions.
Instructions
Activate an n8n workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:74-74 (registration)Tool registration in the list_tools response, including name, description, and input schema.{ name: 'activate_workflow', description: 'Activate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
- src/index.ts:74-74 (schema)Input schema definition for the activate_workflow tool.{ name: 'activate_workflow', description: 'Activate an n8n workflow', inputSchema: { type: 'object', properties: { id: { oneOf: [{ type: 'string' }, { type: 'number' }] } }, required: ['id'] } },
- src/index.ts:420-425 (handler)The main handler function for the activate_workflow tool. Resolves workflow ID alias, activates via N8nClient, adds numeric alias, and returns success response.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/index.ts:236-237 (handler)Dispatch case in the main CallToolRequestSchema handler that routes to the specific activate_workflow handler.case 'activate_workflow': return await this.handleActivateWorkflow(request.params.arguments as { id: string | number });
- src/n8n-client.ts:221-225 (helper)N8nClient helper method that performs the actual API POST to /workflows/{id}/activate endpoint.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; }