Hi community, I’m using an HTTP Request node to post a base64 encoded document to Google Document AI (process endpoint) coming from an n8n Form Trigger.
Error Received:Bad request - please check your parameters: Invalid value at 'raw_document.content' {TYPE_BYTES}, Base64 decoding failed for "={{ $binary... }}"
How can I properly pass the Base64 binary string from a Form trigger directly into the raw JSON body without n8n treating the expression as a literal string or returning undefined?
Hi @Samir_Dioua Welcome!
The error quotes your expression back verbatim, so the JSON body field is still in fixed mode and the = prefixes are going out as literal text. That = is the marker n8n writes internally once a field is switched to an expression, typing it into a fixed field does not switch it.
The binary also needs its own step. On n8n 2.x binary data lives in the filesystem or the database rather than inside the item, so $binary.<key>.data is a reference rather than the base64 string. Put an Extract from File node between the form trigger and the HTTP Request, set Operation to “Move File to Base64 String”, Input Binary Field to Upload_Identity_Document__CNIE__Residence_Permit__or_Passport_, and Destination Output Field to data.
Then switch the HTTP Request JSON body itself to expression mode and drop the inner = signs: