Skip to main content
Glama

n8n_list_workflows

Read-onlyIdempotent

Retrieve and filter workflow metadata from n8n, including IDs, names, status, dates, and tags, with pagination support for efficient management.

Instructions

List workflows (minimal metadata only). Returns id/name/active/dates/tags. Check hasMore/nextCursor for pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of workflows to return (1-100, default: 100)
cursorNoPagination cursor from previous response
activeNoFilter by active status
tagsNoFilter by tags (exact match)
projectIdNoFilter by project ID (enterprise feature)
excludePinnedDataNoExclude pinned data from response (default: true)

Implementation Reference

  • The handler function that executes the 'n8n_list_workflows' tool. Validates input using Zod schema, calls N8nApiClient.listWorkflows API, transforms response to minimal metadata (id, name, active, dates, tags, nodeCount), adds pagination info (hasMore, nextCursor).
    export async function handleListWorkflows(args: unknown, context?: InstanceContext): Promise<McpToolResponse> {
      try {
        const client = ensureApiConfigured(context);
        const input = listWorkflowsSchema.parse(args || {});
    
        // Convert tags array to comma-separated string (n8n API format)
        const tagsParam = input.tags && input.tags.length > 0
          ? input.tags.join(',')
          : undefined;
    
        const response = await client.listWorkflows({
          limit: input.limit || 100,
          cursor: input.cursor,
          active: input.active,
          tags: tagsParam as any,  // API expects string, not array
          projectId: input.projectId,
          excludePinnedData: input.excludePinnedData ?? true
        });
        
        // Strip down workflows to only essential metadata
        const minimalWorkflows = response.data.map(workflow => ({
          id: workflow.id,
          name: workflow.name,
          active: workflow.active,
          isArchived: workflow.isArchived,
          createdAt: workflow.createdAt,
          updatedAt: workflow.updatedAt,
          tags: workflow.tags || [],
          nodeCount: workflow.nodes?.length || 0
        }));
    
        return {
          success: true,
          data: {
            workflows: minimalWorkflows,
            returned: minimalWorkflows.length,
            nextCursor: response.nextCursor,
            hasMore: !!response.nextCursor,
            ...(response.nextCursor ? { 
              _note: "More workflows available. Use cursor to get next page." 
            } : {})
          }
        };
      } catch (error) {
        if (error instanceof z.ZodError) {
          return {
            success: false,
            error: 'Invalid input',
            details: { errors: error.errors }
          };
        }
        
        if (error instanceof N8nApiError) {
          return {
            success: false,
            error: getUserFriendlyErrorMessage(error),
            code: error.code
          };
        }
        
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Unknown error occurred'
        };
      }
  • ToolDefinition object defining the name, description, and inputSchema (parameters with types and descriptions) for the 'n8n_list_workflows' tool.
    {
      name: 'n8n_list_workflows',
      description: `List workflows (minimal metadata only). Returns id/name/active/dates/tags. Check hasMore/nextCursor for pagination.`,
      inputSchema: {
        type: 'object',
        properties: {
          limit: { 
            type: 'number', 
            description: 'Number of workflows to return (1-100, default: 100)' 
          },
          cursor: { 
            type: 'string', 
            description: 'Pagination cursor from previous response' 
          },
          active: { 
            type: 'boolean', 
            description: 'Filter by active status' 
          },
          tags: { 
            type: 'array', 
            items: { type: 'string' },
            description: 'Filter by tags (exact match)' 
          },
          projectId: { 
            type: 'string', 
            description: 'Filter by project ID (enterprise feature)' 
          },
          excludePinnedData: { 
            type: 'boolean', 
            description: 'Exclude pinned data from response (default: true)' 
          }
        }
      }
    },
  • Detailed ToolDocumentation providing comprehensive usage guide, parameters, return format, examples, best practices, pitfalls, and related tools for 'n8n_list_workflows'.
    import { ToolDocumentation } from '../types';
    
    export const n8nListWorkflowsDoc: ToolDocumentation = {
      name: 'n8n_list_workflows',
      category: 'workflow_management',
      essentials: {
        description: 'List workflows (minimal metadata only - no nodes/connections). Supports pagination via cursor.',
        keyParameters: ['limit', 'active', 'tags'],
        example: 'n8n_list_workflows({limit: 20, active: true})',
        performance: 'Fast (100-300ms)',
        tips: [
          'Use cursor for pagination',
          'Filter by active status',
          'Tag filtering for organization'
        ]
      },
      full: {
        description: 'Lists workflows from n8n with powerful filtering options. Returns ONLY minimal metadata (id, name, active, dates, tags, nodeCount) - no workflow structure, nodes, or connections. Use n8n_get_workflow to fetch full workflow details.',
        parameters: {
          limit: { type: 'number', description: 'Number of workflows to return (1-100, default: 100)' },
          cursor: { type: 'string', description: 'Pagination cursor from previous response for next page' },
          active: { type: 'boolean', description: 'Filter by active/inactive status' },
          tags: { type: 'array', description: 'Filter by exact tag matches (AND logic)' },
          projectId: { type: 'string', description: 'Filter by project ID (enterprise feature)' },
          excludePinnedData: { type: 'boolean', description: 'Exclude pinned data from response (default: true)' }
        },
        returns: 'Object with: workflows array (minimal fields: id, name, active, createdAt, updatedAt, tags, nodeCount), returned (count in this response), hasMore (boolean), nextCursor (for pagination), and _note (guidance when more data exists)',
        examples: [
          'n8n_list_workflows({limit: 20}) - First 20 workflows',
          'n8n_list_workflows({active: true, tags: ["production"]}) - Active production workflows',
          'n8n_list_workflows({cursor: "abc123", limit: 50}) - Next page of results'
        ],
        useCases: [
          'Build workflow dashboards',
          'Find workflows by status',
          'Organize by tags',
          'Bulk workflow operations',
          'Generate workflow reports'
        ],
        performance: 'Very fast - typically 50-200ms. Returns only minimal metadata without workflow structure.',
        bestPractices: [
          'Always check hasMore flag to determine if pagination is needed',
          'Use cursor from previous response to get next page',
          'The returned count is NOT the total in the system',
          'Iterate with cursor until hasMore is false for complete list'
        ],
        pitfalls: [
          'Requires N8N_API_URL and N8N_API_KEY configured',
          'Maximum 100 workflows per request',
          'Server may return fewer than requested limit',
          'returned field is count of current page only, not system total'
        ],
        relatedTools: ['n8n_get_workflow', 'n8n_update_partial_workflow', 'n8n_executions']
      }
    };
  • Registration of n8nManagementTools array (containing n8n_list_workflows definition) to the tools list in HTTP server mode.
      tools.push(...n8nManagementTools);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover read-only, open-world, and idempotent hints, so the description adds valuable behavioral context beyond annotations: it discloses the pagination mechanism ('Check hasMore/nextCursor for pagination') and clarifies the response format ('Returns id/name/active/dates/tags'), which are not captured in annotations. No contradictions with annotations exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and front-loaded, with two sentences that efficiently convey purpose, return fields, and pagination without any wasted words. Every sentence adds critical information, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (list operation with filtering and pagination), annotations cover safety aspects, and the description adds key behavioral details (response fields, pagination). However, there is no output schema, and the description does not fully explain the pagination mechanism (e.g., how to use nextCursor) or error cases, leaving minor gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description does not add any parameter-specific information beyond what the schema provides, such as explaining interactions between parameters. Baseline 3 is appropriate as the schema handles parameter documentation effectively.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and resource 'workflows' with specific scope 'minimal metadata only', distinguishing it from siblings like n8n_get_workflow (detailed view) and n8n_workflow_versions (version history). It explicitly mentions what fields are returned (id/name/active/dates/tags), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for usage by specifying it returns 'minimal metadata only' and includes pagination guidance, which helps differentiate it from more detailed retrieval tools. However, it does not explicitly state when NOT to use this tool or name specific alternatives among siblings, such as n8n_get_workflow for full details.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/czlonkowski/n8n-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server