43 lines
4.4 KiB
Markdown
43 lines
4.4 KiB
Markdown
# 2026-03-12
|
|
|
|
## n8n local documentation fix
|
|
- Documented the local `n8n-agent` service in `TOOLS.md` after noticing it had been set up but not captured in workspace notes.
|
|
- Recorded current known service details from prior host/runtime evidence:
|
|
- port `18808 -> 5678`
|
|
- LAN/Tailscale URLs
|
|
- dedicated agent-oriented n8n instance
|
|
- `openclaw-ping` webhook path tested end-to-end
|
|
- Operating note: prefer narrow webhook-first integration rather than broad n8n admin/API access.
|
|
- Will clarified the primary host LAN IP to use/document is `192.168.153.113`.
|
|
- Finished local skill `skills/n8n-webhook` for authenticated webhook-first n8n integration, including `scripts/call-webhook.sh`, `scripts/call-action.sh`, `scripts/validate-workflow.py`, an importable `assets/openclaw-action.workflow.json`, sample payloads, payload notes, and a successful package/validation run to `/tmp/n8n-skill-dist/n8n-webhook.skill`.
|
|
- The shipped `openclaw-action` workflow intentionally leaves Webhook authentication unset in export JSON; after import, bind local n8n Header Auth credentials manually using `x-openclaw-secret` so secrets are not embedded in the skill asset.
|
|
- Live n8n API access was confirmed and used on 2026-03-12 against `http://192.168.153.113:18808` (public API + existing webhook credential available in the instance).
|
|
- Created and activated live workflow `openclaw-action` via the n8n API.
|
|
- First live implementation matched the original asset shape (`Webhook -> Set -> Switch -> Respond`) but failed at runtime: executions errored in the `normalize-request` Set node with `invalid syntax` on its expressions.
|
|
- Fix: replaced the live router logic and shipped asset implementation with a simpler, working internal design: `Webhook -> Code -> Respond to Webhook`, while preserving the external contract (`append_log`, `notify`, normalized JSON success/failure responses).
|
|
- Important operational note: the workflow initially activated without a usable production route because the Webhook node lacked a `webhookId`; adding one and re-publishing was necessary for proper webhook registration.
|
|
- Current state before compaction: the live `openclaw-action` workflow exists in n8n, is active, and has been updated to the simpler Code-node implementation; post-update live response testing was still in progress at compaction time.
|
|
- After compaction, live verification succeeded against the production webhook:
|
|
- `append_log` returned `200` with normalized JSON success payload
|
|
- `notify` returned `200` with normalized JSON success payload
|
|
- unknown action returned `400` with `{ code: "unknown_action" }`
|
|
- The packaged skill artifact was refreshed after the router simplification at `/tmp/n8n-skill-dist/n8n-webhook.skill`.
|
|
- Follow-up implementation for real side effects:
|
|
- `notify` was successfully wired to the existing Telegram + Discord credentials and verified live multiple times.
|
|
- `append_log` hit two dead ends before settling on the clean solution:
|
|
1. `Execute Command` node was unavailable in this n8n build (`Unrecognized node type: n8n-nodes-base.executeCommand`).
|
|
2. `Read/Write Files from Disk` was available, but candidate paths were either missing or not writable in this container/runtime.
|
|
- Final fix: switched `append_log` to use n8n workflow static data (`$getWorkflowStaticData('global')`) under key `actionLog`, capped to the latest 200 entries.
|
|
- Verified persisted state via the n8n API: `staticData.global.actionLog` contains the live test record for request `live-log-003`.
|
|
- Conclusion: for small recent operational breadcrumbs, workflow static data is the right sink here; MinIO is better reserved for later archival/rotation/export use cases rather than tiny per-event appends.
|
|
- Added action `get_logs` to the live `openclaw-action` workflow and local `n8n-webhook` skill.
|
|
- `get_logs` reads from workflow static data key `actionLog`
|
|
- default limit `20`, clamped to `1..50`, newest-first
|
|
- verified live with request `live-getlogs-001` returning the seed record from `live-log-004`
|
|
- Re-verified the three live actions together after the update:
|
|
- `append_log` → success
|
|
- `get_logs` → success
|
|
- `notify` → success
|
|
- Refreshed packaged skill artifact again at `/tmp/n8n-skill-dist/n8n-webhook.skill`.
|
|
- Will clarified a standing operating preference: treat local n8n as an assistant tool to use proactively when appropriate, not as something needing separate approval each time.
|