n8n_list_workflows
Retrieve and filter workflows from your n8n instance to view IDs, names, and active status for management.
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:165-196 (handler)The core handler function for the n8n_list_workflows tool. It calls the N8nApiClient to list workflows with optional filters and returns formatted JSON response.export const workflowToolHandlers = { 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:15-30 (schema)The ToolDefinition schema specifying the tool's 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/tools/index.ts:12-16 (registration)Registration of all tools including workflowTools (containing n8n_list_workflows schema) into the combined allTools array used by the MCP server.export const allTools: ToolDefinition[] = [ ...documentationTools, // Documentation first for discoverability ...workflowTools, ...executionTools, ];
- src/server.ts:60-64 (registration)MCP server handler for listing tools, providing the allTools array which includes n8n_list_workflows.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
- src/server.ts:122-125 (registration)Tool call dispatch logic that routes calls to the specific workflowToolHandlers object containing the n8n_list_workflows handler.if (name in workflowToolHandlers) { const handler = workflowToolHandlers[name as keyof typeof workflowToolHandlers]; return handler(client, args); }