n8n - ✅(Solved) Fix "Invalid URL" error when initiating workflow in n8n version above 2.13.4 (self-hosted) [1 pull requests, 2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
n8n-io/n8n#28346Fetched 2026-04-11 06:30:49
View on GitHub
Comments
2
Participants
3
Timeline
10
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2mentioned ×2subscribed ×2

Error Message

TypeError: Invalid URL at new URL (node:internal/url:819:25) at appendResumeToken (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts:20:17) at getAdditionalKeys (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts:36:15) at ExecuteContext.get additionalKeys (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:420:27) at ExecuteContext.Memoized.descriptor.get (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+decorators@file+packages+@n8n+decorators/node_modules/@n8n/decorators/src/memoized.ts:29:32) at ExecuteContext.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:458:11) at ExecuteContext.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/execute-context.ts:136:9) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Notion/v2/NotionV2.node.ts:50:25) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:31) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1224:22)

Fix Action

Fix / Workaround

  1. Run existing workflow created in version 2.13.4 (self-hosted) or lower.
  2. Upgrade to version 2.14.2 or greater.
  3. Run any workflow.
  4. First node errors with "Invalid URL", stack trace:

PR fix notes

PR #28347: Fix :"Invalid URL" error in workflow execution when base URLs are undefined

Description (problem / solution / changelog)

Summary

Fixes a regression introduced in versions >2.13.4 where workflows fail at the first node with a TypeError: Invalid URL error when base URLs are undefined.

<!-- Describe what the PR does and how to test. Photos and videos are recommended. -->

The issue occurred due to unsafe URL construction in multiple places. When webhookWaitingBaseUrl or formWaitingBaseUrl were undefined or empty, the code generated invalid URLs like:

undefined/<executionId>

This caused the new URL() constructor to throw an exception, preventing workflow execution.

Related Linear tickets, Github issues, and Community forum posts

<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/[GHC-7685] --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->

fixes the issue #28346

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
  • Docs updated or follow-up ticket created.
  • Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

Changed files

  • packages/cli/src/webhooks/webhook-helpers.ts (modified, +14/-8)
  • packages/core/src/execution-engine/node-execution-context/node-execution-context.ts (modified, +4/-0)
  • packages/core/src/execution-engine/node-execution-context/utils/__tests__/get-additional-keys.test.ts (modified, +48/-0)
  • packages/core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts (modified, +16/-5)

Code Example

TypeError: Invalid URL at new URL (node:internal/url:819:25) at appendResumeToken (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts:20:17) at getAdditionalKeys (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts:36:15) at ExecuteContext.get additionalKeys (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:420:27) at ExecuteContext.Memoized.descriptor.get (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+decorators@file+packages+@n8n+decorators/node_modules/@n8n/decorators/src/memoized.ts:29:32) at ExecuteContext._getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:458:11) at ExecuteContext.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/execute-context.ts:136:9) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Notion/v2/NotionV2.node.ts:50:25) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:31) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1224:22)
RAW_BUFFERClick to expand / collapse

Bug Description

When upgrading to any n8n version above 2.13.4 (i.e. this does work on that version but not any higher), no workflow succeeds past the first node. First node shows error "Invalid URL" (see "To Reproduce for stack trace").

To Reproduce

  1. Run existing workflow created in version 2.13.4 (self-hosted) or lower.
  2. Upgrade to version 2.14.2 or greater.
  3. Run any workflow.
  4. First node errors with "Invalid URL", stack trace:
TypeError: Invalid URL at new URL (node:internal/url:819:25) at appendResumeToken (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts:20:17) at getAdditionalKeys (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/utils/get-additional-keys.ts:36:15) at ExecuteContext.get additionalKeys (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:420:27) at ExecuteContext.Memoized.descriptor.get (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/@n8n+decorators@file+packages+@n8n+decorators/node_modules/@n8n/decorators/src/memoized.ts:29:32) at ExecuteContext._getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/node-execution-context.ts:458:11) at ExecuteContext.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/node-execution-context/execute-context.ts:136:9) at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Notion/v2/NotionV2.node.ts:50:25) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:31) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2d19a9be2839cb42cd2e8c9cacd05d5a/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1224:22)

Expected behavior

Expected workflows to continue to execute as in v2.13.4 and below.

Debug Info

Debug info

core

  • n8nVersion: 2.15.1
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.13.1
  • nodeEnv: production
  • database: postgres
  • executionMode: regular
  • concurrency: -1
  • license: enterprise (production)
  • consumerId: 23c9cdf5-91ac-4d76-b346-d098862168a9

storage

  • success: all
  • error: all
  • progress: false
  • manual: true
  • binaryMode: filesystem

pruning

  • enabled: true
  • maxAge: 336 hours
  • maxCount: 10000 executions

client

  • userAgent: mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/605.1.15 (khtml, like gecko) version/26.0 safari/605.1.15
  • isTouchDevice: false

Generated at: 2026-04-10T17:27:26.952Z

Operating System

Docker

n8n Version

2.15.1

Node.js Version

24.13.1

Database

PostgreSQL

Execution mode

main (default)

Hosting

self hosted

extent analysis

TL;DR

Downgrade to n8n version 2.13.4 to resolve the "Invalid URL" error that occurs when running workflows in versions above 2.13.4.

Guidance

  • Verify that the issue is specific to n8n versions above 2.13.4 by testing workflows in different versions.
  • Check the getAdditionalKeys function in get-additional-keys.ts for any changes that might be causing the "Invalid URL" error.
  • Inspect the URL being passed to the new URL constructor to ensure it is valid and properly formatted.
  • Consider reaching out to the n8n community or support team for further assistance, as this issue may be related to a specific change or bug in the newer versions.

Notes

The provided stack trace suggests that the issue is related to the getAdditionalKeys function, but without more information about the changes made in versions above 2.13.4, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Downgrade to n8n version 2.13.4, as this version is known to work correctly. This will allow workflows to execute successfully until a more permanent solution can be found.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Expected workflows to continue to execute as in v2.13.4 and below.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING