feat(n8n): add get-logs action

This commit is contained in:
zap
2026-03-12 16:45:19 +00:00
parent c1f851b451
commit aa0914f734
6 changed files with 90 additions and 22 deletions
+29 -8
View File
@@ -74,6 +74,28 @@ Current sink:
- key: `actionLog`
- retained entries: `200`
### `get_logs`
Request:
```json
{
"action": "get_logs",
"args": {
"limit": 10
}
}
```
Purpose:
- return the most recent retained log records from workflow static data
Behavior:
- default limit: `20`
- min limit: `1`
- max limit: `50`
- entries are returned newest-first
Success shape:
```json
@@ -81,13 +103,12 @@ Success shape:
"ok": true,
"request_id": "optional-uuid",
"result": {
"action": "append_log",
"status": "logged",
"sink": {
"type": "workflow-static-data",
"key": "actionLog",
"retained_entries": 200
}
"action": "get_logs",
"status": "ok",
"count": 2,
"total_retained": 7,
"retained_entries": 200,
"entries": []
}
}
```
@@ -140,5 +161,5 @@ Success shape:
- Use lowercase kebab-case for webhook paths.
- Use lowercase snake_case or kebab-case consistently for action names; prefer snake_case for JSON actions if using switch/router logic.
- Keep names explicit: `openclaw-ping`, `openclaw-action`, `append_log`, `notify`.
- Keep names explicit: `openclaw-ping`, `openclaw-action`, `append_log`, `get_logs`, `notify`.
- Avoid generic names like `run`, `task`, or `webhook1`.