feat(skill): finish n8n webhook skill
This commit is contained in:
369
skills/n8n-webhook/assets/openclaw-action.workflow.json
Normal file
369
skills/n8n-webhook/assets/openclaw-action.workflow.json
Normal file
@@ -0,0 +1,369 @@
|
||||
{
|
||||
"name": "openclaw-action",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "webhook-openclaw-action",
|
||||
"name": "Webhook",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 2.1,
|
||||
"position": [
|
||||
-820,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"httpMethod": "POST",
|
||||
"path": "openclaw-action",
|
||||
"authentication": "none",
|
||||
"responseMode": "responseNode",
|
||||
"options": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "normalize-request",
|
||||
"name": "normalize-request",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
-560,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "manual",
|
||||
"includeOtherFields": false,
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "action",
|
||||
"name": "action",
|
||||
"type": "string",
|
||||
"value": "={{$json.body.action || ''}}"
|
||||
},
|
||||
{
|
||||
"id": "args",
|
||||
"name": "args",
|
||||
"type": "object",
|
||||
"value": "={{$json.body.args || {}}}"
|
||||
},
|
||||
{
|
||||
"id": "request_id",
|
||||
"name": "request_id",
|
||||
"type": "string",
|
||||
"value": "={{$json.body.request_id || ''}}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"dotNotation": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "route-action",
|
||||
"name": "route-action",
|
||||
"type": "n8n-nodes-base.switch",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
-300,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "rules",
|
||||
"rules": {
|
||||
"values": [
|
||||
{
|
||||
"conditions": {
|
||||
"options": {
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict",
|
||||
"version": 2
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"leftValue": "={{$json.action}}",
|
||||
"rightValue": "append_log",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
}
|
||||
}
|
||||
],
|
||||
"combinator": "and"
|
||||
},
|
||||
"renameOutput": true,
|
||||
"outputKey": "append_log"
|
||||
},
|
||||
{
|
||||
"conditions": {
|
||||
"options": {
|
||||
"caseSensitive": true,
|
||||
"typeValidation": "strict",
|
||||
"version": 2
|
||||
},
|
||||
"conditions": [
|
||||
{
|
||||
"leftValue": "={{$json.action}}",
|
||||
"rightValue": "notify",
|
||||
"operator": {
|
||||
"type": "string",
|
||||
"operation": "equals"
|
||||
}
|
||||
}
|
||||
],
|
||||
"combinator": "and"
|
||||
},
|
||||
"renameOutput": true,
|
||||
"outputKey": "notify"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"fallbackOutput": "extra",
|
||||
"renameFallbackOutput": "unknown"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "append-log-response",
|
||||
"name": "append-log-response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
-20,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "manual",
|
||||
"includeOtherFields": false,
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "status_code",
|
||||
"name": "status_code",
|
||||
"type": "number",
|
||||
"value": "={{$json.args.text ? 200 : 400}}"
|
||||
},
|
||||
{
|
||||
"id": "response_body",
|
||||
"name": "response_body",
|
||||
"type": "object",
|
||||
"value": "={{ $json.args.text ? { ok: true, request_id: $json.request_id || '', result: { action: 'append_log', status: 'accepted', preview: { text: $json.args.text } } } : { ok: false, request_id: $json.request_id || '', error: { code: 'invalid_request', message: 'required args are missing' } } }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"dotNotation": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "respond-append-log",
|
||||
"name": "respond-append-log",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"typeVersion": 1.5,
|
||||
"position": [
|
||||
240,
|
||||
-180
|
||||
],
|
||||
"parameters": {
|
||||
"respondWith": "json",
|
||||
"responseBody": "={{$json.response_body}}",
|
||||
"options": {
|
||||
"responseCode": "={{$json.status_code}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "notify-response",
|
||||
"name": "notify-response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
-20,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "manual",
|
||||
"includeOtherFields": false,
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "status_code",
|
||||
"name": "status_code",
|
||||
"type": "number",
|
||||
"value": "={{$json.args.message ? 200 : 400}}"
|
||||
},
|
||||
{
|
||||
"id": "response_body",
|
||||
"name": "response_body",
|
||||
"type": "object",
|
||||
"value": "={{ $json.args.message ? { ok: true, request_id: $json.request_id || '', result: { action: 'notify', status: 'accepted', preview: { title: $json.args.title || '', message: $json.args.message } } } : { ok: false, request_id: $json.request_id || '', error: { code: 'invalid_request', message: 'required args are missing' } } }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"dotNotation": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "respond-notify",
|
||||
"name": "respond-notify",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"typeVersion": 1.5,
|
||||
"position": [
|
||||
240,
|
||||
0
|
||||
],
|
||||
"parameters": {
|
||||
"respondWith": "json",
|
||||
"responseBody": "={{$json.response_body}}",
|
||||
"options": {
|
||||
"responseCode": "={{$json.status_code}}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "unknown-action-response",
|
||||
"name": "unknown-action-response",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [
|
||||
-20,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"mode": "manual",
|
||||
"includeOtherFields": false,
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{
|
||||
"id": "status_code",
|
||||
"name": "status_code",
|
||||
"type": "number",
|
||||
"value": 400
|
||||
},
|
||||
{
|
||||
"id": "response_body",
|
||||
"name": "response_body",
|
||||
"type": "object",
|
||||
"value": "={{ { ok: false, request_id: $json.request_id || '', error: { code: 'unknown_action', message: 'action is not supported' } } }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"dotNotation": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "respond-unknown-action",
|
||||
"name": "respond-unknown-action",
|
||||
"type": "n8n-nodes-base.respondToWebhook",
|
||||
"typeVersion": 1.5,
|
||||
"position": [
|
||||
240,
|
||||
180
|
||||
],
|
||||
"parameters": {
|
||||
"respondWith": "json",
|
||||
"responseBody": "={{$json.response_body}}",
|
||||
"options": {
|
||||
"responseCode": "={{$json.status_code}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Webhook": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "normalize-request",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"normalize-request": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "route-action",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"route-action": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "append-log-response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "notify-response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "unknown-action-response",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"append-log-response": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "respond-append-log",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"notify-response": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "respond-notify",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"unknown-action-response": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "respond-unknown-action",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"pinData": {},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"staticData": null,
|
||||
"meta": {
|
||||
"templateCredsSetupCompleted": false,
|
||||
"note": "After import, set Webhook authentication to Header Auth and bind a local credential using x-openclaw-secret. Secrets are intentionally not embedded in the workflow export."
|
||||
},
|
||||
"active": false,
|
||||
"versionId": "openclaw-action-v1"
|
||||
}
|
||||
Reference in New Issue
Block a user