Skip to content

Version detection broken since n8n 1.123.0 - /rest/settings no longer returns n8nVersion #488

@czlonkowski

Description

@czlonkowski

Problem

The /rest/settings endpoint no longer returns n8nVersion since n8n 1.123.0 (PR #22106). This was part of security hardening efforts leading up to n8n 2.0.

Our version detection in src/services/n8n-version.ts relies on this endpoint, causing:

  • Health check reports stale/cached version
  • Version-aware settings filtering may not work correctly on fresh connections

Current Behavior

curl https://n8n-instance.com/rest/settings

Returns only minimal public settings:

{
  "data": {
    "settingsMode": "public",
    "userManagement": {...},
    "sso": {...},
    "authCookie": {"secure": true},
    "previewMode": false,
    "enterprise": {...}
  }
}

No n8nVersion or versionCli field.

Impact

  • Low - All functionality works correctly
  • Version detection is used for:
    • Settings filtering (preventing "additional properties" errors on older n8n)
    • Health check version reporting (cosmetic)

Proposed Solutions

  1. Feature Detection (Recommended)

    • Check for n8n 2.0 specific fields (versionId, activeVersionId, versionCounter) in workflow responses
    • Infer version range based on available features
  2. Metrics Endpoint

    • Try /metrics endpoint if available (requires N8N_METRICS=true)
    • Parse version from Prometheus metrics
  3. Graceful Degradation

    • If version unknown, assume latest and let API reject unsupported fields
    • Already partially implemented

References

Files Affected

  • src/services/n8n-version.ts - Main version detection logic
  • src/services/n8n-api-client.ts - Health check uses version info

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions