Bug Report: Binary Data from Code Node Cannot Be Sent via HTTP Request Node
Tags: bug critical database-mode queue-mode http-request binary-data
Environment
- n8n version: 2.6.4 (Self Hosted)
- Binary data mode:
database - Execution mode:
queue(with Redis) - Database: PostgreSQL
- Node.js version: 20.19.6
Problem Description
Binary data created in a Code node cannot be sent through an HTTP Request node when binaryDataMode=database. The HTTP Request node fails with the error:
"data should be a string, Buffer or Uint8Array"
This issue does not occur when binary data comes from other sources (Webhook, Download File, etc.) — only when created programmatically in a Code node.
Reproduction Steps
Minimal Test Workflow:
-
Manual Trigger
-
Code Node (Run Once for All Items):
const fakePdfContent = '%PDF-1.4\n...'; // Minimal valid PDF
return [{
json: { testName: 'Binary from Code Node' },
binary: {
data: {
data: Buffer.from(fakePdfContent, 'utf-8').toString('base64'),
mimeType: 'application/pdf',
fileName: 'test.pdf'
}
}
}];
-
HTTP Request Node:
- Method:
POST - URL:
https://httpbin.org/post - Body Content Type:
Multipart-Form Data - Body Parameter:
- Type:
n8n Binary File - Name:
file - Input Data Field Name:
data
- Type:
- Method:
-
Execute workflow →
Error occurs
Expected Behavior
The HTTP Request node should accept and send binary data created in a Code node, just like it does for binaries from other sources.
Actual Behavior
Error:
{
"errorMessage": "data should be a string, Buffer or Uint8Array",
"n8nDetails": {
"nodeName": "HTTP Request",
"nodeType": "n8n-nodes-base.httpRequest",
"nodeVersion": 4.4,
"n8nVersion": "2.6.4 (Self Hosted)",
"binaryDataMode": "database"
}
}
Stack trace: NodeApiError at HttpRequestV3.node.ts:864
Impact
Critical workflows are blocked:
- Cannot merge multiple PDFs using Gotenberg API
- Cannot process/transform binaries in Code then upload via HTTP
- Forces complex workarounds using
this.helpers.request()in Code nodes
Production workflows affected:
- PDF merging workflows
- Document processing pipelines
- Any workflow requiring: Code node manipulation → HTTP upload
Workaround Found
Using this.helpers.request() inside the Code node instead of the HTTP Request node works:
const response = await this.helpers.request({
method: 'POST',
uri: 'https://api.example.com/upload',
formData: {
file: dataUrl // Works with data URLs
}
});
However, this workaround:
- Only works for simple cases (single file, data URL)
Fails for complex multipart (multiple files) → Returns 403 from strict APIs- Requires rewriting all HTTP Request nodes as Code
- Loses HTTP Request node’s UI benefits
Related Issues
This appears related to known filesystem mode issues, but occurs even in database mode:
- Issue #25065 (Binary file rename errors)
- Issue #25066 (Race conditions with temp folders)
- Issue #14271 (Binary data not visible)
Question for Developers
- Is this a known bug in 2.6.4?
- Has it been fixed in 2.7+ / 2.8+ / 2.9.0?
- Is there a recommended approach for Code→HTTP workflows until fixed?
Additional Context
We’ve tested extensively and confirmed:
| Scenario | Result |
|---|---|
| Webhook → HTTP Request with binary | |
| Download File → HTTP Request with binary | |
| Code Node → HTTP Request with binary |
The bug appears to be in how the HTTP Request node handles binary references when binaryDataMode=database and the binary was created in Code.
Would appreciate any guidance or timeline for a fix. Thank you!