fix: n8n 2.0 compatibility - binary data access and Accept headers#24
Merged
jaseemjaskp merged 1 commit intomainfrom Dec 24, 2025
Merged
fix: n8n 2.0 compatibility - binary data access and Accept headers#24jaseemjaskp merged 1 commit intomainfrom
jaseemjaskp merged 1 commit intomainfrom
Conversation
## Breaking Changes Fixed ### 1. Binary Data Access - Replaced deprecated `Buffer.from(binaryData.data, 'base64')` with `helpers.getBinaryDataBuffer()` - In n8n 2.0, binary data is stored in filesystem/database, not in-memory - The `.data` property no longer contains the base64 string ### 2. Accept Headers - Added explicit `Accept: application/json` headers to all HTTP requests - n8n 2.0 auto-adds `Accept: application/json,text/*;q=0.99` - Unstract/LLMWhisperer APIs require exactly `application/json` ## Issues Resolved - ✅ HTTP 406 errors in Unstract nodes - ✅ UTF-8 encoding errors in LLMWhisperer - ✅ "Cannot read properties of undefined (reading 'id')" error - ✅ Binary data access for all file upload operations ## Nodes Updated - **LLMWhisperer**: Binary data access + 3 Accept headers (POST, status, retrieve) - **Unstract**: Binary data access + 2 Accept headers (POST, status) - **UnstractHitlFetch**: 1 Accept header (GET) - **UnstractHitlPush**: Binary data access + 2 Accept headers (POST, status) ## Testing - Tested on n8n 2.0 and confirmed working - All nodes successfully process binary file uploads - No HTTP 406 or encoding errors Closes #[issue-number-if-applicable]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Problem
n8n 2.0 introduced breaking changes that caused errors in our custom nodes:
🔧 Root Causes
1. Binary Data Access Changed
In n8n 2.0, binary data is no longer stored in-memory. The old approach of accessing
binaryData.dataand converting from base64 is deprecated.Before (❌ Broken):
After (✅ Fixed):
2. Accept Header Auto-Generation
n8n 2.0 automatically adds
Accept: application/json,text/*;q=0.99which some APIs reject. Unstract/LLMWhisperer APIs require exactlyAccept: application/json.Fix: Explicitly set
Accept: application/jsonin headers to override the default.✅ Changes Made
Binary Data Access (3 nodes)
LlmWhisperer.node.ts- Updated to usegetBinaryDataBuffer()Unstract.node.ts- Updated to usegetBinaryDataBuffer()UnstractHitlPush.node.ts- Updated to usegetBinaryDataBuffer()Accept Headers (8 locations)
🧪 Testing
✅ Tested on n8n 2.0
✅ All nodes successfully process binary file uploads
✅ No HTTP 406 errors
✅ No UTF-8 encoding errors
📚 References
📝 Files Changed
nodes/LlmWhisperer/LlmWhisperer.node.tsnodes/Unstract/Unstract.node.tsnodes/UnstractHitlFetch/UnstractHitlFetch.node.tsnodes/UnstractHitlPush/UnstractHitlPush.node.ts