N8n metrics

Does n8n provide any API to fetch workflow analytics or metrics, or is there any such feature available through the n8n MCP server?

Hi @mylearnings_abu

The n8n public REST API exposes execution data you can query programmatically . Key endpoints include:

  • GET /api/v1/executions — list executions with filters (workflow ID, status, date range)

  • GET /api/v1/executions/{id} — get details of a specific execution

  • GET /api/v1/workflows — list workflows (to cross-reference IDs)

This is the primary way to pull execution history and aggregate your own metrics (success/failure counts, run times, etc.). It’s available on both Cloud and self-hosted.

For real-time operational metrics, n8n exposes a /metrics endpoint when you enable it via environment variables :

N8N_METRICS=true
N8N_METRICS_INCLUDE_QUEUE_METRICS=true   # for queue mode

This provides gauges and counters like:

  • n8n_scaling_mode_queue_jobs_active — currently running jobs

  • n8n_scaling_mode_queue_jobs_completed — total completed since start

  • n8n_scaling_mode_queue_jobs_failed — total failed since start

:warning: The /metrics endpoint is not available on n8n Cloud — self-hosted only .

For deep per-execution tracing, n8n supports OpenTelemetry spans, which include rich attributes :

  • n8n.workflow.id, n8n.workflow.name, n8n.execution.status

  • n8n.execution.mode (manual, webhook, trigger, retry)

  • n8n.execution.error_type on failures

This feeds into observability platforms like Grafana, Jaeger, or Datadog

The MCP server tools reference includes a tool to execute a workflow by ID and retrieve the execution ID . However, the MCP server is focused on workflow execution and management (triggering, listing, managing workflows), not on pulling analytics or aggregated metrics. There is no dedicated MCP tool for fetching execution statistics or analytics data.

You may refer to below for quick reference

Does that help?

Thanks for the quick response!.

Hi @mylearnings_abu
n8n’s built-in analytics feature is Insights, and it has its own endpoint on the public API:

GET /api/v1/insights/summary?startDate=2026-07-01T00:00:00Z&endDate=2026-07-29T00:00:00Z

It returns total production executions, failed count, failure rate, time saved and average run time, each with a deviation against the previous period, plus an optional projectId filter. A scoped API key needs insights:read. Only production executions from parent workflows are counted, so manual runs and sub-workflow executions are excluded from those numbers.

Thank you @Anshul_Namdev for sharing this . Do we have any endpoint per worklfow basis?

@Anshul_Namdev cannot find this scope in my current n8n hosted setup.

You need minimum Pro subscription

@mylearnings_abu No per-workflow endpoint on the public API, /insights/summary is the only insights route and projectId is its only filter. Per-workflow numbers exist in the Insights dashboard table, not over the API.
On the scope, insights:read shipped in 2.16 and the summary endpoint in 2.17, so any instance older than that won’t list it when you create an API key. Upgrading gets you both, current stable is 2.32.6.
Since you’re self-hosted, the Prometheus endpoint gives you per-workflow numbers today, with the workflow ID label switched on:

N8N_METRICS=true
N8N_METRICS_INCLUDE_MESSAGE_EVENT_BUS_METRICS=true
N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true

I’m using n8n Enterprise Edition v2.27.4. When I try to create an API key, I don’t see any scopes related to Insights

Is there any additional configuration to be done?

Hey @mylearnings_abu

Could be due to any of these:

1)First, please update to the latest stable version of n8n.

2)If your instance has N8N_DISABLED_MODULES=insights set in your environment, the scope will not appear in the UI since the feature is off .

3)Only instance owners and admins have visibility into Insights. Verify your user role under Settings > Users.

4)Confirm your Enterprise license is properly activated. Go to Settings > Usage and Plan to verify.

You can do these:

-Navigate to the n8n UI → Insights tab (left sidebar). If you see data, the module is active and the API scope should appear when creating a new key.

-Re-create the API key after confirming the above. Existing keys may have been created before the scope was available.

Does these help?

@mylearnings_abu 2.27.4 already ships the scope, so this is the license entitlement rather than the build. The scope picker only offers insights:read when the instance’s license carries the Enterprise insights feature, and an Enterprise key issued without that entitlement won’t list it at all. Check what yours actually grants:

docker exec -u node -it <your-n8n-container-name> n8n license:info

Drop the docker exec part if you installed with npm. If insights isn’t in the entitlements it prints, the key needs re-issuing against your plan, support@n8n.io can do that.