N8n trigger

From bidewio/better-openclaw · View interactive version

N8n trigger is an AI agent skill from the GitHub repository bidewio/better-openclaw. Trigger automation workflows, manage webhooks, and orchestrate multi-step tasks via the n8n instance at {{N8N_HOST}}:{{N8N_PORT}}.

How to use this skill

Skill file

n8n Trigger Skill

n8n workflow automation is available at http://{{N8N_HOST}}:{{N8N_PORT}} within the Docker network.

Triggering a Webhook

Fire a webhook to start a pre-configured workflow:

# POST with JSON payload
curl -X POST "http://{{N8N_HOST}}:{{N8N_PORT}}/webhook/openclaw-trigger" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "file_processed",
    "file": "/data/output/result.csv",
    "timestamp": "2025-01-15T10:30:00Z"
  }'

# GET webhook with query parameters
curl "http://{{N8N_HOST}}:{{N8N_PORT}}/webhook/openclaw-status?task_id=abc123"

Triggering a Test Webhook

During workflow development, use the test webhook endpoint:

curl -X POST "http://{{N8N_HOST}}:{{N8N_PORT}}/webhook-test/openclaw-trigger" \
  -H "Content-Type: application/json" \
  -d '{"test": true, "message": "Hello from OpenClaw"}'

Listing Workflows

Retrieve all workflows via the n8n REST API:

curl -H "X-N8N-API-KEY: $N8N_API_KEY" \
  "http://{{N8N_HOST}}:{{N8N_PORT}}/api/v1/workflows"

Activating / Deactivating a Workflow

# Activate workflow by ID
curl -X PATCH "http://{{N8N_HOST}}:{{N8N_PORT}}/api/v1/workflows/1" \
  -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": true}'

# Deactivate
curl -X PATCH "http://{{N8N_HOST}}:{{N8N_PORT}}/api/v1/workflows/1" \
  -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": false}'

Getting Workflow Executions

Check the status and output of past workflow runs:

curl -H "X-N8N-API-KEY: $N8N_API_KEY" \
  "http://{{N8N_HOST}}:{{N8N_PORT}}/api/v1/executions?workflowId=1&limit=10"

Creating a Workflow via API

curl -X POST "http://{{N8N_HOST}}:{{N8N_PORT}}/api/v1/workflows" \
  -H "X-N8N-API-KEY: $N8N_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "OpenClaw Data Pipeline",
    "active": false,
    "nodes": [
      {
        "parameters": { "httpMethod": "POST", "path": "openclaw-pipeline" },
        "name": "Webhook",
        "type": "n8n-nodes-base.webhook",
        "typeVersion": 1,
        "position": [250, 300]
      }
    ],
    "connections": {}
  }'

Webhook Naming Conventions

Tips for AI Agents

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.