This skill should be used when creating production-ready n8n workflows, building webhook handlers, setting up scheduled automation tasks, managing n8n workflow CRUD operations, validating workflow structure before deployment, discovering available credentials, test-executing workflows via API, searching for nodes across workflows, or designing workflow patterns from templates.
From n8n-workflow-buildernpx claudepluginhub nbkm8y5/claude-plugins --plugin n8n-workflow-builderThis skill uses the workspace's default tool permissions.
references/api_reference.mdreferences/node_registry.mdreferences/workflow_patterns.mdreferences/workflow_templates.mdGuides root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Work with n8n workflows through direct REST API calls and helper utilities. Handles comprehensive n8n operations: listing workflows, retrieving workflow details, updating existing workflows, duplicating workflows, activation/deactivation, credential discovery, execution monitoring, tag management, workflow validation, and designing new workflows based on proven patterns.
Set these environment variables for API access:
export N8N_API_KEY="your-api-key"
export N8N_BASE_URL="http://localhost:5678" # Default if not set
In Python code:
import os
api_key = os.environ.get("N8N_API_KEY")
base_url = os.environ.get("N8N_BASE_URL", "http://localhost:5678")
Get all workflows with basic metadata:
import requests
response = requests.get(
f"{base_url}/api/v1/workflows",
headers={"X-N8N-API-KEY": api_key}
)
workflows = response.json()["data"]
# Each workflow includes: id, name, active, createdAt, updatedAt, tags
Helper script:
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py list
Retrieve complete workflow definition including all nodes and connections:
workflow_id = "123"
response = requests.get(
f"{base_url}/api/v1/workflows/{workflow_id}",
headers={"X-N8N-API-KEY": api_key}
)
workflow = response.json()
# Includes: id, name, nodes, connections, settings, staticData, active
Helper script:
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py get <workflow-id>
Update an existing workflow (must include complete nodes and connections):
# First, get the current workflow
current = requests.get(
f"{base_url}/api/v1/workflows/{workflow_id}",
headers={"X-N8N-API-KEY": api_key}
).json()
# Modify as needed
current["name"] = "Updated Name"
current["nodes"].append(new_node)
# Update connections accordingly
# Send update
response = requests.patch(
f"{base_url}/api/v1/workflows/{workflow_id}",
headers={
"X-N8N-API-KEY": api_key,
"Content-Type": "application/json"
},
json=current
)
updated = response.json()
Critical: Always send the complete nodes and connections arrays, not just changes.
Clone an existing workflow with optional new name:
# Using helper script (recommended)
from lib.n8n_client import N8nClient
client = N8nClient(base_url, api_key)
duplicate = client.duplicate_workflow(
workflow_id="123",
new_name="My New Workflow" # Optional
)
Helper script:
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py duplicate <workflow-id> "New Workflow Name"
The duplicate will be created as inactive by default.
Toggle workflow activation status:
# Activate
requests.patch(
f"{base_url}/api/v1/workflows/{workflow_id}",
headers={
"X-N8N-API-KEY": api_key,
"Content-Type": "application/json"
},
json={"active": True}
)
# Deactivate
requests.patch(
f"{base_url}/api/v1/workflows/{workflow_id}",
headers={
"X-N8N-API-KEY": api_key,
"Content-Type": "application/json"
},
json={"active": False}
)
Helper scripts:
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py activate <workflow-id>
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py deactivate <workflow-id>
Find workflows by name pattern:
from lib.n8n_client import N8nClient
client = N8nClient(base_url, api_key)
results = client.search_workflows("email") # Case-insensitive
# Returns list of matching workflows
Helper script:
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py search "email"
Find nodes within workflows or across all workflows:
Search nodes in a specific workflow:
from lib.n8n_client import N8nClient
client = N8nClient(base_url, api_key)
# Find all HTTP Request nodes
http_nodes = client.search_nodes_in_workflow(
workflow_id="123",
node_type="n8n-nodes-base.httpRequest"
)
# Find nodes by name
email_nodes = client.search_nodes_in_workflow(
workflow_id="123",
node_name="email" # Case-insensitive partial match
)
# Combine filters
specific_nodes = client.search_nodes_in_workflow(
workflow_id="123",
node_type="n8n-nodes-base.httpRequest",
node_name="API"
)
Helper script:
# Find all webhook nodes in workflow 123
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py search-nodes 123 --type n8n-nodes-base.webhook
# Find nodes with "email" in name
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py search-nodes 123 --name "email"
# Combine filters
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py search-nodes 123 --type n8n-nodes-base.code --name "transform"
Search nodes across ALL workflows:
# Find all workflows using a specific node type
results = client.search_nodes_across_workflows(
node_type="n8n-nodes-base.webhook"
)
# Results: {workflow_id: {workflow_name: "...", nodes: [...]}}
Helper script:
# Find all workflows with webhook nodes
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py search-nodes-all --type n8n-nodes-base.webhook
# Find all code nodes across workflows
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py search-nodes-all --type n8n-nodes-base.code
Common node types to search for:
n8n-nodes-base.httpRequest - HTTP API callsn8n-nodes-base.webhook - Webhook triggersn8n-nodes-base.code - JavaScript/Python coden8n-nodes-base.postgres - Database queriesn8n-nodes-base.schedule or n8n-nodes-base.scheduleTrigger - Cron jobsn8n-nodes-base.if - Conditional logicList available credentials before building workflows to ensure proper authentication configuration:
# List all available credentials
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py credentials
# Find credentials by type (partial match)
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py find-credential postgres
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py find-credential slack
Use this before:
Response includes:
Execute workflows programmatically and monitor their execution status:
# Execute a workflow and wait for result
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py execute <workflow-id>
# List recent executions
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py executions --limit 50
# List executions for specific workflow
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py executions --workflow-id 123
# Filter by status (success, error, waiting)
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py executions --workflow-id 123 --status error
# Get detailed execution data
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py execution <execution-id>
Use cases:
Organize workflows with tags for better categorization:
# List all tags
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py tags
# Create a new tag
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py create-tag "content-pipeline"
# Tag a workflow
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py tag-workflow 123 "content-pipeline"
# Remove tag from workflow
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py untag-workflow 123 "old-tag"
Best practices:
production, staging, experimentalcontent-pipeline, user-management, notificationsstripe, salesforce, mailchimpValidate workflow JSON structure before deploying to catch errors early:
# Validate workflow JSON before deploying
python3 ${CLAUDE_PLUGIN_ROOT}/lib/workflow_validator.py workflow.json
16 validation checks performed:
name, nodes, connections existid, name, type, parameters, positionn8n-nodes-base.xxx)={{ }})When to validate:
Create or update workflows by name to avoid duplicates:
# Create or update workflow by name (won't create duplicates)
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py upsert workflow.json
How it works:
Use cases:
Example workflow.json:
{
"name": "Daily Report Generator",
"nodes": [...],
"connections": {...},
"active": false
}
Check if a webhook path is already in use before creating new webhook workflows:
# Check if a webhook path is already in use
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py check-webhook "stripe-events"
python3 ${CLAUDE_PLUGIN_ROOT}/lib/n8n_client.py check-webhook "api/v1/user/signup"
Response:
Use before:
Best practices:
github-webhooks, stripe-events, form-submissionsapi/stripe/..., webhooks/github/...webhook or apiWhen designing new workflows or modifying existing ones, use proven patterns from references/workflow_patterns.md or start from templates in references/workflow_templates.md:
Load template reference when:
# Read available templates
with open(f"{CLAUDE_PLUGIN_ROOT}/skills/n8n-workflow-craft/references/workflow_templates.md") as f:
templates = f.read()
# Select appropriate template (Manual, Webhook, Scheduled, API, Database, Email, Error Handling)
# Customize for user's needs
Available starter templates:
Load patterns reference when:
# Read pattern examples
with open(f"{CLAUDE_PLUGIN_ROOT}/skills/n8n-workflow-craft/references/workflow_patterns.md") as f:
patterns = f.read()
# Select appropriate pattern based on requirements
# Adapt pattern to user's specific needs
Every node requires:
{
"parameters": {}, // Node-specific config
"id": "unique-id", // Unique identifier
"name": "Display Name", // Human-readable name
"type": "n8n-nodes-base.nodetype",
"typeVersion": 1,
"position": [x, y] // Canvas position
}
Connect nodes through the connections object:
{
"SourceNode": {
"main": [
[
{
"node": "TargetNode",
"type": "main",
"index": 0
}
]
]
}
}
Build complex workflows by composing smaller sub-workflows using the executeWorkflow node:
Pattern: Reusable Sub-Workflow
{
"parameters": {
"workflowId": "={{ $json.workflowToRun }}",
"mode": "integrated",
"waitForCompletion": true
},
"name": "Execute User Validation",
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1,
"position": [650, 300]
}
Benefits:
Common sub-workflow patterns:
Error wrapper pattern:
{
"nodes": [
{
"name": "Try Execute Sub-Workflow",
"type": "n8n-nodes-base.executeWorkflow",
"parameters": {"workflowId": "123"},
"onError": "continueErrorOutput"
},
{
"name": "Handle Error",
"type": "n8n-nodes-base.code",
"parameters": {
"jsCode": "return [{json: {error: $input.item.json.error, workflow: 'user-validation'}}];"
}
}
],
"connections": {
"Try Execute Sub-Workflow": {
"error": [[{"node": "Handle Error"}]]
}
}
}
Add inline documentation to workflows using sticky notes for better readability and maintenance:
{
"parameters": {
"content": "## Data Validation\nThis section validates incoming webhook data:\n- Checks required fields\n- Validates email format\n- Ensures user_id is numeric",
"height": 250,
"width": 400
},
"name": "Note: Validation Logic",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [450, 100]
}
Best practices:
##, -, **bold**)Common note types:
// Section header
{"content": "## Authentication Flow", "height": 80, "width": 300}
// Warning
{"content": "⚠️ **WARNING**: This modifies production database", "height": 100, "width": 350}
// Configuration reference
{"content": "**Config:**\nAPI Key: Use 'stripe-prod' credential\nWebhook: /webhooks/stripe", "height": 150, "width": 300}
// TODO marker
{"content": "🚧 **TODO:**\n- Add retry logic\n- Implement rate limiting", "height": 120, "width": 280}
Load reference files progressively based on task complexity:
Load workflow_templates.md first:
# Contains 7 starter templates for common patterns
# Quick-start for: manual trigger, webhook, scheduled, API, database, email, error handling
Use when:
Load workflow_patterns.md:
# Contains reusable patterns with complete JSON examples
# Patterns for: HTTP calls, webhooks, conditionals, loops, error handling, data transformation
Use when:
Load api_reference.md:
# Complete REST API documentation
# Includes: workflows, executions, credentials, tags endpoints
# Response formats, error codes, authentication details
Use when:
Load node_registry.md:
# Human-readable reference of common node types
# Organized by category: triggers, actions, flow control, data transformation
# Includes required parameters and typeVersion guidance
Use when:
Creating a simple HTTP to database workflow:
import requests
import json
new_workflow = {
"name": "API to Database",
"nodes": [
{
"parameters": {},
"id": "start",
"name": "Start",
"type": "n8n-nodes-base.start",
"position": [250, 300],
"typeVersion": 1
},
{
"parameters": {
"url": "https://api.example.com/data",
"method": "GET"
},
"id": "http",
"name": "Fetch Data",
"type": "n8n-nodes-base.httpRequest",
"position": [450, 300],
"typeVersion": 1
},
{
"parameters": {
"values": {
"string": [
{
"name": "processed",
"value": "={{ $json.data }}"
}
]
}
},
"id": "set",
"name": "Transform",
"type": "n8n-nodes-base.set",
"position": [650, 300],
"typeVersion": 1
}
],
"connections": {
"Start": {
"main": [[{"node": "Fetch Data", "type": "main", "index": 0}]]
},
"Fetch Data": {
"main": [[{"node": "Transform", "type": "main", "index": 0}]]
}
},
"active": False,
"settings": {}
}
# Create the workflow
response = requests.post(
f"{base_url}/api/v1/workflows",
headers={
"X-N8N-API-KEY": api_key,
"Content-Type": "application/json"
},
json=new_workflow
)
created_workflow = response.json()
print(f"Created workflow: {created_workflow['id']}")
lib/n8n_client.py for common operationsworkflow_validator.py to catch structural issuescredentials command to verify auth is availableexecutions command to debug failed workflowscheck-webhookPython client with N8nClient class for all operations. Can be imported or run as CLI tool. Includes node search, credential discovery, execution monitoring, tag management, upsert, and webhook collision detection.
Standalone workflow validation utility. Performs 16 structural checks before deployment to catch errors early.
Complete n8n REST API documentation including workflows, executions, credentials, and tags endpoints. Load when working with advanced API features or troubleshooting.
Reusable workflow patterns with complete JSON examples for common use cases. Load when designing new workflows or adding functionality to existing ones.
Quick-start templates for creating workflows from scratch. Includes 7 pre-built templates: Manual, Webhook, Scheduled, API Integration, Database, Email, and Error Handling. Load when user wants to create a new workflow.
Human-readable reference of common node types organized by category (triggers, actions, flow control, data transformation, database, communication, annotations). Includes required parameters and typeVersion guidance. Load when user asks about available nodes or needs parameter details.
Authentication errors: Verify N8N_API_KEY is set and valid
Connection errors: Check N8N_BASE_URL is correct and server is running
Update failures: Ensure you're sending complete nodes/connections arrays
Missing nodes: Verify all node types are installed in your n8n instance
Invalid workflow: Use inactive mode first to test before activating
Webhook collisions: Use check-webhook before creating webhook workflows
Execution failures: Use executions --status error to debug
Missing credentials: Use credentials to verify auth is configured
Duplicate workflows: Use upsert instead of create for idempotent deploys
Validation errors: Run workflow_validator.py to identify structural issues