Overview
The Workflows API allows you to programmatically manage your automation workflows. You can create, read, update, delete, activate, and execute workflows through REST endpoints.
List Workflows
Retrieve a paginated list of workflows.
Query Parameters
Pagination cursor from previous response’s nextCursor
Number of workflows to return (max: 250)
Filter workflows by name (partial match)
Filter by active status: true for active, false for inactive
Comma-separated tag names to filter by
Filter workflows by project ID
Exclude pinned test data from response
Example Request
curl -H "X-N8N-API-KEY: your-api-key" \
"https://your-n8n-instance.com/api/v1/workflows?active=true&limit=50"
Response
Array of workflow objects Unique workflow identifier
Whether the workflow is currently active
Array of node configurations in the workflow
Workflow settings and configurations
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
Cursor for next page of results, or null if no more results
{
"data" : [
{
"id" : "workflow_abc123" ,
"name" : "Customer Onboarding" ,
"active" : true ,
"nodes" : [
{
"id" : "node_1" ,
"type" : "n8n-nodes-base.webhook" ,
"name" : "Webhook" ,
"position" : [ 250 , 300 ],
"parameters" : {
"path" : "customer-signup"
}
}
],
"connections" : {
"Webhook" : {
"main" : [[{ "node" : "SendEmail" , "type" : "main" , "index" : 0 }]]
}
},
"settings" : {
"executionOrder" : "v1"
},
"createdAt" : "2024-01-15T10:30:00.000Z" ,
"updatedAt" : "2024-02-10T14:20:00.000Z"
}
],
"nextCursor" : "eyJsYXN0SWQiOiJ3b3JrZmxvd19hYmMxMjMiLCJsaW1pdCI6NTB9"
}
Get Workflow
Retrieve a specific workflow by ID.
GET /api/v1/workflows/:id
Path Parameters
Query Parameters
Exclude pinned test data from response
Example Request
curl -H "X-N8N-API-KEY: your-api-key" \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123
Response
Returns a single workflow object with full details including nodes, connections, and settings.
Create Workflow
Create a new workflow.
Request Body
Workflow name (max 128 characters)
Array of node configurations
Object mapping node connections
Workflow settings and configuration
Static data stored with the workflow
Array of tag IDs to assign
Project ID to create workflow in (defaults to personal project)
Metadata about the workflow
Example Request
curl -X POST \
-H "X-N8N-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "New Customer Workflow",
"nodes": [
{
"id": "webhook_1",
"type": "n8n-nodes-base.webhook",
"name": "Webhook",
"position": [250, 300],
"parameters": {
"path": "new-customer",
"httpMethod": "POST"
}
}
],
"connections": {},
"settings": {
"executionOrder": "v1"
}
}' \
https://your-n8n-instance.com/api/v1/workflows
Response
Returns the created workflow object with generated ID and additional metadata.
New workflows are always created in inactive state. Use the activate endpoint to enable them.
Update Workflow
Update an existing workflow.
PATCH /api/v1/workflows/:id
Path Parameters
The workflow ID to update
Request Body
All fields are optional. Only include fields you want to update.
Updated node configurations
Updated connection mappings
Updated workflow settings
Example Request
curl -X PATCH \
-H "X-N8N-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Workflow Name",
"settings": {
"executionOrder": "v1",
"timezone": "America/New_York"
}
}' \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123
Response
Returns the updated workflow object.
Delete Workflow
Permanently delete a workflow.
DELETE /api/v1/workflows/:id
Path Parameters
The workflow ID to delete
Example Request
curl -X DELETE \
-H "X-N8N-API-KEY: your-api-key" \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123
Response
{
"id" : "workflow_abc123" ,
"name" : "Deleted Workflow"
}
Deleting a workflow also deletes all associated execution history. This action cannot be undone.
Activate Workflow
Activate a workflow to run automatically based on triggers.
POST /api/v1/workflows/:id/activate
Path Parameters
The workflow ID to activate
Request Body
Specific version ID to activate
Optional name for the active version
Optional description for the active version
Example Request
curl -X POST \
-H "X-N8N-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"versionId": "version_xyz",
"name": "Production Release"
}' \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123/activate
Response
Returns the activated workflow with active: true.
Deactivate Workflow
Deactivate an active workflow.
POST /api/v1/workflows/:id/deactivate
Path Parameters
The workflow ID to deactivate
Example Request
curl -X POST \
-H "X-N8N-API-KEY: your-api-key" \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123/deactivate
Response
Returns the deactivated workflow with active: false.
Execute Workflow
Manually trigger a workflow execution.
POST /api/v1/workflows/:id/run
Path Parameters
The workflow ID to execute
Request Body
The complete workflow configuration to execute
Array of node names to start execution from
Target node name to execute up to
Input data for the execution
Example Request
curl -X POST \
-H "X-N8N-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"workflowData": {
"id": "workflow_abc123",
"name": "Customer Onboarding",
"nodes": [...],
"connections": {...}
}
}' \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123/run
Response
{
"executionId" : "execution_def456" ,
"finished" : true ,
"data" : {
"resultData" : {
"runData" : { ... }
}
}
}
Transfer Workflow
Transfer a workflow to a different project.
PUT /api/v1/workflows/:id/transfer
Path Parameters
The workflow ID to transfer
Request Body
Whether to share associated credentials with the destination project
Example Request
curl -X PUT \
-H "X-N8N-API-KEY: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"destinationProjectId": "project_xyz789",
"shareCredentials": true
}' \
https://your-n8n-instance.com/api/v1/workflows/workflow_abc123/transfer
Response
Returns 204 No Content on success.
Common Patterns
Cloning a Workflow
// 1. Get the source workflow
const source = await fetch (
'https://your-n8n-instance.com/api/v1/workflows/source_id' ,
{ headers: { 'X-N8N-API-KEY' : 'your-api-key' } }
). then ( r => r . json ());
// 2. Create a copy with a new name
const { id , createdAt , updatedAt , ... workflowData } = source ;
workflowData . name = ` ${ workflowData . name } (Copy)` ;
const cloned = await fetch (
'https://your-n8n-instance.com/api/v1/workflows' ,
{
method: 'POST' ,
headers: {
'X-N8N-API-KEY' : 'your-api-key' ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ( workflowData )
}
). then ( r => r . json ());
Bulk Operations
Activate Multiple Workflows
const workflowIds = [ 'id1' , 'id2' , 'id3' ];
const results = await Promise . all (
workflowIds . map ( id =>
fetch (
`https://your-n8n-instance.com/api/v1/workflows/ ${ id } /activate` ,
{
method: 'POST' ,
headers: { 'X-N8N-API-KEY' : 'your-api-key' }
}
). then ( r => r . json ())
)
);
console . log ( `Activated ${ results . length } workflows` );
Error Responses
400 Bad Request
{
"message" : "Workflow with id \" workflow_abc123 \" exists already."
}
403 Forbidden
{
"message" : "You don't have the permissions to save the workflow in this project."
}
404 Not Found
{
"message" : "Workflow with ID \" workflow_abc123 \" does not exist"
}
Next Steps
Executions API Monitor workflow executions
Credentials API Manage workflow credentials
Authentication Learn about API authentication
Webhooks Trigger workflows via webhooks