feat(n8n-webhook): expand action bus starter workflow

This commit is contained in:
zap
2026-03-12 17:22:58 +00:00
parent 2757527957
commit 9dcc477a98
13 changed files with 386 additions and 97 deletions

View File

@@ -48,7 +48,7 @@ Recommended request shape:
}
```
## Live actions
## Live actions in the shipped workflow asset
### `append_log`
@@ -96,23 +96,6 @@ Behavior:
- max limit: `50`
- entries are returned newest-first
Success shape:
```json
{
"ok": true,
"request_id": "optional-uuid",
"result": {
"action": "get_logs",
"status": "ok",
"count": 2,
"total_retained": 7,
"retained_entries": 200,
"entries": []
}
}
```
### `notify`
Request:
@@ -130,21 +113,171 @@ Request:
Purpose:
- send the message through the currently configured Telegram + Discord notification targets
Success shape:
### `send_email_draft`
Request:
```json
{
"ok": true,
"request_id": "optional-uuid",
"result": {
"action": "notify",
"status": "sent",
"targets": ["telegram", "discord"]
"action": "send_email_draft",
"args": {
"to": ["will@example.com"],
"subject": "Draft daily brief",
"body_text": "Here is a draft daily brief for review."
}
}
```
## Failure shape
Purpose:
- queue an email draft proposal for approval
- does **not** send mail directly in the shipped starter workflow
Sink:
- type: `workflow-static-data`
- key: `approvalQueue`
- retained entries: `200`
### `create_calendar_event`
Request:
```json
{
"action": "create_calendar_event",
"args": {
"calendar": "primary",
"title": "Call with vendor",
"start": "2026-03-13T18:00:00Z",
"end": "2026-03-13T18:30:00Z",
"description": "Drafted from OpenClaw action bus."
}
}
```
Purpose:
- queue a calendar event proposal for approval
- does **not** write to a calendar provider directly in the shipped starter workflow
Sink:
- type: `workflow-static-data`
- key: `approvalQueue`
- retained entries: `200`
### `approval_queue_add`
Request:
```json
{
"action": "approval_queue_add",
"args": {
"kind": "manual",
"summary": "Review outbound customer reply",
"payload": {
"channel": "email"
},
"tags": ["approval", "customer"]
}
}
```
Purpose:
- add a generic pending approval item to the queue
### `approval_queue_list`
Request:
```json
{
"action": "approval_queue_list",
"args": {
"limit": 10,
"include_history": true
}
}
```
Purpose:
- inspect pending approval items
- optionally include recent resolved history
### `approval_queue_resolve`
Request:
```json
{
"action": "approval_queue_resolve",
"args": {
"id": "approval-abc123",
"decision": "approve",
"note": "Looks good",
"notify_on_resolve": true
}
}
```
Purpose:
- approve or reject a pending item
- moves resolved entries into `approvalHistory`
### `fetch_and_normalize_url`
Request:
```json
{
"action": "fetch_and_normalize_url",
"args": {
"url": "https://example.com/article",
"max_chars": 8000,
"timeout_ms": 10000
}
}
```
Purpose:
- fetch a URL inside n8n
- normalize content into a predictable summary-ready shape
Success shape includes:
- `url`
- `title`
- `content_type`
- `http_status`
- `excerpt`
- `body_text`
- `text_length`
- `truncated`
### `inbound_event_filter`
Request:
```json
{
"action": "inbound_event_filter",
"args": {
"source": "homelab",
"type": "alert",
"severity": "critical",
"summary": "Build failed on swarm cluster",
"notify": true
}
}
```
Purpose:
- dedupe and classify inbound events
- store recent events in workflow static data
- optionally notify on urgent/important events
Sinks:
- `inboundEvents`
- `eventDedup`
## Common failure shape
```json
{
@@ -160,6 +293,6 @@ Success shape:
## Naming guidance
- 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`, `get_logs`, `notify`.
- Use lowercase snake_case for JSON action names.
- Keep names explicit: `openclaw-ping`, `openclaw-action`, `append_log`, `approval_queue_resolve`.
- Avoid generic names like `run`, `task`, or `webhook1`.