# Write then read failing

**URL:** <https://community.n8n.io/t/write-then-read-failing/548>\
**Category:** Questions\
**Created:** [December 18, 2019, 3:40pm UTC](https://community.n8n.io/t/write-then-read-failing/548 "2019-12-18T15:40:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [December 18, 2019, 4:04pm UTC](https://community.n8n.io/t/write-then-read-failing/548/2 "2019-12-18T16:04:38Z")

</div>

@tcurdt The read and write node work with binary data, so you gotta transform the data to binary before using them. See example below:

```
   {
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "items[0].json = { hola: 1 };\nreturn items;"
      },
      "name": "Data",
      "type": "n8n-nodes-base.function",
      "position": [
        450,
        300
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "fileName": "old.json"
      },
      "name": "Write",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        810,
        300
      ]
    },
    {
      "parameters": {
        "filePath": "old.json"
      },
      "name": "Read",
      "type": "n8n-nodes-base.readBinaryFile",
      "typeVersion": 1,
      "position": [
        980,
        300
      ]
    },
    {
      "parameters": {
        "mode": "jsonToBinary",
        "options": {}
      },
      "name": "Move Binary Data",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        630,
        300
      ]
    },
    {
      "parameters": {
        "options": {
          "keepSource": false
        }
      },
      "name": "Move Binary Data1",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        1170,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write": {
      "main": [
        [
          {
            "node": "Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read": {
      "main": [
        [
          {
            "node": "Move Binary Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "Write",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
```

---

_[View the full topic](https://community.n8n.io/t/write-then-read-failing/548)._
