activate_workflow
Activate a workflow to start its execution using its unique ID.
Instructions
Activate a workflow
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The ID of the workflow to activate |
Implementation Reference
- src/tools.ts:133-146 (registration)Tool definition/registration for 'activate_workflow' with input schema requiring workflowId.
{ name: "activate_workflow", description: "Activate a workflow", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The ID of the workflow to activate", }, }, required: ["workflowId"], }, }, - src/handlers.ts:100-103 (handler)Handler case for 'activate_workflow': validates args with WorkflowIdSchema, then calls client.activateWorkflow(workflowId).
case "activate_workflow": { const { workflowId } = WorkflowIdSchema.parse(args); return await client.activateWorkflow(workflowId); } - src/n8n-client.ts:91-96 (helper)The activateWorkflow method on N8nClient: sends a PATCH request to /api/v1/workflows/{id} with active: true and returns parsed WorkflowSchema.
async activateWorkflow(id: string) { const response = await this.client.patch(`/api/v1/workflows/${id}`, { active: true, }); return WorkflowSchema.parse(response.data); } - src/handlers.ts:12-14 (schema)WorkflowIdSchema used by the handler — a Zod schema requiring a string 'workflowId'.
const WorkflowIdSchema = z.object({ workflowId: z.string(), }); - src/index.ts:31-33 (registration)Server setup: tools array (including activate_workflow) is registered via ListToolsRequestSchema handler.
// Register tool list handler server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools };