[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77PZNSRVPZMET21K73FSCFE":3,"skill-same:01M77PZNSRVPZMET21K73FSCFE":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M77PZNSRVPZMET21K73FSCFE","openclaw-n8n-orchestrator",null,"When the user wants to connect an OpenClaw agent to n8n workflows, create n8n webhook skills for OpenClaw, route agent API calls through n8n for credential isolation, build bidirectional OpenClaw-to-n8n pipelines, design the proxy orchestration pattern, deploy co-located Docker stacks, implement the n8n-claw architecture, or publish OpenClaw n8n skills to ClawHub — activate this skill. Also trigger for \"openclaw webhook,\" \"agent workflow automation,\" \"credential isolation,\" \"gateway ingress,\" \"n8n proxy pattern,\" or when securing autonomous agent API access through deterministic orchestration.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fo\u002Fopenclaw-n8n-orchestrator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: openclaw-n8n-orchestrator\ndescription: When the user wants to connect an OpenClaw agent to n8n workflows, create n8n webhook skills for OpenClaw, route agent API calls through n8n for credential isolation, build bidirectional OpenClaw-to-n8n pipelines, design the proxy orchestration pattern, deploy co-located Docker stacks, implement the n8n-claw architecture, or publish OpenClaw n8n skills to ClawHub — activate this skill. Also trigger for \"openclaw webhook,\" \"agent workflow automation,\" \"credential isolation,\" \"gateway ingress,\" \"n8n proxy pattern,\" or when securing autonomous agent API access through deterministic orchestration.\n---\n\n# OpenClaw ↔ n8n Orchestrator\n\nBuild secure, auditable bridges between OpenClaw autonomous agents and n8n deterministic workflows. This skill generates production-ready OpenClaw skill directories (SKILL.md + scripts) that route all external API interactions through n8n's locked, credentialed pipelines.\n\n---\n\n## Why Route Through n8n\n\nOpenClaw's `exec` tool grants the LLM shell-level access. Every API key stored in `.env` or skill files becomes an attack vector — leakable through hallucination, prompt injection, or plaintext logging. The proxy orchestration pattern eliminates this:\n\n- The agent **never touches** external API credentials\n- All external calls route through n8n webhooks with locked, encrypted credentials\n- Every agent-triggered action appears as an inspectable node graph (black-box → glass-box)\n- Deterministic loops run at zero token cost in n8n\n\n---\n\n## Mode Detection\n\n### Mode 1: Egress (OpenClaw → n8n)\n**User says**: \"trigger n8n workflow,\" \"create webhook skill,\" \"call n8n from openclaw\"\n→ Generate an OpenClaw skill directory that triggers n8n webhooks\n\n### Mode 2: Ingress (n8n → OpenClaw)\n**User says**: \"push data to openclaw,\" \"n8n response to agent,\" \"gateway API\"\n→ Configure n8n HTTP Request nodes to POST to the Gateway `\u002Fv1\u002Fresponses` endpoint\n\n### Mode 3: Bidirectional (Proxy Pattern)\n**User says**: \"round trip,\" \"full integration,\" \"proxy pattern,\" \"credential isolation\"\n→ Complete egress + ingress loop with air-gap credential provisioning\n\n### Mode 4: n8n-claw Architecture\n**User says**: \"rebuild agent in n8n,\" \"n8n-claw,\" \"supabase memory\"\n→ Read [references\u002Fn8n-claw-architecture.md](references\u002Fn8n-claw-architecture.md)\n\n### Mode 5: Publish to ClawHub\n**User says**: \"publish skill,\" \"clawhub,\" \"package for registry\"\n→ Read [references\u002Fpublishing.md](references\u002Fpublishing.md)\n\n---\n\n## Generating OpenClaw Skill Directories (Egress)\n\nWhen building an OpenClaw skill that triggers n8n, generate a **complete skill directory** — not a loose file. OpenClaw skills are directories containing a `SKILL.md` with YAML frontmatter.\n\n### Required Directory Structure\n\n```\nopenclaw-{service}-{action}\u002F\n├── SKILL.md              ← YAML frontmatter + instructions (REQUIRED)\n├── README.md             ← Human documentation\n└── scripts\u002F\n    └── trigger.sh        ← Webhook trigger with input sanitization\n```\n\n### SKILL.md Template\n\nEvery generated SKILL.md must follow this exact structure:\n\n```yaml\n---\nname: openclaw-{service}-{action}\ndescription: \"When the user requests {specific trigger condition}, POST a structured JSON payload to the n8n webhook at {path} to execute {what it does}. Use this skill for {explicit use cases}.\"\nhomepage: \"https:\u002F\u002Fgithub.com\u002F{user}\u002F{repo}\"\nmetadata:\n  clawdbot:\n    emoji: \"{relevant_emoji}\"\nrequires:\n  env:\n    - N8N_WEBHOOK_URL\n    - N8N_WEBHOOK_SECRET\n  bins:\n    - \"curl\"\nfiles:\n  - \"scripts\u002F*\"\nuser-invocable: true\n---\n```\n\n**Critical YAML rules:**\n- `description` is the **only** trigger mechanism. The LLM cannot see the Markdown body until after it selects the skill. Pack ALL trigger heuristics into this single string.\n- Use `metadata.clawdbot` namespace — NOT `metadata.openclaw` (the registry ignores the legacy namespace).\n- Use `requires.env` (singular) — NOT `requires.envs` (causes parse validation errors).\n- No multi-line strings or YAML block scalars. The parser expects single-line values or valid arrays only.\n- Declare `files: [\"scripts\u002F*\"]` — omitting this causes ClawHub security scanners to flag the skill as suspicious.\n\n### Markdown Body Structure\n\nBelow the frontmatter, write instructions the LLM will follow. Include these **mandatory transparency sections** for ClawHub compliance:\n\n```markdown\n# {Skill Name}\n\n## Execution\n\nWhen triggered, run the webhook script:\n\n\\`\\`\\`bash\nexec scripts\u002Ftrigger.sh \"{action}\" \"{payload_json}\"\n\\`\\`\\`\n\nThe script sanitizes all input, constructs the authenticated webhook request,\nand returns the n8n response for the agent to summarize.\n\n## Failure Handling\n\n- If curl returns non-zero exit code, read stderr and report the specific error\n- If HTTP 401: webhook secret mismatch — instruct user to verify N8N_WEBHOOK_SECRET\n- If HTTP 404: workflow inactive or path wrong — instruct user to check n8n\n- If HTTP 5xx: n8n execution failure — report and suggest checking n8n execution logs\n- Do NOT hallucinate success if the response is empty or unexpected\n\n## External Endpoints\n\n| URL | Method | Payload |\n|-----|--------|---------|\n| `${N8N_WEBHOOK_URL}\u002Fwebhook\u002Fopenclaw-{service}-{action}` | POST | JSON action + payload object |\n\n## Security & Privacy\n\n- Webhook secret loaded from environment variable, never hardcoded\n- All user input sanitized via URL encoding before shell execution\n- No data stored locally; payload transmitted to n8n instance only\n- Agent has NO access to downstream API credentials (Slack, GitHub, etc.)\n\n## Model Invocation Note\n\nThe OpenClaw agent may invoke this skill autonomously without direct human\nprompting. To disable autonomous triggering, remove this skill directory\nfrom the active skills path.\n\n## Trust Statement\n\nBy using this skill, data is sent to your configured n8n instance.\nOnly install if you trust your n8n deployment and its configured integrations.\n```\n\n### Trigger Script Template\n\nEvery webhook trigger script MUST include:\n1. `set -euo pipefail` (non-negotiable — prevents silent failures)\n2. Security Manifest Header\n3. Input sanitization via `urllib.parse.quote`\n4. `--data-urlencode` or pre-encoded payloads (never raw string interpolation)\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\n# SECURITY MANIFEST:\n# Environment variables accessed: N8N_WEBHOOK_URL, N8N_WEBHOOK_SECRET (only)\n# External endpoints called: ${N8N_WEBHOOK_URL}\u002Fwebhook\u002Fopenclaw-{service}-{action} (only)\n# Local files read: none\n# Local files written: none\n\nACTION=\"${1:?Usage: trigger.sh \u003Caction> \u003Cpayload_json>}\"\nPAYLOAD=\"${2:?Usage: trigger.sh \u003Caction> \u003Cpayload_json>}\"\n\n# Sanitize inputs — prevents shell injection via command substitution\nSAFE_ACTION=$(printf '%s' \"$ACTION\" | python3 -c \\\n  'import sys, urllib.parse; print(urllib.parse.quote(sys.stdin.read().strip(), safe=\"\"))')\n\n# Construct and send webhook request\nRESPONSE=$(curl -s -w \"\\n%{http_code}\" -X POST \\\n  \"${N8N_WEBHOOK_URL}\u002Fwebhook\u002Fopenclaw-${SAFE_ACTION}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"x-webhook-secret: ${N8N_WEBHOOK_SECRET}\" \\\n  --data-urlencode \"payload=${PAYLOAD}\" \\\n  --max-time 30)\n\n# Parse response\nHTTP_CODE=$(echo \"$RESPONSE\" | tail -1)\nBODY=$(echo \"$RESPONSE\" | sed '$d')\n\nif [[ \"$HTTP_CODE\" -ge 200 && \"$HTTP_CODE\" -lt 300 ]]; then\n  echo \"SUCCESS (HTTP ${HTTP_CODE}): ${BODY}\"\n  exit 0\nelse\n  echo \"ERROR (HTTP ${HTTP_CODE}): ${BODY}\" >&2\n  exit 1\nfi\n```\n\n### Native MCP Tool Alternative\n\nFor simple webhook calls, prefer OpenClaw's built-in `exec` tool with a Node.js one-liner over shell scripts. Node.js avoids shell expansion vulnerabilities entirely:\n\n```javascript\n\u002F\u002F Inline via exec tool — no external dependencies\nconst https = require('https');\nconst data = JSON.stringify({action: ACTION, payload: PAYLOAD});\nconst options = {\n  hostname: N8N_HOST, port: 5678, path: '\u002Fwebhook\u002Fopenclaw-{service}-{action}',\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application\u002Fjson',\n    'x-webhook-secret': process.env.N8N_WEBHOOK_SECRET,\n    'Content-Length': data.length\n  }\n};\nconst req = https.request(options, res => {\n  let body = '';\n  res.on('data', chunk => body += chunk);\n  res.on('end', () => {\n    process.stdout.write(body);\n    process.exit(res.statusCode >= 200 && res.statusCode \u003C 300 ? 0 : 1);\n  });\n});\nreq.on('error', e => { process.stderr.write(e.message); process.exit(1); });\nreq.write(data);\nreq.end();\n```\n\nNode.js is preferred because OpenClaw requires Node.js 22+ — it's always available. No dependencies, no shell injection surface.\n\n---\n\n## Ingress: n8n → OpenClaw Gateway\n\nThe Gateway `\u002Fv1\u002Fresponses` endpoint is **disabled by default**.\n\n### Enable the Endpoint\n\nEdit `openclaw.json`:\n```json\n{\n  \"gateway\": {\n    \"http\": {\n      \"endpoints\": {\n        \"responses\": { \"enabled\": true }\n      }\n    },\n    \"auth\": {\n      \"mode\": \"token\",\n      \"token\": \"${OPENCLAW_GATEWAY_TOKEN}\"\n    }\n  }\n}\n```\n\n### n8n HTTP Request Node Configuration\n\n| Parameter | Value | Why |\n|-----------|-------|-----|\n| Method | POST | Standard transmission |\n| URL | `http:\u002F\u002F{gateway-host}:18789\u002Fv1\u002Fresponses` | OpenResponses ingress |\n| Authorization | `Bearer {token}` | Gateway auth |\n| Content-Type | `application\u002Fjson` | JSON parsing |\n| timeout_seconds | `0` | **MANDATORY** — prevents infinite echo loop |\n\n**The echo loop problem**: Without `timeout_seconds: 0`, the Gateway event bus reverberates the payload back into the session, causing the LLM to hallucinate an infinite dialogue with its own data. This destroys the 64k token context window and burns API costs exponentially.\n\n### Ingress Payload\n\n```json\n{\n  \"model\": \"claude-sonnet-4-20250514\",\n  \"user\": \"n8n-workflow-{workflow_id}\",\n  \"input\": [\n    { \"role\": \"user\", \"content\": \"Workflow result: {data}\" }\n  ],\n  \"instructions\": \"Summarize this result for the user. Do NOT re-trigger the workflow.\",\n  \"stream\": false,\n  \"timeout_seconds\": 0\n}\n```\n\nThe `user` string routes to a stable session. Use consistent patterns: `n8n-workflow-{id}` for per-workflow sessions, `n8n-global` for shared.\n\n→ Full Gateway API spec, WebSocket protocol, telemetry codes: [references\u002Fgateway-api.md](references\u002Fgateway-api.md)\n\n---\n\n## Proxy Orchestration Lifecycle\n\n```\n1. USER → Agent: \"Post Q3 report to #marketing Slack\"\n2. Agent REASONS: needs Slack API → has no credentials → knows webhook exists\n3. Agent TRIGGERS: exec scripts\u002Ftrigger.sh \"slack-send-message\" '{\"channel\":\"#marketing\"}'\n4. n8n EXECUTES: Webhook → Validate → Slack API (locked credentials) → Log\n5. n8n RETURNS: HTTP POST to Gateway \u002Fv1\u002Fresponses with result\n6. Agent REPORTS: \"Posted to #marketing at 2:34 PM\"\n```\n\n### Air-Gap Credential Provisioning\n\nAfter the agent generates the workflow structure:\n1. Human logs into n8n UI\n2. Provisions API keys into n8n's encrypted credential store\n3. Binds credentials to nodes\n4. **Locks the workflow** — agent cannot alter it\n5. Agent only sends webhook payloads from this point\n\n→ Security deep-dive, ClawHavoc analysis, safeguard nodes: [references\u002Fsecurity.md](references\u002Fsecurity.md)\n\n---\n\n## System Hardening\n\n### Gateway Hardening (Critical)\n\nConfigure `exec` tool approval in `openclaw.json`:\n```json\n{\n  \"exec\": {\n    \"enabled\": true,\n    \"approval\": true\n  }\n}\n```\n\nWith `approval: true`, every shell command requires human confirmation. This prevents a prompt-injected agent from executing arbitrary code.\n\n### soul.md Guardrails\n\nAdd to the agent's `soul.md`:\n```markdown\n## Hard Constraints\n- NEVER store, log, or output API keys or webhook secrets in conversation\n- NEVER attempt to access n8n management API — only use webhook endpoints\n- NEVER execute shell commands that modify system files outside workspace\u002F\n- If a webhook fails 3 consecutive times, STOP and alert the user\n- NEVER enter infinite retry loops on failed API calls\n```\n\n### Multi-Model Routing for Cost Optimization\n\nConfigure OpenRouter in `openclaw.json` to route mundane webhook formatting to cheap models (GPT-4o Mini, Claude 3.5 Haiku) and reserve expensive models for complex reasoning:\n\n```json\n{\n  \"reasoning\": {\n    \"default_model\": \"openrouter\u002Fgpt-4o-mini\",\n    \"complex_model\": \"openrouter\u002Fclaude-opus-4-20250514\",\n    \"routing\": \"cost-optimized\"\n  }\n}\n```\n\nThis reduces API costs by ~70% for repetitive webhook orchestration tasks.\n\n---\n\n## Scaling: The SkillPointer Pattern\n\nWhen managing many n8n webhook skills (20+), loading all skill metadata at startup wastes tokens. Use the SkillPointer pattern:\n\n1. Move individual webhook skills to a vault directory outside the agent's scan path:\n   `~\u002F.openclaw\u002Fvault\u002Fn8n-webhooks\u002F`\n\n2. Create a single lightweight pointer skill in the active directory:\n\n```yaml\n---\nname: n8n-webhook-router\ndescription: \"When the user needs to trigger ANY n8n workflow or webhook integration, use the list and read tools to browse ~\u002F.openclaw\u002Fvault\u002Fn8n-webhooks\u002F to find and load the exact skill required.\"\n---\n```\n\n3. The agent dynamically discovers skills via filesystem traversal at runtime\n\nThis reduces startup token consumption from ~8,000 tokens (40 webhook skills × 200 tokens each) to ~200 tokens (one pointer), while maintaining access to every skill.\n\n---\n\n## Deployment\n\n→ Docker Compose templates, network topologies, environment variables: [references\u002Fdeployment.md](references\u002Fdeployment.md)\n\n**Quick reference**: OpenClaw Gateway defaults to port 18789, n8n to 5678. Never bind the Gateway to public interfaces. Use SSH tunnels or Tailscale for cross-network ingress.\n\n---\n\n## Failure Mode Reference\n\n### Egress\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| 401 from webhook | Secret mismatch | Verify `N8N_WEBHOOK_SECRET` matches n8n Header Auth credential |\n| 404 from webhook | Inactive workflow or wrong path | Activate workflow; verify naming convention |\n| Connection refused | Network unreachable | Check topology, ports, firewall |\n| Trigger script hangs | Missing `set -euo pipefail` | Add strict error handling; ensure no interactive prompts |\n| Shell injection | Raw input interpolation | Use `urllib.parse.quote` or Node.js (no shell expansion) |\n\n### Ingress\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| 403 from Gateway | Token mismatch | Verify `OPENCLAW_GATEWAY_TOKEN` |\n| Infinite echo loop | Missing `timeout_seconds: 0` | Add immediately |\n| Session not found | Inconsistent `user` string | Use stable pattern: `n8n-workflow-{id}` |\n| `DEVICE_AUTH_SIGNATURE_EXPIRED` | Clock skew | Sync NTP across hosts |\n| Skill not loading | Invalid YAML frontmatter | Check for multi-line strings; validate with `openclaw skills status` |\n\n---\n\n## Quick Start Checklist\n\n**Egress only:**\n- [ ] OpenClaw running (Node.js 22+) with workspace\u002Fskill\u002F directory\n- [ ] n8n running with webhook endpoint reachable\n- [ ] Webhook secret generated: `openssl rand -hex 32`\n- [ ] Skill directory created with SKILL.md (YAML frontmatter) + scripts\u002Ftrigger.sh\n- [ ] `N8N_WEBHOOK_URL` and `N8N_WEBHOOK_SECRET` set in `.env`\n- [ ] `requires.env` and `requires.bins` declared in YAML frontmatter\n- [ ] `files: [\"scripts\u002F*\"]` declared in frontmatter\n- [ ] Security Manifest Header in trigger.sh\n- [ ] `set -euo pipefail` in trigger.sh\n- [ ] Input sanitization via `urllib.parse.quote` or Node.js\n- [ ] n8n workflow created, validated, activated with Header Auth credential\n- [ ] Test with manual `curl` before agent triggers\n\n**Add bidirectional:**\n- [ ] Gateway `\u002Fv1\u002Fresponses` enabled in `openclaw.json`\n- [ ] `exec.approval: true` configured in gateway\n- [ ] `soul.md` guardrails written\n- [ ] `timeout_seconds: 0` in all ingress payloads\n- [ ] SSH tunnel or Tailscale for cross-network Gateway access\n\n---\n\n## Reference Files\n\n- **[references\u002Fdeployment.md](references\u002Fdeployment.md)** — Docker Compose, topologies, env vars\n- **[references\u002Fgateway-api.md](references\u002Fgateway-api.md)** — Gateway endpoints, WebSocket protocol, payload schemas, telemetry codes\n- **[references\u002Fsecurity.md](references\u002Fsecurity.md)** — Proxy pattern, ClawHavoc analysis, credential isolation, safeguard nodes, shell injection mitigation\n- **[references\u002Fn8n-claw-architecture.md](references\u002Fn8n-claw-architecture.md)** — n8n-claw paradigm: Supabase schema, RAG pipeline, MCP Builder, Telegram interface\n- **[references\u002Fpublishing.md](references\u002Fpublishing.md)** — ClawHub publishing pipeline, `clawhub` CLI, security scan requirements, version management\n","# OpenClaw ↔ n8n Orchestrator\n\nBuild secure, auditable bridges between OpenClaw autonomous agents and n8n deterministic workflows. This skill generates production-ready OpenClaw skill directories (SKILL.md + scripts) that route all external API interactions through n8n's locked, credentialed pipelines.\n\n---\n\n## Why Route Through n8n\n\nOpenClaw's `exec` tool grants the LLM shell-level access. Every API key stored in `.env` or skill files becomes an attack vector — leakable through hallucination, prompt injection, or plaintext logging. The proxy orchestration pattern eliminates this:\n\n- The agent **never touches** external API credentials\n- All external calls route through n8n webhooks with locked, encrypted credentials\n- Every agent-triggered action appears as an inspectable node graph (black-box → glass-box)\n- Deterministic loops run at zero token cost in n8n\n\n---\n\n## Mode Detection\n\n### Mode 1: Egress (OpenClaw → n8n)\n**User says**: \"trigger n8n workflow,\" \"create webhook skill,\" \"call n8n from openclaw\"\n→ Generate an OpenClaw skill directory that triggers n8n webhooks\n\n### Mode 2: Ingress (n8n → OpenClaw)\n**User says**: \"push data to openclaw,\" \"n8n response to agent,\" \"gateway API\"\n→ Configure n8n HTTP Request nodes to POST to the Gateway `\u002Fv1\u002Fresponses` endpoint\n\n### Mode 3: Bidirectional (Proxy Pattern)\n**User says**: \"round trip,\" \"full integration,\" \"proxy pattern,\" \"credential isolation\"\n→ Complete egress + ingress loop with air-gap credential provisioning\n\n### Mode 4: n8n-claw Architecture\n**User says**: \"rebuild agent in n8n,\" \"n8n-claw,\" \"supabase memory\"\n→ Read [references\u002Fn8n-claw-architecture.md](references\u002Fn8n-claw-architecture.md)\n\n### Mode 5: Publish to ClawHub\n**User says**: \"publish skill,\" \"clawhub,\" \"package for registry\"\n→ Read [references\u002Fpublishing.md](references\u002Fpublishing.md)\n\n---\n\n## Generating OpenClaw Skill Directories (Egress)\n\nWhen building an OpenClaw skill that triggers n8n, generate a **complete skill directory** — not a loose file. OpenClaw skills are directories containing a `SKILL.md` with YAML frontmatter.\n\n### Required Directory Structure\n\n```\nopenclaw-{service}-{action}\u002F\n├── SKILL.md              ← YAML frontmatter + instructions (REQUIRED)\n├── README.md             ← Human documentation\n└── scripts\u002F\n    └── trigger.sh        ← Webhook trigger with input sanitization\n```\n\n### SKILL.md Template\n\nEvery generated SKILL.md must follow this exact structure:\n\n```yaml\n---\nname: openclaw-{service}-{action}\ndescription: \"When the user requests {specific trigger condition}, POST a structured JSON payload to the n8n webhook at {path} to execute {what it does}. Use this skill for {explicit use cases}.\"\nhomepage: \"https:\u002F\u002Fgithub.com\u002F{user}\u002F{repo}\"\nmetadata:\n  clawdbot:\n    emoji: \"{relevant_emoji}\"\nrequires:\n  env:\n    - N8N_WEBHOOK_URL\n    - N8N_WEBHOOK_SECRET\n  bins:\n    - \"curl\"\nfiles:\n  - \"scripts\u002F*\"\nuser-invocable: true\n---\n```\n\n**Critical YAML rules:**\n- `description` is the **only** trigger mechanism. The LLM cannot see the Markdown body until after it selects the skill. Pack ALL trigger heuristics into this single string.\n- Use `metadata.clawdbot` namespace — NOT `metadata.openclaw` (the registry ignores the legacy namespace).\n- Use `requires.env` (singular) — NOT `requires.envs` (causes parse validation errors).\n- No multi-line strings or YAML block scalars. The parser expects single-line values or valid arrays only.\n- Declare `files: [\"scripts\u002F*\"]` — omitting this causes ClawHub security scanners to flag the skill as suspicious.\n\n### Markdown Body Structure\n\nBelow the frontmatter, write instructions the LLM will follow. Include these **mandatory transparency sections** for ClawHub compliance:\n\n```markdown\n# {Skill Name}\n\n## Execution\n\nWhen triggered, run the webhook script:\n\n\\`\\`\\`bash\nexec scripts\u002Ftrigger.sh \"{action}\" \"{payload_json}\"\n\\`\\`\\`\n\nThe script sanitizes all input, constructs the authenticated webhook request,\nand returns the n8n response for the agent to summarize.\n\n## Failure Handling\n\n- If curl returns non-zero exit code, read stderr and report the specific error\n- If HTTP 401: webhook secret mismatch — instruct user to verify N8N_WEBHOOK_SECRET\n- If HTTP 404: workflow inactive or path wrong — instruct user to check n8n\n- If HTTP 5xx: n8n execution failure — report and suggest checking n8n execution logs\n- Do NOT hallucinate success if the response is empty or unexpected\n\n## External Endpoints\n\n| URL | Method | Payload |\n|-----|--------|---------|\n| `${N8N_WEBHOOK_URL}\u002Fwebhook\u002Fopenclaw-{service}-{action}` | POST | JSON action + payload object |\n\n## Security & Privacy\n\n- Webhook secret loaded from environment variable, never hardcoded\n- All user input sanitized via URL encoding before shell execution\n- No data stored locally; payload transmitted to n8n instance only\n- Agent has NO access to downstream API credentials (Slack, GitHub, etc.)\n\n## Model Invocation Note\n\nThe OpenClaw agent may invoke this skill autonomously without direct human\nprompting. To disable autonomous triggering, remove this skill directory\nfrom the active skills path.\n\n## Trust Statement\n\nBy using this skill, data is sent to your configured n8n instance.\nOnly install if you trust your n8n deployment and its configured integrations.\n```\n\n### Trigger Script Template\n\nEvery webhook trigger script MUST include:\n1. `set -euo pipefail` (non-negotiable — prevents silent failures)\n2. Security Manifest Header\n3. Input sanitization via `urllib.parse.quote`\n4. `--data-urlencode` or pre-encoded payloads (never raw string interpolation)\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nset -euo pipefail\n\n# SECURITY MANIFEST:\n# Environment variables accessed: N8N_WEBHOOK_URL, N8N_WEBHOOK_SECRET (only)\n# External endpoints called: ${N8N_WEBHOOK_URL}\u002Fwebhook\u002Fopenclaw-{service}-{action} (only)\n# Local files read: none\n# Local files written: none\n\nACTION=\"${1:?Usage: trigger.sh \u003Caction> \u003Cpayload_json>}\"\nPAYLOAD=\"${2:?Usage: trigger.sh \u003Caction> \u003Cpayload_json>}\"\n\n# Sanitize inputs — prevents shell injection via command substitution\nSAFE_ACTION=$(printf '%s' \"$ACTION\" | python3 -c \\\n  'import sys, urllib.parse; print(urllib.parse.quote(sys.stdin.read().strip(), safe=\"\"))')\n\n# Construct and send webhook request\nRESPONSE=$(curl -s -w \"\\n%{http_code}\" -X POST \\\n  \"${N8N_WEBHOOK_URL}\u002Fwebhook\u002Fopenclaw-${SAFE_ACTION}\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"x-webhook-secret: ${N8N_WEBHOOK_SECRET}\" \\\n  --data-urlencode \"payload=${PAYLOAD}\" \\\n  --max-time 30)\n\n# Parse response\nHTTP_CODE=$(echo \"$RESPONSE\" | tail -1)\nBODY=$(echo \"$RESPONSE\" | sed '$d')\n\nif [[ \"$HTTP_CODE\" -ge 200 && \"$HTTP_CODE\" -lt 300 ]]; then\n  echo \"SUCCESS (HTTP ${HTTP_CODE}): ${BODY}\"\n  exit 0\nelse\n  echo \"ERROR (HTTP ${HTTP_CODE}): ${BODY}\" >&2\n  exit 1\nfi\n```\n\n### Native MCP Tool Alternative\n\nFor simple webhook calls, prefer OpenClaw's built-in `exec` tool with a Node.js one-liner over shell scripts. Node.js avoids shell expansion vulnerabilities entirely:\n\n```javascript\n\u002F\u002F Inline via exec tool — no external dependencies\nconst https = require('https');\nconst data = JSON.stringify({action: ACTION, payload: PAYLOAD});\nconst options = {\n  hostname: N8N_HOST, port: 5678, path: '\u002Fwebhook\u002Fopenclaw-{service}-{action}',\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application\u002Fjson',\n    'x-webhook-secret': process.env.N8N_WEBHOOK_SECRET,\n    'Content-Length': data.length\n  }\n};\nconst req = https.request(options, res => {\n  let body = '';\n  res.on('data', chunk => body += chunk);\n  res.on('end', () => {\n    process.stdout.write(body);\n    process.exit(res.statusCode >= 200 && res.statusCode \u003C 300 ? 0 : 1);\n  });\n});\nreq.on('error', e => { process.stderr.write(e.message); process.exit(1); });\nreq.write(data);\nreq.end();\n```\n\nNode.js is preferred because OpenClaw requires Node.js 22+ — it's always available. No dependencies, no shell injection surface.\n\n---\n\n## Ingress: n8n → OpenClaw Gateway\n\nThe Gateway `\u002Fv1\u002Fresponses` endpoint is **disabled by default**.\n\n### Enable the Endpoint\n\nEdit `openclaw.json`:\n```json\n{\n  \"gateway\": {\n    \"http\": {\n      \"endpoints\": {\n        \"responses\": { \"enabled\": true }\n      }\n    },\n    \"auth\": {\n      \"mode\": \"token\",\n      \"token\": \"${OPENCLAW_GATEWAY_TOKEN}\"\n    }\n  }\n}\n```\n\n### n8n HTTP Request Node Configuration\n\n| Parameter | Value | Why |\n|-----------|-------|-----|\n| Method | POST | Standard transmission |\n| URL | `http:\u002F\u002F{gateway-host}:18789\u002Fv1\u002Fresponses` | OpenResponses ingress |\n| Authorization | `Bearer {token}` | Gateway auth |\n| Content-Type | `application\u002Fjson` | JSON parsing |\n| timeout_seconds | `0` | **MANDATORY** — prevents infinite echo loop |\n\n**The echo loop problem**: Without `timeout_seconds: 0`, the Gateway event bus reverberates the payload back into the session, causing the LLM to hallucinate an infinite dialogue with its own data. This destroys the 64k token context window and burns API costs exponentially.\n\n### Ingress Payload\n\n```json\n{\n  \"model\": \"claude-sonnet-4-20250514\",\n  \"user\": \"n8n-workflow-{workflow_id}\",\n  \"input\": [\n    { \"role\": \"user\", \"content\": \"Workflow result: {data}\" }\n  ],\n  \"instructions\": \"Summarize this result for the user. Do NOT re-trigger the workflow.\",\n  \"stream\": false,\n  \"timeout_seconds\": 0\n}\n```\n\nThe `user` string routes to a stable session. Use consistent patterns: `n8n-workflow-{id}` for per-workflow sessions, `n8n-global` for shared.\n\n→ Full Gateway API spec, WebSocket protocol, telemetry codes: [references\u002Fgateway-api.md](references\u002Fgateway-api.md)\n\n---\n\n## Proxy Orchestration Lifecycle\n\n```\n1. USER → Agent: \"Post Q3 report to #marketing Slack\"\n2. Agent REASONS: needs Slack API → has no credentials → knows webhook exists\n3. Agent TRIGGERS: exec scripts\u002Ftrigger.sh \"slack-send-message\" '{\"channel\":\"#marketing\"}'\n4. n8n EXECUTES: Webhook → Validate → Slack API (locked credentials) → Log\n5. n8n RETURNS: HTTP POST to Gateway \u002Fv1\u002Fresponses with result\n6. Agent REPORTS: \"Posted to #marketing at 2:34 PM\"\n```\n\n### Air-Gap Credential Provisioning\n\nAfter the agent generates the workflow structure:\n1. Human logs into n8n UI\n2. Provisions API keys into n8n's encrypted credential store\n3. Binds credentials to nodes\n4. **Locks the workflow** — agent cannot alter it\n5. Agent only sends webhook payloads from this point\n\n→ Security deep-dive, ClawHavoc analysis, safeguard nodes: [references\u002Fsecurity.md](references\u002Fsecurity.md)\n\n---\n\n## System Hardening\n\n### Gateway Hardening (Critical)\n\nConfigure `exec` tool approval in `openclaw.json`:\n```json\n{\n  \"exec\": {\n    \"enabled\": true,\n    \"approval\": true\n  }\n}\n```\n\nWith `approval: true`, every shell command requires human confirmation. This prevents a prompt-injected agent from executing arbitrary code.\n\n### soul.md Guardrails\n\nAdd to the agent's `soul.md`:\n```markdown\n## Hard Constraints\n- NEVER store, log, or output API keys or webhook secrets in conversation\n- NEVER attempt to access n8n management API — only use webhook endpoints\n- NEVER execute shell commands that modify system files outside workspace\u002F\n- If a webhook fails 3 consecutive times, STOP and alert the user\n- NEVER enter infinite retry loops on failed API calls\n```\n\n### Multi-Model Routing for Cost Optimization\n\nConfigure OpenRouter in `openclaw.json` to route mundane webhook formatting to cheap models (GPT-4o Mini, Claude 3.5 Haiku) and reserve expensive models for complex reasoning:\n\n```json\n{\n  \"reasoning\": {\n    \"default_model\": \"openrouter\u002Fgpt-4o-mini\",\n    \"complex_model\": \"openrouter\u002Fclaude-opus-4-20250514\",\n    \"routing\": \"cost-optimized\"\n  }\n}\n```\n\nThis reduces API costs by ~70% for repetitive webhook orchestration tasks.\n\n---\n\n## Scaling: The SkillPointer Pattern\n\nWhen managing many n8n webhook skills (20+), loading all skill metadata at startup wastes tokens. Use the SkillPointer pattern:\n\n1. Move individual webhook skills to a vault directory outside the agent's scan path:\n   `~\u002F.openclaw\u002Fvault\u002Fn8n-webhooks\u002F`\n\n2. Create a single lightweight pointer skill in the active directory:\n\n```yaml\n---\nname: n8n-webhook-router\ndescription: \"When the user needs to trigger ANY n8n workflow or webhook integration, use the list and read tools to browse ~\u002F.openclaw\u002Fvault\u002Fn8n-webhooks\u002F to find and load the exact skill required.\"\n---\n```\n\n3. The agent dynamically discovers skills via filesystem traversal at runtime\n\nThis reduces startup token consumption from ~8,000 tokens (40 webhook skills × 200 tokens each) to ~200 tokens (one pointer), while maintaining access to every skill.\n\n---\n\n## Deployment\n\n→ Docker Compose templates, network topologies, environment variables: [references\u002Fdeployment.md](references\u002Fdeployment.md)\n\n**Quick reference**: OpenClaw Gateway defaults to port 18789, n8n to 5678. Never bind the Gateway to public interfaces. Use SSH tunnels or Tailscale for cross-network ingress.\n\n---\n\n## Failure Mode Reference\n\n### Egress\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| 401 from webhook | Secret mismatch | Verify `N8N_WEBHOOK_SECRET` matches n8n Header Auth credential |\n| 404 from webhook | Inactive workflow or wrong path | Activate workflow; verify naming convention |\n| Connection refused | Network unreachable | Check topology, ports, firewall |\n| Trigger script hangs | Missing `set -euo pipefail` | Add strict error handling; ensure no interactive prompts |\n| Shell injection | Raw input interpolation | Use `urllib.parse.quote` or Node.js (no shell expansion) |\n\n### Ingress\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| 403 from Gateway | Token mismatch | Verify `OPENCLAW_GATEWAY_TOKEN` |\n| Infinite echo loop | Missing `timeout_seconds: 0` | Add immediately |\n| Session not found | Inconsistent `user` string | Use stable pattern: `n8n-workflow-{id}` |\n| `DEVICE_AUTH_SIGNATURE_EXPIRED` | Clock skew | Sync NTP across hosts |\n| Skill not loading | Invalid YAML frontmatter | Check for multi-line strings; validate with `openclaw skills status` |\n\n---\n\n## Quick Start Checklist\n\n**Egress only:**\n- [ ] OpenClaw running (Node.js 22+) with workspace\u002Fskill\u002F directory\n- [ ] n8n running with webhook endpoint reachable\n- [ ] Webhook secret generated: `openssl rand -hex 32`\n- [ ] Skill directory created with SKILL.md (YAML frontmatter) + scripts\u002Ftrigger.sh\n- [ ] `N8N_WEBHOOK_URL` and `N8N_WEBHOOK_SECRET` set in `.env`\n- [ ] `requires.env` and `requires.bins` declared in YAML frontmatter\n- [ ] `files: [\"scripts\u002F*\"]` declared in frontmatter\n- [ ] Security Manifest Header in trigger.sh\n- [ ] `set -euo pipefail` in trigger.sh\n- [ ] Input sanitization via `urllib.parse.quote` or Node.js\n- [ ] n8n workflow created, validated, activated with Header Auth credential\n- [ ] Test with manual `curl` before agent triggers\n\n**Add bidirectional:**\n- [ ] Gateway `\u002Fv1\u002Fresponses` enabled in `openclaw.json`\n- [ ] `exec.approval: true` configured in gateway\n- [ ] `soul.md` guardrails written\n- [ ] `timeout_seconds: 0` in all ingress payloads\n- [ ] SSH tunnel or Tailscale for cross-network Gateway access\n\n---\n\n## Reference Files\n\n- **[references\u002Fdeployment.md](references\u002Fdeployment.md)** — Docker Compose, topologies, env vars\n- **[references\u002Fgateway-api.md](references\u002Fgateway-api.md)** — Gateway endpoints, WebSocket protocol, payload schemas, telemetry codes\n- **[references\u002Fsecurity.md](references\u002Fsecurity.md)** — Proxy pattern, ClawHavoc analysis, credential isolation, safeguard nodes, shell injection mitigation\n- **[references\u002Fn8n-claw-architecture.md](references\u002Fn8n-claw-architecture.md)** — n8n-claw paradigm: Supabase schema, RAG pipeline, MCP Builder, Telegram interface\n- **[references\u002Fpublishing.md](references\u002Fpublishing.md)** — ClawHub publishing pipeline, `clawhub` CLI, security scan requirements, version management\n",{"name":5,"description":7},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fo\u002Fopenclaw-n8n-orchestrator",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill openclaw-n8n-orchestrator",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill openclaw-n8n-orchestrator",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill openclaw-n8n-orchestrator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fo\u002Fopenclaw-n8n-orchestrator\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]