n8n · troubleshooting · reproduced on n8n 2.41.5 + nginx 1.31.3, 1 October 2026 (first run: n8n 2.41.3, 30 September 2026)
n8n 413 Request Entity Too Large
A “413 Request Entity Too Large” in front of n8n comes from one of two places, and they need different settings. If nginx sits in front of n8n, its client_max_body_size defaults to 1 MB. n8n’s own limit is N8N_PAYLOAD_SIZE_MAX, 16 MiB by default. There is a trap: when n8n’s own limit is hit on a webhook, the caller does not get a 413 at all. On n8n 2.41.5 it got an HTTP 500 saying “There was a problem executing the workflow”, and the 413 only appeared in the server log.
Which layer refused the request
| Layer | What the caller sees | Limit | Fix |
|---|---|---|---|
| nginx in front of n8n | HTTP 413 with an HTML page titled “413 Request Entity Too Large” and the nginx version at the bottom. n8n never sees the request and logs nothing. | client_max_body_size, default 1m | Raise client_max_body_size in the server or location block that proxies to n8n |
| n8n REST API (editor, /rest/…) | HTTP 413 with the body <pre>Payload Too Large</pre> | N8N_PAYLOAD_SIZE_MAX, default 16 (MiB) | Set N8N_PAYLOAD_SIZE_MAX higher and restart n8n |
| n8n webhook (/webhook/…) | HTTP 500 {"code":0,"message":"There was a problem executing the workflow"}. The log says PayloadTooLargeError: request entity too large | N8N_PAYLOAD_SIZE_MAX, default 16 (MiB) | Same variable, and restart. For big files, send multipart form-data instead: N8N_FORMDATA_FILE_SIZE_MAX, default 200 (MiB) |
All three rows were produced on n8n 2.41.5 on 1 October 2026, installed from npm on Node 24 and started with NODE_ENV=production, the same value the official image sets. The n8n rows match our first run on n8n 2.41.3 on 30 September 2026 exactly. We sent the same 17 MiB JSON body to a Webhook node and to /rest/login. For the nginx row, nginx 1.31.3 sat in front of the same instance with no client_max_body_size set, so its default of 1m applied, as the nginx docs state.
What n8n actually did with a 17 MiB body
A Webhook node set to respond immediately, and a 17 MiB JSON body, one mebibyte over the default:
$ curl -s -w ' %{http_code}' -H 'Content-Type: application/json' \
--data-binary @big.json http://localhost:5678/webhook/big-body
{"code":0,"message":"There was a problem executing the workflow"} 500 Nothing on the caller’s side mentions size. The n8n log does:
PayloadTooLargeError: request entity too large
at readStream (…/node_modules/raw-body/index.js:163:17)
…
at parseRequestBody (…/n8n/src/webhooks/webhook-helpers.ts:1474:17)
Error in handling webhook request POST /webhook/big-body: There was a problem executing the workflow The same body sent to the REST API (the path the editor uses) got a proper 413 with a one-line HTML body, <pre>Payload Too Large</pre>. A normal-sized request to the same webhook returned {"message":"Workflow was started"} with 200, so the workflow itself was fine all along.
Put nginx in front with its default limit and the picture changes. Even a 2 MiB body, far under n8n’s 16 MiB, never reached n8n:
$ curl -s -w ' %{http_code}' -H 'Content-Type: application/json' \
--data-binary @big2.json http://localhost:8091/webhook/big-body
<html>
<head><title>413 Request Entity Too Large</title></head>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.31.3</center>
</body>
</html>
413 The n8n log stayed empty for those requests. nginx’s error log had the reason, with the body size in bytes:
[error] … client intended to send too large body: 2097152 bytes,
client: 127.0.0.1, server: , request: "POST /webhook/big-body HTTP/1.1" The fixes
Raise n8n’s limit: N8N_PAYLOAD_SIZE_MAX
The value is in MiB, and n8n only reads it at startup. The docs say “The n8n instance needs to be restarted to apply the new setting.” In Docker, recreate the container so the new variable reaches it:
# docker run
-e N8N_PAYLOAD_SIZE_MAX=32
# docker compose (environment: section of the n8n service)
- N8N_PAYLOAD_SIZE_MAX=32 With N8N_PAYLOAD_SIZE_MAX=32, the 17 MiB request that had failed returned {"message":"Workflow was started"} with HTTP 200, and no PayloadTooLargeError appeared in the log.
Raise the proxy’s limit: client_max_body_size
nginx rejects anything over its limit before n8n gets it, so raising n8n alone changes nothing. Per the nginx docs, the directive is client_max_body_size size; with default 1m, valid in http, server and location:
server {
server_name n8n.example.com;
client_max_body_size 32m; # match or exceed N8N_PAYLOAD_SIZE_MAX
location / {
proxy_pass http://127.0.0.1:5678;
# … your existing proxy headers
}
} Tested on 1 October 2026 with nginx 1.31.3 and n8n 2.41.5 (N8N_PAYLOAD_SIZE_MAX=32): with client_max_body_size 32m in the server block, the 2 MiB and 17 MiB bodies both returned {"message":"Workflow was started"} with 200. The same nginx without the line still answered 413 to both.
Then nginx -t and reload. The nginx docs add that “browsers cannot correctly display this error”. If the editor shows only a generic failure when saving a large workflow, check the proxy’s error log as well as n8n’s.
Send big files as form-data instead of JSON
If the large part is a file, have the sender post it as multipart form-data. File parts in form-data webhook payloads fall under N8N_FORMDATA_FILE_SIZE_MAX, 200 MiB by default per the docs, not the 16 MiB JSON limit, and the Webhook node hands them to the workflow as binary data. A file base64-encoded inside JSON is about a third larger than the file and counts against the 16 MiB.
$ curl -s -w ' %{http_code}' -F "upload=@file20.bin" http://localhost:5678/webhook/big-body
{"message":"Workflow was started"} 200 A 20 MiB file, sent as form-data to the same webhook with N8N_PAYLOAD_SIZE_MAX at its default of 16. It went through on both versions, and n8n wrote the file under .n8n/storage/workflows/…/executions/…/binary_data/. The 17 MiB JSON body had failed on the same instance.
Related
If the webhook answers “The requested webhook … is not registered” instead, the size is not the problem. See webhook not registered. If callers are hitting a URL with localhost in it, see why n8n shows a localhost webhook URL. If n8n’s log behind the same proxy also shows a ValidationError about X-Forwarded-For, see the trust proxy error.
Sources and last verified
First reproduced on n8n 2.41.3 on 30 September 2026. Re-run in full on n8n 2.41.5, the newest stable release, on 1 October 2026, this time with nginx 1.31.3 in front. Every result matched, and the doc quotes were re-read the same day. The GitHub release notes for 2.41.4 through 2.42.2 (beta) mention no change to request size limits. If n8n’s docs and this page disagree, n8n wins. Write to support@flowtemplates.app and we will re-verify.
- n8n Docs — Endpoints environment variables (N8N_PAYLOAD_SIZE_MAX, N8N_FORMDATA_FILE_SIZE_MAX) — checked 2026-10-01
- nginx docs — ngx_http_core_module, client_max_body_size — checked 2026-10-01
- n8n source — body-parser.ts (the payloadSizeMax limit applied to request bodies) — checked 2026-09-30
- n8n GitHub releases — 2.41.5, the version this page was re-run on — checked 2026-10-01
Frequently asked questions
What is n8n’s default maximum payload size?
16 MiB. The n8n docs list N8N_PAYLOAD_SIZE_MAX as a Number with default 16, “The maximum payload size in MiB,” and note that the instance needs to be restarted to apply a new value. In the 2.41.3 source the same number is passed to the body parser as the request-body limit.
Why does my n8n webhook return 500 instead of 413 for a large body?
Because the webhook handler catches the body-parser error and reports a failed execution. On n8n 2.41.3, and again on 2.41.5, a 17 MiB JSON POST to a Webhook node returned HTTP 500 with {"code":0,"message":"There was a problem executing the workflow"}. Only the server log carried the real reason: “PayloadTooLargeError: request entity too large”, followed by “Error in handling webhook request POST /webhook/…”. If a caller reports 500s on large payloads only, check the log for that line before debugging the workflow.
I raised N8N_PAYLOAD_SIZE_MAX and still get 413. Why?
Almost always because the 413 now comes from a proxy in front of n8n, not from n8n. nginx’s client_max_body_size defaults to 1m, so with nginx in the path anything over 1 MB is refused before n8n sees it, whatever n8n is set to. We checked this on n8n 2.41.5 behind nginx 1.31.3: with N8N_PAYLOAD_SIZE_MAX=32, nginx at its default still refused a 2 MiB body with its own 413 page, while the same nginx with client_max_body_size 32m passed a 17 MiB body through and n8n returned 200. The nginx docs say the directive can be set in the http, server or location context, and that 0 disables the check. Raise it there as well, then reload nginx.
Does N8N_PAYLOAD_SIZE_MAX limit file uploads to a webhook?
Files sent as multipart form-data have their own limit. The docs list N8N_FORMDATA_FILE_SIZE_MAX, default 200, as the “Max payload size for files in form-data webhook payloads in MiB”. In the 2.41.3 source the webhook’s form-data parser is built from that value. If a client sends a large file as a base64 string inside JSON instead, that JSON body counts against the 16 MiB N8N_PAYLOAD_SIZE_MAX.
What value should I set?
The smallest that fits your real traffic, with some headroom. n8n’s docs warn that increasing the payload size may impact performance and that your infrastructure has to handle larger payloads. A webhook body is held in memory while the workflow runs, so a limit ten times larger than anything you receive only adds risk. On our test instance N8N_PAYLOAD_SIZE_MAX=32 was enough for the 17 MiB body that had failed.