I can't Read/Write files from Disk due to "Operation not permitted, make sure you have the right permissions"

{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
0,
0
],
“id”: “50875965-331d-4931-b9ef-5ae7bfa9fb32”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“url”: “https://jsonplaceholder.typicode.com/users/1”,
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
260,
0
],
“id”: “e74fc2e2-1687-445b-a5b9-89a5b7aba304”,
“name”: “HTTP Request”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “b4a205f5-3147-4935-a134-87c63fe91935”,
“name”: “id”,
“value”: “={{ $json.id }}”,
“type”: “number”
},
{
“id”: “6e58c6a9-81ae-4dbf-b59e-084d7c8aa73a”,
“name”: “name”,
“value”: “={{ $json.name }}”,
“type”: “string”
},
{
“id”: “c5140c5f-f7f6-4e83-b6f7-225020028350”,
“name”: “username”,
“value”: “={{ $json.username }}”,
“type”: “string”
},
{
“id”: “8ad07055-a57b-424a-8e4d-afe3fb212d1c”,
“name”: “email”,
“value”: “={{ $json.email }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
480,
0
],
“id”: “0cd6234e-3aab-4921-8ae7-cc6a1eb70f7c”,
“name”: “Edit Fields”
},
{
“parameters”: {
“operation”: “toJson”,
“options”: {}
},
“type”: “n8n-nodes-base.convertToFile”,
“typeVersion”: 1.1,
“position”: [
700,
0
],
“id”: “15ee0b47-8ee5-4f8a-9c15-20ea28eb3ff4”,
“name”: “Convert to File”
},
{
“parameters”: {
“operation”: “write”,
“fileName”: “C:\data.json”,
“options”: {}
},
“type”: “n8n-nodes-base.readWriteFile”,
“typeVersion”: 1,
“position”: [
920,
0
],
“id”: “77c2604a-8974-4384-b98e-57e3a5da0661”,
“name”: “Read/Write Files from Disk”
}
],
“connections”: {
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Convert to File”,
“type”: “main”,
“index”: 0
}
]
]
},
“Convert to File”: {
“main”: [
[
{
“node”: “Read/Write Files from Disk”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“instanceId”: “a42b2f327676de323c86e857d78149f0fcf2284753e34f1488cb2eece96afc29”
}
}

Please share your workflow properly within a code block
image

However looking at the error, this is probably a disk permission issue. You’ll need to make sure you have write permission to the folder you’re trying to write to on your host machine.

On linux:
https://www.perplexity.ai/search/how-to-set-write-permission-to-ZZrHGqnIR56pWxYndmagqQ

1 Like

How do you start n8n?
Do the user that runs the n8n application do have the correct access permissions on the directory.
If you run n8n in docker. You can not use a path from windows inside a docker container. You have to create or mount directories (Volumes | Docker Docs).

1 Like

Good point. @Chanawee_Jirapong can you please provide us with more info on how you have n8n setup.

  • n8n cloud?
  • self-hosted via npm?
  • self-hosted via docker?
  • Windows?
  • Linux?
  • Mac OS?