Skip to main content

Overview

Manage n8n workflow definitions including nodes, connections, credentials, and settings.
Base URL: https://api.so1.io/v1/n8n/workflows

Create Workflow

Endpoint

POST /v1/n8n/workflows

Request Body

name
string
required
Workflow name
nodes
array
required
Array of workflow nodes with type, parameters, and position
connections
object
required
Node connection mappings
active
boolean
default:"false"
Activate workflow immediately
settings
object
Workflow settings (timezone, error workflow, etc.)

Example Request

curl -X POST https://api.so1.io/v1/n8n/workflows \
  -H "Authorization: Bearer so1_key_abc123xyz" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Deploy Notification",
    "nodes": [
      {
        "name": "Webhook",
        "type": "n8n-nodes-base.webhook",
        "position": [250, 300],
        "parameters": {
          "path": "deploy",
          "method": "POST"
        }
      },
      {
        "name": "Send Slack Message",
        "type": "n8n-nodes-base.slack",
        "position": [450, 300],
        "parameters": {
          "channel": "#deployments",
          "text": "Deployment started: {{$json.service}}"
        }
      }
    ],
    "connections": {
      "Webhook": {
        "main": [[{ "node": "Send Slack Message", "type": "main", "index": 0 }]]
      }
    },
    "active": true
  }'

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-abc123",
    "name": "Deploy Notification",
    "active": true,
    "version": 1,
    "createdAt": "2024-03-10T15:30:00Z",
    "webhookUrl": "https://n8n.so1.io/webhook/deploy"
  }
}

Get Workflow

Endpoint

GET /v1/n8n/workflows/{workflowId}

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-abc123",
    "name": "Deploy Notification",
    "nodes": [...],
    "connections": {...},
    "active": true,
    "version": 3,
    "settings": {
      "timezone": "America/New_York",
      "errorWorkflow": "error-handler"
    },
    "statistics": {
      "executions": 1247,
      "successRate": 98.4,
      "averageDuration": 2.1
    },
    "createdAt": "2024-03-10T15:30:00Z",
    "updatedAt": "2024-03-10T16:00:00Z"
  }
}

List Workflows

Endpoint

GET /v1/n8n/workflows

Query Parameters

active
boolean
Filter by active status
tag
string
Filter by tag
limit
number
default:"20"
Results per page (1-100)

Response

{
  "success": true,
  "data": {
    "workflows": [
      {
        "workflowId": "wf-abc123",
        "name": "Deploy Notification",
        "active": true,
        "nodes": 5,
        "lastExecuted": "2024-03-10T15:25:00Z",
        "executions": 1247,
        "successRate": 98.4
      }
      // ... more workflows
    ],
    "pagination": {
      "total": 47,
      "limit": 20,
      "hasMore": true
    }
  }
}

Update Workflow

Endpoint

PUT /v1/n8n/workflows/{workflowId}

Request Body

All fields optional - only provided fields are updated.
name
string
Updated workflow name
nodes
array
Updated nodes array
connections
object
Updated connections
active
boolean
Activate/deactivate workflow

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-abc123",
    "version": 4,
    "updatedAt": "2024-03-10T16:30:00Z"
  }
}

Delete Workflow

Endpoint

DELETE /v1/n8n/workflows/{workflowId}

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-abc123",
    "deletedAt": "2024-03-10T16:30:00Z"
  }
}

Activate/Deactivate Workflow

Endpoints

POST /v1/n8n/workflows/{workflowId}/activate
POST /v1/n8n/workflows/{workflowId}/deactivate

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-abc123",
    "active": true,
    "updatedAt": "2024-03-10T16:30:00Z"
  }
}

Duplicate Workflow

Endpoint

POST /v1/n8n/workflows/{workflowId}/duplicate

Request Body

name
string
required
Name for duplicated workflow

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-xyz789",
    "name": "Deploy Notification (Copy)",
    "sourceWorkflowId": "wf-abc123"
  }
}

Export Workflow

Endpoint

GET /v1/n8n/workflows/{workflowId}/export

Query Parameters

format
string
default:"json"
Export format: json, yaml

Response

{
  "success": true,
  "data": {
    "format": "json",
    "workflow": {
      "name": "Deploy Notification",
      "nodes": [...],
      "connections": {...}
    }
  }
}

Import Workflow

Endpoint

POST /v1/n8n/workflows/import

Request Body

workflow
object
required
Workflow definition (JSON or YAML)
name
string
Override workflow name

Response

{
  "success": true,
  "data": {
    "workflowId": "wf-imported123",
    "name": "Imported Workflow",
    "nodes": 7,
    "createdAt": "2024-03-10T16:30:00Z"
  }
}