n8n_list_workflows
Retrieve workflow IDs, names, and active status from your n8n instance to monitor and manage automation processes.
Instructions
List all workflows in the n8n instance. Returns workflow IDs, names, and active status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of workflows to return (default: 100) | |
| active | No | Filter by active status (true/false) |
Implementation Reference
- src/tools/workflow-tools.ts:166-196 (handler)The main handler function for the 'n8n_list_workflows' tool. It uses the N8nApiClient to list workflows with optional filters and returns a formatted JSON response.n8n_list_workflows: async ( client: N8nApiClient, args: Record<string, unknown> ): Promise<ToolResult> => { const result = await client.listWorkflows({ limit: args.limit as number | undefined, active: args.active as boolean | undefined, }); const workflows = result.data.map((w) => ({ id: w.id, name: w.name, active: w.active, createdAt: w.createdAt, updatedAt: w.updatedAt, nodeCount: w.nodes?.length || 0, })); return { content: [ { type: 'text' as const, text: JSON.stringify({ count: workflows.length, workflows, hasMore: !!result.nextCursor, }, null, 2), }, ], }; },
- src/tools/workflow-tools.ts:14-30 (schema)The tool definition including name, description, and input schema for validation.{ name: 'n8n_list_workflows', description: 'List all workflows in the n8n instance. Returns workflow IDs, names, and active status.', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of workflows to return (default: 100)', }, active: { type: 'boolean', description: 'Filter by active status (true/false)', }, }, }, },
- src/server.ts:122-125 (registration)Registration and dispatch logic for workflow tool handlers, including n8n_list_workflows, in the MCP server.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }
- src/server.ts:60-64 (registration)MCP server registration of all tool definitions (including n8n_list_workflows via allTools) for the list tools endpoint.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });