--- title: n8n description: How ClawMetry observes n8n — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # n8n n8n is the largest open-source workflow automation platform, and its LangChain-based AI Agent nodes make it an agent runtime. ClawMetry reads the self-hosted SQLite store; Postgres and n8n Cloud installs have no local file and should use n8n's native OpenTelemetry export into ClawMetry's OTLP receiver instead. | | | |---|---| | **Runtime id** | `n8n` | | **Category** | Workflow automation with AI agent nodes | | **Vendor** | n8n | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [github.com/n8n-io/n8n](https://github.com/n8n-io/n8n) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `$N8N_USER_FOLDER/.n8n/database.sqlite` - `~/.n8n/database.sqlite` — default **Format.** SQLite `execution_entity` and `execution_data`. A session is one execution; events are the per-node runs inside `resultData.runData`. ## Environment variables | Variable | Effect | |---|---| | `CLAWMETRY_N8N_DB` | point at a specific database | | `N8N_USER_FOLDER` | n8n's own relocation env | | `CLAWMETRY_N8N_URL` | n8n REST base URL, for installs without a local file | | `CLAWMETRY_N8N_API_KEY` | API key for that REST path | | `CLAWMETRY_N8N_MAX_DATA_BYTES` | cap on how much run data is decoded | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Real, but only on the chat-model **sub-node's** run output — never on the Agent node itself. ClawMetry scans every `ai_languageModel` run for the usage keys. **Cost.** Derived; n8n never stores cost. No decoded usage means cost is unknown rather than zero. :::note Why this section exists Runtimes differ enormously in what they persist. Rather than showing a plausible number everywhere, ClawMetry reports what the store actually contains and marks the rest unknown. A cost of `$0.00` and a cost of *unknown* mean different things, and the dashboard keeps them different. ::: ## Things worth knowing - `execution_data.data` is serialised with the `flatted` library — a pointer-array format. Plain `json.loads` of the inner structure yields pointer strings, not values. Never parse it naively. - n8n runs SQLite in WAL mode and the `-wal` sidecar is often larger than the database. An `immutable=1` open silently misses recent executions. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="n8n")' # Why is it locked, if it is? clawmetry runtimes --why n8n # Any sessions ingested yet? curl -s 'http://localhost:8900/api/local/sessions?limit=5' \ | jq '.rows[] | {session_id, agent_id, events, cost_usd}' ``` If detection succeeds but no sessions appear, work through [Troubleshooting](/docs/ops/troubleshooting/) — the usual causes are a relocated data directory (set the override above), a session limit that is hiding older runs, or a runtime that simply has not written anything yet.