get_workflow
Retrieve detailed information about a specific workflow by providing its unique ID.
Instructions
Get detailed information about a specific workflow
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | The ID of the workflow |
Implementation Reference
- src/tools.ts:30-42 (schema)Tool registration/definition for 'get_workflow' with name, description, and inputSchema requiring workflowId (string).
{ name: "get_workflow", description: "Get detailed information about a specific workflow", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The ID of the workflow", }, }, required: ["workflowId"], }, - src/handlers.ts:80-83 (handler)Handler for the 'get_workflow' tool: parses args with WorkflowIdSchema and calls client.getWorkflow(workflowId).
case "get_workflow": { const { workflowId } = WorkflowIdSchema.parse(args); return await client.getWorkflow(workflowId); } - src/n8n-client.ts:71-74 (helper)Client method getWorkflow: HTTP GET to /api/v1/workflows/{id}, validates response with WorkflowSchema.
async getWorkflow(id: string) { const response = await this.client.get(`/api/v1/workflows/${id}`); return WorkflowSchema.parse(response.data); } - src/handlers.ts:12-14 (schema)Zod schema WorkflowIdSchema used to validate the workflowId input parameter.
const WorkflowIdSchema = z.object({ workflowId: z.string(), }); - src/n8n-client.ts:5-15 (schema)Zod schema WorkflowSchema used to validate the API response for a workflow.
const WorkflowSchema = z.object({ id: z.string(), name: z.string(), active: z.boolean(), createdAt: z.string(), updatedAt: z.string(), nodes: z.array(z.any()), connections: z.record(z.any()), settings: z.record(z.any()).optional(), staticData: z.any().optional(), tags: z.array(z.string()).optional(),