Observability
The Workflow execution page followed one execution to its end. Several parts of n8n want to know when an execution ends, or when a user publishes a workflow.
This page explains how one event reaches all of them, how telemetry works, and which metrics, logs, and traces a process gives you.
Events
Services emit events through EventService. They do not know who listens. Relays listen and pass each event to a consumer:
| Consumer | Receives |
|---|---|
| Log streaming | Events for external log destinations of the customer |
| Telemetry | Usage events for PostHog and RudderStack |
| Activity log | Recent changes to workflows and credentials, for features that read recent activity (e.g. the n8n Assistant) |
| Failure email | The first failure of a production workflow on the instance |
To add an event, add its payload type to RelayEventMap, emit it, and handle it in the relays that need it.
The event bus behind log streaming is also a recovery log. Each process writes each event to a file before it sends the event on. At startup, the process uses this file to recover the executions that have no final event.
Telemetry
Telemetry shows the product team how people use n8n. The backend sends telemetry events from the telemetry relay, or with a Telemetry.track() call.
@n8n/ holds a registry of events, with a schema of the properties of each event. Pass the registry entry to track(), so that a wrong property fails the typecheck. A backend event without user_id reaches RudderStack, but PostHog drops it. The n8n:telemetry skill explains how to add an event.
To see the events of a local instance, run pnpm telemetry:sink, and start the backend with pnpm dev:be:telemetry.
Metrics, logs, traces
- Metrics: With
N8N_METRICS=true, each process serves Prometheus metrics at/. To add a metric, add a collector. Do not label a metric with workflow or instance IDs, because each new label value creates a new time series.metrics - Logs: Add a scope for your service to
LOG_SCOPES, and give its logger that scope. At debug level,N8N_LOG_SCOPESthen shows only the lines of the scopes that it names. - Traces: The
otelmodule sends OpenTelemetry traces of workflow and node executions. SetN8N_OTEL_ENABLED=trueto send them.
Roll out a backend change shows how to use these signals during a rollout.
Quiz
- You rename the event
n8n.workflow.success. Who notices?Customers filter their log destinations on these names.
- A telemetry event that already shipped has a name with a typo. What do you do?
The data warehouse keeps one table for each event name, so a rename cuts the history of the event.
- You set
N8N_LOG_LEVEL=debugandN8N_LOG_SCOPES, and see none of the lines of your service. What is a likely cause?At debug level,
N8N_LOG_SCOPESshows only the lines of the scopes that it names.