feat(n8n): wire notify and persist append logs

This commit is contained in:
zap
2026-03-12 15:03:35 +00:00
parent 9b8b744cb1
commit c1f851b451
6 changed files with 288 additions and 129 deletions

View File

@@ -48,31 +48,7 @@ Recommended request shape:
}
```
Recommended success response:
```json
{
"ok": true,
"request_id": "optional-uuid",
"result": {
"status": "accepted"
}
}
```
Recommended failure response:
```json
{
"ok": false,
"error": {
"code": "unknown_action",
"message": "action is not supported"
}
}
```
## Suggested initial actions
## Live actions
### `append_log`
@@ -82,16 +58,39 @@ Request:
{
"action": "append_log",
"args": {
"text": "backup complete"
"text": "backup complete",
"meta": {
"source": "backup-job"
}
}
}
```
Purpose:
- append a short line to a known log or tracking sink
- append one small operational breadcrumb into n8n workflow static data
Sample payload file:
- `assets/test-append-log.json`
Current sink:
- type: `workflow-static-data`
- key: `actionLog`
- retained entries: `200`
Success shape:
```json
{
"ok": true,
"request_id": "optional-uuid",
"result": {
"action": "append_log",
"status": "logged",
"sink": {
"type": "workflow-static-data",
"key": "actionLog",
"retained_entries": 200
}
}
}
```
### `notify`
@@ -108,10 +107,34 @@ Request:
```
Purpose:
- send a small notification through a known downstream channel
- send the message through the currently configured Telegram + Discord notification targets
Sample payload file:
- `assets/test-notify.json`
Success shape:
```json
{
"ok": true,
"request_id": "optional-uuid",
"result": {
"action": "notify",
"status": "sent",
"targets": ["telegram", "discord"]
}
}
```
## Failure shape
```json
{
"ok": false,
"request_id": "optional-uuid",
"error": {
"code": "unknown_action",
"message": "action is not supported"
}
}
```
## Naming guidance