feat(n8n): add get-logs action
This commit is contained in:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user