n8n automation stuck in running state with file corruption issues

I’m running n8n in a Docker container on my local machine. I have a basic automation that handles file uploads through a webhook and saves them using a file writer node. The file writer saves to a mounted directory that connects to my host system.

Everything was working fine until I made some changes to install an image processing library. Now when the webhook gets triggered, the execution never completes and shows as “running…” forever in the n8n interface. The API call that triggers it returns a 500 error.

The weird part is that files do get created in the target folder, but they’re corrupted and can’t be opened as images. The logs show an error about moving files from the temp directory to the final location, but the execution directory does exist with the binary file in it.

I’m stuck and not sure how to debug this further. I could rebuild everything from scratch but I’ve made lots of custom changes that would be hard to recreate.

Here’s my workflow setup:

{
  "name": "save-photo-upload",
  "nodes": [
    {
      "parameters": {},
      "name": "Trigger",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [150, 300],
      "id": "start-node-123"
    },
    {
      "parameters": {
        "fileName": "=/uploads/photos/{{ $json.query.imagename }}.png",
        "dataPropertyName": "=filedata",
        "options": {}
      },
      "name": "Save File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [800, 300],
      "id": "file-saver-456"
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "httpMethod": "POST",
        "path": "photo-upload-endpoint",
        "responseMode": "lastNode",
        "options": {}
      },
      "name": "Upload Handler",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [400, 300],
      "webhookId": "upload-webhook-789",
      "id": "webhook-handler-101"
    }
  ],
  "connections": {
    "Upload Handler": {
      "main": [[
        {
          "node": "Save File",
          "type": "main",
          "index": 0
        }
      ]]
    }
  },
  "active": true
}

Any ideas what could be causing this or how to troubleshoot it better?

I’ve hit this exact issue before - usually happens when Docker runs out of disk space or memory while processing files. Those corrupted files are a dead giveaway that the container got killed mid-write. Run docker stats while your workflow’s running to check resource usage. Also double-check your mounted volume path - installing that image processing library might’ve messed with your Docker setup and changed the mount point. Quick test: throw a debug node before your file writer to log the actual filesystem paths it’s using.

Been dealing with this crap for years. n8n’s Docker setup gets super finicky once you start adding custom libraries.

Your corrupted files and hanging executions? That’s container instability. Installing that image processing library probably messed up dependencies that are now fighting with n8n’s file handling.

Don’t rebuild your complex setup - migrate to Latenode instead. You can recreate the same webhook file upload workflow without any Docker headaches. The platform handles all the infrastructure automatically.

I moved a similar image processing workflow from n8n to Latenode last month. No more container management, no permission issues, file handling just works. Better debugging tools too so you can see exactly where things break.

Migration’s pretty straightforward. Keep your webhook endpoint structure and the file processing logic stays the same.

Check your temp directory size in the container - image processing libs often bloat temp files massively during install. Corrupted files + hanging usually means the temp space filled up mid-process. Try docker exec -it <container> df -h to see disk usage inside.

sounds like a permission issue. did u change user context when installing the image lib or rebuild the container? when temp → final directory moves fail, it’s usually because docker can’t write to your mounted volume. check if the container user still has write permissions on the host folder.

The hanging plus successful file creation but corruption screams that your new image processing library is messing with n8n’s binary data handling. Installing that library probably changed how Python or Node deals with memory buffers during file ops. I’d revert your Docker image to before you added the library, then reinstall it in a separate container or virtual environment instead of dumping it directly into the n8n container. This keeps the dependencies isolated. Also double-check your workflow’s binary data property name - you’re using filedata but the webhook might be sending it as data or file instead. Throw in a temp node to dump the incoming webhook payload structure and make sure the binary data’s being read properly before it hits your file writer.