How to get installed n8n version programmatically on self-hosted instance?

Hello everyone,

I am building a version monitoring workflow on a self-hosted n8n CE instance.

The goal is simple: compare the currently installed n8n version against the latest published version on npm, and alert if they don’t match.

I have checked the public API docs at /api/v1/docs/ and there is no version or instance info endpoint. I have also tried several obvious paths — all return 404.

A older community post mentions /rest/settings as a potential source. This also returns 404 on my instance.

Question: What is the correct way to get the installed n8n version programmatically on a self-hosted CE instance? Ideally via HTTP so it can be called from within an n8n HTTP Request node.

If no API endpoint exists, then I am considering:

  1. Execute Command node running n8n --version

  2. Execute Command node running npm list -g n8n --depth=0

Are either of these reliable on a self-hosted instance? Is there a better approach?

Thanks,
Varun

Hi @VarunM !

We currently don’t expose the version of the n8n instance by default to enhance security.

You have a couple of options here:

  1. You can enable metrics, and then query yourinstance/metrics. There should be a field n8n_version_info containing the information you need.
  2. The /rest/settings endpoint provides the version information for authenticated users. So you could create a custom workflow that authenticates to your instance, and then queries the endpoint
  3. If your underlying system has n8n installed via npm install -g n8n as your post implies, you can run n8n –version to get the current version of the binary. Do note, that Execute Command nodes are disabled by default starting from version 2.0 .

You can find the latest stable version of n8n in npm through https://registry.npmjs.org/n8n/latest

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.