n8n - 💡(How to fix) Fix HTTP Request node fires per-item requests concurrently

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…

Error Message

{ "errorMessage": "Authorization failed - please check your credentials [item 4]", "errorDescription": "invalid credentials", "errorDetails": { "rawErrorMessage": [ "401 - "{\n \"error\": \"invalid credentials\"\n}"" ], "httpCode": "401" }, "n8nDetails": { "nodeName": "Sanitized", "nodeType": "n8n-nodes-base.httpRequest", "nodeVersion": 4.2, "itemIndex": 4, "time": "5/18/2026, 11:00:11 AM", "n8nVersion": "2.21.3 (Self Hosted)", "binaryDataMode": "database", "stackTrace": [ "NodeApiError: Authorization failed - please check your credentials", " 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/HttpRequest/V3/HttpRequestV3.node.ts:843:16)", " at processTicksAndRejections (node:internal/process/task_queues:104:5)", " at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1048:9)", " at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1239:11)", " at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1687:27", " at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2339:11" ] } }

Root Cause

Root cause (file and lines)

IMPORTANT NOTE: This section describes code analyzed using Claude Opus 4.7: xhigh thinking

Fix Action

Fix / Workaround

Only concurrent vs sequential dispatch changes the outcome. Credential, token, URL value, endpoint, rate limiting and the URL expression are all ruled out.

Workaround used (manually figured this out, confirming it works!)

  • Node, Options, Batching: Items per Batch = 1, Batch Interval (ms) = 200. With batch size 1.

Code Example

const batchSize = batching?.batch?.batchSize > 0 ? batching?.batch?.batchSize : 1;
const batchInterval = batching?.batch.batchInterval;
if (itemIndex > 0 && batchSize >= 0 && batchInterval > 0) {
  if (itemIndex % batchSize === 0) {
    await sleep(batchInterval);
  }
}

---

{
  "errorMessage": "Authorization failed - please check your credentials [item 4]",
  "errorDescription": "invalid credentials",
  "errorDetails": {
    "rawErrorMessage": [
      "401 - \"{\\n  \\\"error\\\": \\\"invalid credentials\\\"\\n}\""
    ],
    "httpCode": "401"
  },
  "n8nDetails": {
    "nodeName": "Sanitized",
    "nodeType": "n8n-nodes-base.httpRequest",
    "nodeVersion": 4.2,
    "itemIndex": 4,
    "time": "5/18/2026, 11:00:11 AM",
    "n8nVersion": "2.21.3 (Self Hosted)",
    "binaryDataMode": "database",
    "stackTrace": [
      "NodeApiError: Authorization failed - please check your credentials",
      "    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/HttpRequest/V3/HttpRequestV3.node.ts:843:16)",
      "    at processTicksAndRejections (node:internal/process/task_queues:104:5)",
      "    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1048:9)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1239:11)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1687:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2339:11"
    ]
  }
}

---

{
  "errorMessage": "Authorization failed - please check your credentials [item 5]",
  "errorDetails": { "httpCode": "401", "rawErrorMessage": ["401 - {\"message\":\"unauthorized\"}"] },
  "node": { "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "itemIndex": 5 },
  "n8nVersion": "2.21.3",
  "stackTrace": [
    "NodeApiError: Authorization failed - please check your credentials",
    "    at ExecuteContext.execute (.../n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:843:16)"
  ]
}

---

{
  "nodes": [
    {
      "parameters": {
        "url": "=https://api.example.com{{ $json }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "name": "HTTP Request",
      "credentials": { "httpHeaderAuth": { "name": "My Header Auth" } }
    }
  ],
  "connections": {}
}

---

[
  "/items/1001","/items/1002","/items/1003","/items/1004","/items/1005",
  "/items/1006","/items/1007","/items/1008","/items/1009","/items/1010"
]
RAW_BUFFERClick to expand / collapse

Describe the problem/error/question

Summary: An HTTP Request node (typeVersion 4.2) set to run once per item over an input array, using Authentication = Generic Credential Type (with Header Auth), starts every per-item request and runs them all concurrently.

There is no per-item serialization, and the Batching option only pauses at item indices that are exact multiples of "Items per Batch" (default 50), so a run with fewer items than that gets full concurrency, and zero throttling at all when Batching is not added.

Against an endpoint that authenticates via a header credential and is sensitive to many simultaneous identical auth requests, this produces an intermittent HTTP 401 at a random/different item index while other items in the same run succeed. NOTE: identical requests sent sequentially always succeed.

Isolation (and troubleshooting steps I took)

  • Execute Once = ON (only item 0 runs): always 200.
  • Fully static URL, no input array, single request: always 200.
  • 10 manual identical requests in a sequential bash shell loop (using curl): all 200, sub-second.
  • Same node, per-item over the array (concurrent): intermittent 401 at a varying item index.

Only concurrent vs sequential dispatch changes the outcome. Credential, token, URL value, endpoint, rate limiting and the URL expression are all ruled out.

Root cause (file and lines)

IMPORTANT NOTE: This section describes code analyzed using Claude Opus 4.7: xhigh thinking

packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts at tag [email protected] (empty diff vs [email protected], so not a recent node regression):

  • L176 loop over items. L192 httpHeaderAuth = await this.getCredentials('httpHeaderAuth', itemIndex); L559-561 inject the header per item.
  • L324-330, the only throttle:
const batchSize = batching?.batch?.batchSize > 0 ? batching?.batch?.batchSize : 1;
const batchInterval = batching?.batch.batchInterval;
if (itemIndex > 0 && batchSize >= 0 && batchInterval > 0) {
  if (itemIndex % batchSize === 0) {
    await sleep(batchInterval);
  }
}

If Batching is not configured, batchInterval is undefined so the guard is false and there is no delay. With Batching added, defaults are Items per Batch 50 and Batch Interval 1000 ms (V3/Description.ts ~L704-724); the sleep only runs when itemIndex % batchSize === 0, so a run with fewer than 50 items never sleeps.

  • L756 each request is started immediately inside the loop. L785 all are awaited together with Promise.allSettled.
  • L826 the node already says, on 429, "Try spacing your requests out using the batching settings under 'Options'".
  • L843 throw site of the wrapped NodeApiError.

Suggested fix

(As analyzed by Claude Opus 4.7: xhigh thinking)

Offer a real per-item sequential mode (await each request before starting the next), or make Items per Batch = 1 with any positive interval serialize reliably, instead of only sleeping at exact multiples of batchSize.

Workaround used (manually figured this out, confirming it works!)

  • Node, Options, Batching: Items per Batch = 1, Batch Interval (ms) = 200. With batch size 1.

Steps to reproduce (example values)

NOTE: Sanitized to remove sensitive information using Claude Opus 4.7 xhigh thinking

  1. Any endpoint returning 200 with a valid header credential and 401 without, e.g. https://api.example.com/items/{id} authorized by header X-API-Key: EXAMPLE_TOKEN.
  2. Header Auth credential: Name X-API-Key, Value EXAMPLE_TOKEN.
  3. A node emitting 10 items, each a path string /items/1001 through /items/1010.
  4. HTTP Request node, typeVersion 4.2: Method GET, URL =https://api.example.com{{ $json }} (a static https://api.example.com/items/1001 reproduces identically), Authentication = Generic Credential Type, Generic Auth Type = Header Auth, Execute Once OFF, Batching not added.
  5. Execute. Intermittent 401 at a varying item index; other items in the same run return 200. A request bin shows the requests opening simultaneously.

Exact error message

{
  "errorMessage": "Authorization failed - please check your credentials [item 4]",
  "errorDescription": "invalid credentials",
  "errorDetails": {
    "rawErrorMessage": [
      "401 - \"{\\n  \\\"error\\\": \\\"invalid credentials\\\"\\n}\""
    ],
    "httpCode": "401"
  },
  "n8nDetails": {
    "nodeName": "Sanitized",
    "nodeType": "n8n-nodes-base.httpRequest",
    "nodeVersion": 4.2,
    "itemIndex": 4,
    "time": "5/18/2026, 11:00:11 AM",
    "n8nVersion": "2.21.3 (Self Hosted)",
    "binaryDataMode": "database",
    "stackTrace": [
      "NodeApiError: Authorization failed - please check your credentials",
      "    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/HttpRequest/V3/HttpRequestV3.node.ts:843:16)",
      "    at processTicksAndRejections (node:internal/process/task_queues:104:5)",
      "    at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1048:9)",
      "    at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1239:11)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1687:27",
      "    at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@opentelemetry+exporter-trace-otlp_2c2e1f47b69b34bef6f634a13cbf61d9/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2339:11"
    ]
  }
}

Screenshot

<img width="2647" height="829" alt="Image" src="https://github.com/user-attachments/assets/cb70f4c7-9603-477e-8f2b-392ad7b034e5" />

NOTE: Items below this were also generated/sanitized using Claude Opus 4.7: xhigh thinking


Steps to reproduce (example values)

  1. Any endpoint returning 200 with a valid header credential and 401 without, e.g. https://api.example.com/items/{id} authorized by header X-API-Key: EXAMPLE_TOKEN.
  2. Header Auth credential: Name X-API-Key, Value EXAMPLE_TOKEN.
  3. A node emitting 10 items, each a path string /items/1001 through /items/1010.
  4. HTTP Request node, typeVersion 4.2: Method GET, URL =https://api.example.com{{ $json }} (a static https://api.example.com/items/1001 reproduces identically), Authentication = Generic Credential Type, Generic Auth Type = Header Auth, Execute Once OFF, Batching not added.
  5. Execute. Intermittent 401 at a varying item index; other items in the same run return 200. A request bin shows the requests opening simultaneously.

What is the error message (if any)?

{
  "errorMessage": "Authorization failed - please check your credentials [item 5]",
  "errorDetails": { "httpCode": "401", "rawErrorMessage": ["401 - {\"message\":\"unauthorized\"}"] },
  "node": { "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "itemIndex": 5 },
  "n8nVersion": "2.21.3",
  "stackTrace": [
    "NodeApiError: Authorization failed - please check your credentials",
    "    at ExecuteContext.execute (.../n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:843:16)"
  ]
}

The failing itemIndex is nondeterministic and varies between runs.

Please share your workflow/screenshots/recording

Sanitized failing node (ids, positions and instance id intentionally stripped; reproduces identically with a fully static URL, so the expression is not the cause):

{
  "nodes": [
    {
      "parameters": {
        "url": "=https://api.example.com{{ $json }}",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "name": "HTTP Request",
      "credentials": { "httpHeaderAuth": { "name": "My Header Auth" } }
    }
  ],
  "connections": {}
}

Input feeding the node (10 items, each item value is a path string):

[
  "/items/1001","/items/1002","/items/1003","/items/1004","/items/1005",
  "/items/1006","/items/1007","/items/1008","/items/1009","/items/1010"
]

Debug info

core

  • n8nVersion: 2.21.3
  • platform: docker (self-hosted)
  • nodeJsVersion: 24.14.1
  • nodeEnv: production
  • database: postgres
  • executionMode: regular
  • concurrency: -1

storage

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

pruning

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

client

  • userAgent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) chrome/148.0.0.0 safari/537.36
  • isTouchDevice: false

cluster

  • instanceCount: 1
  • versions: 2.21.3
  • checks:
    • check: hostid-clash, status: succeeded, warnings: -
    • check: lifecycle, status: succeeded, warnings: -
    • check: split-brain, status: succeeded, warnings: -
    • check: version-mismatch, status: succeeded, warnings: -

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

n8n - 💡(How to fix) Fix HTTP Request node fires per-item requests concurrently