fix(n8n-webhook): deploy and verify expanded action bus

This commit is contained in:
zap
2026-03-12 17:33:26 +00:00
parent 9dcc477a98
commit dc990a1af3
7 changed files with 40 additions and 9 deletions

View File

@@ -51,3 +51,21 @@
- Design choice for the new actions: keep the starter workflow immediately usable without new provider credentials by using n8n workflow static data for approval queue/history/event state, while leaving room to wire provider-backed email/calendar executors later.
- Updated local docs, validator, and sample payloads for the expanded action bus and re-ran local structural validation successfully.
- Live n8n re-import/update was not completed in this pass because the current session did not have a verified safe path into the already-running instance (no confirmed admin/browser path and no confirmed current webhook secret for live test calls).
- Follow-up in the next direct session: recovered the already-verified live n8n API path from the earlier session log and used it to deploy the expanded `openclaw-action` workflow in place.
- Live verification of the expanded action set after deployment:
- `append_log``200`
- `get_logs``200`
- `send_email_draft``200` (approval-queued)
- `create_calendar_event``200` (approval-queued)
- `approval_queue_add``200`
- `approval_queue_list``200`
- `approval_queue_resolve``200`
- `inbound_event_filter``200`
- `notify``200`
- unknown action → `400` with `unknown_action`
- `fetch_and_normalize_url` initially failed in the Code node because global `fetch` was unavailable; a second attempt using Node built-ins failed because module imports were disallowed in the n8n runtime.
- Final fix for URL fetching: switched `fetch_and_normalize_url` to n8n's runtime helper `this.helpers.httpRequest`, which worked. Added optional arg `skip_ssl_certificate_validation: true` for environments where the container CA bundle is insufficient.
- Verified `fetch_and_normalize_url` live with:
- local HTTP URL `http://192.168.153.113:18808/healthz` → success
- `https://example.com` with `skip_ssl_certificate_validation: true` → success
- Cleanup: resolved the temporary verification approval items so `approvalQueue` ended empty after testing.

View File

@@ -101,13 +101,18 @@ Use the included workflow asset when you want a ready-made local router for:
- `append_log` → append small records into workflow static data (`actionLog`, latest 200)
- `get_logs` → read the most recent retained records from `actionLog`
- `notify` → send through the current Telegram + Discord notification paths
- `send_email_draft` → queue approval-gated email drafts in workflow static data
- `create_calendar_event` → queue approval-gated calendar proposals in workflow static data
- `approval_queue_add` / `approval_queue_list` / `approval_queue_resolve` → manage pending approvals and recent history
- `fetch_and_normalize_url` → fetch + normalize URL content using n8n runtime HTTP helpers
- `inbound_event_filter` → classify, dedupe, store, and optionally notify on inbound events
- normalized JSON success/failure responses
- unknown-action handling
Important:
- the workflow export intentionally leaves Webhook authentication unset
- after import, manually set **Authentication = Header Auth** on the Webhook node and bind a local credential using `x-openclaw-secret`
- the shipped asset already includes the live side-effect shape for local JSONL logging plus Telegram/Discord fan-out
- the shipped asset uses workflow static data for small queues/state; it does not embed secrets or require provider credentials for the starter approval-gated actions
See `references/openclaw-action.md` for import and test steps.

File diff suppressed because one or more lines are too long

View File

@@ -2,7 +2,7 @@
"action": "fetch_and_normalize_url",
"request_id": "test-fetch-001",
"args": {
"url": "https://example.com",
"url": "http://192.168.153.113:18808/healthz",
"max_chars": 2000
}
}

View File

@@ -60,6 +60,8 @@ Example stored record:
- fetches a remote `http` or `https` URL from inside n8n
- normalizes HTML/text/JSON into a single response shape
- returns title/excerpt/body text suitable for downstream summarization or logging
- uses n8n's runtime HTTP helper inside the Code node rather than relying on global `fetch`
- supports optional arg `skip_ssl_certificate_validation: true` for runtimes with incomplete CA trust
### `inbound_event_filter`
@@ -142,7 +144,8 @@ scripts/call-action.sh get_logs --args '{"limit":5}' --pretty
scripts/call-action.sh notify --args '{"title":"Workflow finished","message":"n8n router test"}' --pretty
scripts/call-action.sh send_email_draft --args-file assets/test-send-email-draft.json --pretty
scripts/call-action.sh create_calendar_event --args-file assets/test-create-calendar-event.json --pretty
scripts/call-action.sh fetch_and_normalize_url --args '{"url":"https://example.com"}' --pretty
scripts/call-action.sh fetch_and_normalize_url --args '{"url":"http://192.168.153.113:18808/healthz"}' --pretty
scripts/call-action.sh fetch_and_normalize_url --args '{"url":"https://example.com","skip_ssl_certificate_validation":true}' --pretty
scripts/call-action.sh approval_queue_list --args '{"limit":10,"include_history":true}' --pretty
scripts/call-action.sh inbound_event_filter --args-file assets/test-inbound-event-filter.json --pretty
```
@@ -188,9 +191,9 @@ scripts/call-action.sh inbound_event_filter --args-file assets/test-inbound-even
"result": {
"action": "fetch_and_normalize_url",
"status": "ok",
"url": "https://example.com/",
"title": "Example Domain",
"content_type": "text/html; charset=UTF-8"
"url": "http://192.168.153.113:18808/healthz",
"title": "",
"content_type": "application/json; charset=utf-8"
}
}
```

View File

@@ -232,7 +232,8 @@ Request:
"args": {
"url": "https://example.com/article",
"max_chars": 8000,
"timeout_ms": 10000
"timeout_ms": 10000,
"skip_ssl_certificate_validation": false
}
}
```
@@ -241,6 +242,11 @@ Purpose:
- fetch a URL inside n8n
- normalize content into a predictable summary-ready shape
Notes:
- `skip_ssl_certificate_validation` is optional and defaults to `false`
- set it to `true` only when you explicitly need to work around broken/missing CA trust in the n8n runtime
- for a stable local smoke test, prefer an HTTP URL you control such as the local n8n `/healthz` endpoint
Success shape includes:
- `url`
- `title`

View File

@@ -50,7 +50,6 @@ ROUTER_SNIPPETS = [
'inboundEvents',
'eventDedup',
'notify_text',
'fetch(',
]