feat(skill): add local n8n webhook skill draft
This commit is contained in:
76
skills/n8n-webhook/references/payloads.md
Normal file
76
skills/n8n-webhook/references/payloads.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# n8n-webhook payload notes
|
||||
|
||||
## Current live endpoint
|
||||
|
||||
### `openclaw-ping`
|
||||
|
||||
Purpose:
|
||||
- confirm OpenClaw can reach the local n8n webhook surface end-to-end
|
||||
|
||||
Typical request body:
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "hello from OpenClaw"
|
||||
}
|
||||
```
|
||||
|
||||
Recommended success response:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"service": "n8n-agent",
|
||||
"message": "openclaw webhook reached"
|
||||
}
|
||||
```
|
||||
|
||||
## Recommended contract for new endpoints
|
||||
|
||||
Prefer a stable JSON shape like:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"request_id": "optional-uuid",
|
||||
"result": {
|
||||
"...": "workflow-specific payload"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
On failure, return a non-2xx status plus:
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": false,
|
||||
"error": {
|
||||
"code": "short-machine-code",
|
||||
"message": "human-readable summary"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Naming guidance
|
||||
|
||||
- Use lowercase kebab-case webhook paths.
|
||||
- Keep names explicit: `openclaw-ping`, `openclaw-action`, `append-log`, `send-notify`.
|
||||
- Avoid generic names like `run`, `task`, or `webhook1`.
|
||||
|
||||
## Suggested action-bus pattern
|
||||
|
||||
If multiple agent-safe actions are needed, prefer one router webhook such as `openclaw-action`.
|
||||
|
||||
Request shape:
|
||||
|
||||
```json
|
||||
{
|
||||
"action": "append_log",
|
||||
"args": {
|
||||
"text": "backup finished"
|
||||
},
|
||||
"request_id": "optional-uuid"
|
||||
}
|
||||
```
|
||||
|
||||
That keeps the external surface small while letting n8n route internally.
|
||||
Reference in New Issue
Block a user