list_workflows
Retrieve and display all available n8n workflows for management through the MCP server interface.
Instructions
List all n8n workflows
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| cursor | No |
Implementation Reference
- src/index.ts:386-390 (handler)The primary handler method for the 'list_workflows' tool. It invokes the N8nClient.listWorkflows method, attaches numeric ID aliases to workflows for client convenience, and returns a formatted JSON response via the MCP content protocol.private async handleListWorkflows(args?: { limit?: number; cursor?: string }) { const workflows = await this.n8nClient.listWorkflows(args?.limit, args?.cursor); // attach aliases for each workflow in the list this.withAlias(workflows.data); return { content: [{ type: 'text', text: JSON.stringify(jsonSuccess(workflows), null, 2) }] };
- src/index.ts:69-69 (registration)Registration of the 'list_workflows' tool within the ListToolsRequestSchema response. Includes the tool name, description, and input schema definition.{ name: 'list_workflows', description: 'List all n8n workflows', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
- src/index.ts:69-69 (schema)Input schema definition for the 'list_workflows' tool, specifying optional limit (number) and cursor (string) parameters.{ name: 'list_workflows', description: 'List all n8n workflows', inputSchema: { type: 'object', properties: { limit: { type: 'number' }, cursor: { type: 'string' } } } },
- src/n8n-client.ts:151-158 (helper)Supporting method in N8nClient that makes the actual HTTP GET request to the n8n /api/v1/workflows endpoint with optional pagination parameters, returning the list response.async listWorkflows(limit?: number, cursor?: string): Promise<N8nWorkflowsListResponse> { const params = new URLSearchParams(); if (limit) params.append('limit', limit.toString()); if (cursor) params.append('cursor', cursor); const url = params.toString() ? `/workflows?${params.toString()}` : '/workflows'; const response = await this.api.get<N8nWorkflowsListResponse>(url); return response.data; }