Bug - Move Binary Data - Base64

Describe the issue/error/question

When I use the Move Binary Data node to encode binary data to base64 in json I receive an error. The binary files are PDF files and in my test I have 2 records with correct binary files. When I try to convert these into Base64 I received an N8N-error.

What is the error message (if any)?

ERROR: Unexpected token J in JSON at position 0

Please share the workflow

{
“nodes”: [
{
“parameters”: {
“authentication”: “oAuth2”,
“url”: “=https://eu40.salesforce.com/services/data/v53.0/sobjects/ContentVersion/{{$json[“Id”]}}/VersionData”,
“responseFormat”: “file”,
“options”: {}
},
“name”: “Get SF Documents”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
2340,
500
],
“credentials”: {
“oAuth2Api”: {
“id”: “4”,
“name”: “SalesForce HTTP”
}
}
},
{
“parameters”: {
“options”: {
“encoding”: “base64”,
“keepSource”: false
}
},
“name”: “Encode base64”,
“type”: “n8n-nodes-base.moveBinaryData”,
“typeVersion”: 1,
“position”: [
2530,
500
]
}
],
“connections”: {
“Get SF Documents”: {
“main”: [
[
{
“node”: “Encode base64”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

Share the output returned by the last node

See error.

Information on your n8n setup

  • n8n version: 0.151.0
  • Database you’re using (default: SQLite): PostgreSQL
  • Running n8n with the execution process [own(default), main]: Own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker on Google Cloud

Hi @laurens-novyx, I’m sorry to hear that.

From your screenshot it seems you are converting binary data into n8n-compatible JSON data. Does your base64 content consist of valid JSON? If not, could you try disabling the Set all Data option and see if this works?

image

2 Likes

That works. Thanks!

1 Like