Skip to main content

Overview

Retrieve a list of workflows from your n8n instance with filtering, sorting, and pagination support. Returns minimal metadata for optimal performance.

Endpoint

GET /workflows

Request Parameters

limit
number
default:100
Number of workflows to return (1-100)Example: 20
cursor
string
Pagination cursor from previous responseUsed to fetch the next page of results. See Pagination section.
active
boolean
Filter by active status
  • true - Only active workflows
  • false - Only inactive workflows
  • Omit to return both
tags
array
Filter by tags (exact match)Example: ["production", "crm"]
Returns workflows that have ALL specified tags (AND logic)
projectId
string
Filter by project ID (n8n Enterprise feature)Example: "proj_abc123"
excludePinnedData
boolean
default:true
Exclude pinned test data from responseReduces response size. Set to false to include pinned data.

Response

success
boolean
Operation success status
data
object
Workflow list with metadata

Pagination

The API uses cursor-based pagination for efficient navigation through large workflow lists.

How It Works

  1. First Request: Omit cursor parameter
  2. Check Response: Look for nextCursor in response
  3. Next Page: Pass nextCursor as cursor parameter
  4. Repeat: Until hasMore is false

Example Flow

1

Initial Request

{
  "limit": 20
}
Response includes nextCursor: "abc123"
2

Next Page

{
  "limit": 20,
  "cursor": "abc123"
}
Response includes nextCursor: "def456"
3

Continue

Repeat until hasMore: false
Cursors are opaque strings. Do not parse or modify them.

Error Codes

INVALID_LIMIT
string
Cause: Limit outside valid range (1-100)Resolution: Use a value between 1 and 100
INVALID_CURSOR
string
Cause: Cursor is invalid or expiredResolution: Start from beginning (omit cursor)
API_ERROR
string
Cause: n8n API not configured or unreachableResolution: Verify configuration with n8n_health_check

Examples

curl -X GET "https://n8n.example.com/api/v1/workflows?limit=20" \
  -H "X-N8N-API-KEY: your-api-key"

Response Examples

{
  "success": true,
  "data": {
    "workflows": [
      {
        "id": "wf_abc123",
        "name": "Customer Onboarding",
        "active": true,
        "isArchived": false,
        "createdAt": "2024-01-15T10:30:00.000Z",
        "updatedAt": "2024-03-05T14:22:00.000Z",
        "tags": ["production", "crm"],
        "nodeCount": 8
      },
      {
        "id": "wf_def456",
        "name": "Daily Data Sync",
        "active": true,
        "isArchived": false,
        "createdAt": "2024-02-01T09:15:00.000Z",
        "updatedAt": "2024-03-04T16:45:00.000Z",
        "tags": ["production", "automation"],
        "nodeCount": 5
      }
    ],
    "returned": 2,
    "nextCursor": "xyz789",
    "hasMore": true,
    "_note": "More workflows available. Use cursor to get next page."
  }
}

Common Use Cases

Find all workflows for a specific purpose:
# List production workflows
n8n_list_workflows({tags: ["production"], active: true})

# List inactive workflows (candidates for cleanup)
n8n_list_workflows({active: false})

Filtering Best Practices

Optimal Filtering Strategy:
  1. Start broad: Fetch workflows with minimal filters
  2. Use tags: Organize workflows with meaningful tags for efficient filtering
  3. Paginate properly: Use cursors, don’t skip pages
  4. Cache results: Store workflow lists locally for dashboards
  5. Combine filters: Use active + tags for precise queries

Example: Production Active Workflows

{
  "active": true,
  "tags": ["production"],
  "limit": 50
}
Returns only workflows that are:
  • Currently active
  • Tagged with “production”
  • Limited to first 50 results

Tag Organization

Environment

  • production
  • staging
  • development
  • testing

Function

  • data-sync
  • notification
  • processing
  • monitoring

System

  • crm
  • ecommerce
  • analytics
  • integrations

Status

  • active-production
  • deprecated
  • archived
  • to-delete

Performance Tips

Optimize Large Lists:
  • Use reasonable limit values (20-50 for UI, 100 for batch)
  • Don’t fetch all workflows unnecessarily
  • Cache workflow lists with short TTL (5-10 minutes)
  • Use excludePinnedData: true (default) to reduce response size
  • Filter server-side with tags instead of fetching all

Workflow List Management

Export Workflow List

// Export all workflows for backup/audit
const allWorkflows = []
let cursor = null

do {
  const response = await n8n_list_workflows({
    limit: 100,
    cursor,
    excludePinnedData: true
  })
  
  allWorkflows.push(...response.data.workflows)
  cursor = response.data.nextCursor
} while (cursor)

console.log(`Exported ${allWorkflows.length} workflows`)

Workflow Inventory Report

const response = await n8n_list_workflows({limit: 100})
const workflows = response.data.workflows

const report = {
  total: workflows.length,
  active: workflows.filter(w => w.active).length,
  inactive: workflows.filter(w => !w.active).length,
  byTag: {},
  avgNodeCount: workflows.reduce((sum, w) => sum + w.nodeCount, 0) / workflows.length,
  lastUpdated: workflows.sort((a, b) => 
    new Date(b.updatedAt) - new Date(a.updatedAt)
  )[0]
}

// Count by tag
workflows.forEach(w => {
  w.tags.forEach(tag => {
    report.byTag[tag] = (report.byTag[tag] || 0) + 1
  })
})

console.log(report)
Conceived by Romuald Członkowski - www.aiadvisors.pl/en

Build docs developers (and LLMs) love