n8n_list_workflows
Retrieve and filter workflows from n8n with options for active status, tags, name, project, and pagination to manage automation processes.
Instructions
List all workflows in the n8n instance with optional filtering.
Args:
active (boolean, optional): Filter by active status
tags (string, optional): Filter by tag IDs (comma-separated)
name (string, optional): Filter by name (partial match)
projectId (string, optional): Filter by project ID
limit (number): Maximum results (default: 100, max: 250)
cursor (string, optional): Pagination cursor from previous response
Returns: List of workflows with id, name, active status, created/updated timestamps, and tags. Includes nextCursor for pagination if more results exist.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| active | No | Filter by active status | |
| tags | No | Filter by tag IDs (comma-separated) | |
| name | No | Filter by name (partial match) | |
| projectId | No | Filter by project ID | |
| limit | No | Maximum results to return | |
| cursor | No | Pagination cursor |
Implementation Reference
- src/tools/workflows.ts:64-90 (handler)The handler function for n8n_list_workflows. It constructs query parameters, calls the API via a service client, and formats the response for the MCP client.
async (params: z.infer<typeof ListWorkflowsSchema>) => { const queryParams: Record<string, unknown> = { limit: params.limit }; if (params.active !== undefined) queryParams.active = params.active; if (params.tags) queryParams.tags = params.tags; if (params.name) queryParams.name = params.name; if (params.projectId) queryParams.projectId = params.projectId; if (params.cursor) queryParams.cursor = params.cursor; const response = await get<N8nPaginatedResponse<N8nWorkflowListItem>>('/workflows', queryParams); const formatted = response.data.map(formatWorkflow).join('\n\n---\n\n'); const output = { count: response.data.length, workflows: response.data, nextCursor: response.nextCursor }; let text = `Found ${response.data.length} workflow(s):\n\n${formatted}`; if (response.nextCursor) { text += `\n\n_More results available. Use cursor: ${response.nextCursor}_`; } return { content: [{ type: 'text', text }], structuredContent: output }; } - src/tools/workflows.ts:39-63 (registration)Registration of the n8n_list_workflows tool, specifying its schema and documentation.
server.registerTool( 'n8n_list_workflows', { title: 'List n8n Workflows', description: `List all workflows in the n8n instance with optional filtering. Args: - active (boolean, optional): Filter by active status - tags (string, optional): Filter by tag IDs (comma-separated) - name (string, optional): Filter by name (partial match) - projectId (string, optional): Filter by project ID - limit (number): Maximum results (default: 100, max: 250) - cursor (string, optional): Pagination cursor from previous response Returns: List of workflows with id, name, active status, created/updated timestamps, and tags. Includes nextCursor for pagination if more results exist.`, inputSchema: ListWorkflowsSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false } },