Key Takeaways
- Two errors, '400 Invalid value for content' and 'No prompt specified', both mean the agent received no prompt text. Fix the Prompt source or the expression.
- Re-add the Chat Model or Simple Memory sub-node when n8n says one is missing or failing; old templates often carry outdated versions.
- 'Agent stopped due to max iterations' is a loop. Tighten tool descriptions and the system message before you raise the limit.
- Retry On Fail allows at most 5 tries, 5 seconds apart, so it cannot wait out a per-minute rate limit. Use Loop Over Items plus Wait instead.
Your n8n agent worked in the test chat on Friday. On Monday the production run died on item 14 with a red error and no reply sent to the customer.
The good news: almost every AI Agent failure in n8n comes from one of six messages, and each has a fixed place in the editor where you change one setting. Here is the map.
Why does the n8n AI Agent node keep failing?
Most failures come from six sources: the prompt arrives empty, the Chat Model sub-node is missing, the memory sub-node is an older version, the agent loops until it hits max iterations, the model provider rate-limits you, or the API account runs out of quota. Read the exact error text first, then go to the matching fix.
What you need before you start
- n8n Cloud (Starter or above) or a self-hosted n8n on the latest stable version. n8n's own troubleshooting guide says only the latest stable version is supported.
- Hong Kong availability: n8n Cloud works from Hong Kong and stores data in Frankfurt, according to the n8n pricing FAQ; self-hosting lets you keep data on a Hong Kong server.
- The model behind the agent is a separate question. OpenAI and Anthropic do not officially support Hong Kong, so confirm your model provider's supported regions before you connect a credential.
Error map: copy this into your team notes
| Error text | Likely cause | Where to fix it |
|---|---|---|
| 400 Invalid value for 'content': expected a string, got null | Prompt expression returns nothing | AI Agent > Prompt > Text field |
| No prompt specified | Agent waits for a chat trigger that is not there | AI Agent > Prompt > Define below |
| A Chat Model sub-node must be connected | No model attached | AI Agent > Chat Model + |
| Error in sub-node Simple Memory | Old memory node from a template | Delete and re-add Simple Memory |
| Agent stopped due to max iterations | Agent loops between tools | System message, tool descriptions, Options > Max Iterations |
| The service is receiving too many requests from you / Insufficient quota | Rate limit or empty balance | Node Settings, Loop Over Items + Wait, provider billing page |
How do I fix '400 Invalid value for content' and 'No prompt specified'?
Both mean the agent got no prompt text. If Prompt is set to Define below, the expression in the Text field is returning null, so point it at a field that exists. If Prompt is set to Connected Chat Trigger Node but the run starts from a webhook or schedule, switch it to Define below and build the prompt yourself.
This is the most common failure in manual test runs, according to n8n's AI Agent common issues page. A typo such as `$json.mesage` or an upstream node that returned an empty item is enough. Open the expression editor on Text and check the preview; if it shows null, fix the field path, then add an If node so empty items never reach the agent.
How do I fix 'A Chat Model sub-node must be connected' and Simple Memory errors?
Attach a model: open the AI Agent node and click the Chat Model plus button, then pick your provider and credential. For 'Error in sub-node Simple Memory', delete the memory node and add a fresh one. n8n says this error usually comes from templates that still carry the older Window Buffer Memory version.
Why does my agent stop with 'Agent stopped due to max iterations'?
The agent called tools again and again without reaching a final answer, so it hit the cap set under Options > Max Iterations. Raising the cap rarely helps. The usual causes are vague tool descriptions, a tool that returns an error the model keeps retrying, and too much chat history in memory.
- Rename each tool so its name says what it does, then write a one-line description of when to use it and when not to.
- Set On Error on the tool's sub-workflow to return a clear error message, so the agent can stop instead of guessing.
- Add rules to Options > System Message, as below. Raise Max Iterations only after these changes.
You can use these tools:
- [tool name 1]: use only to [purpose]. Do not use for [exclusion].
- [tool name 2]: use only to [purpose].
Rules:
1. Never call the same tool twice with the same input.
2. If a tool returns an error or an empty result, stop and reply:
"I could not finish [task] because [reason]. A person will follow up."
3. Give your final answer as soon as you have enough information.
How do I fix rate limit and insufficient quota errors in n8n?
For 'The service is receiving too many requests from you', slow the flow down: batch items with Loop Over Items and put a Wait node after the model call. For 'Insufficient quota', check that the API key's organisation and project have credit and no usage cap reached, then issue a fresh key if a recent top-up has not taken effect.
The trap is Retry On Fail. n8n's rate limit guide caps it at 5 tries and 5,000 ms between tries, so the longest it can wait is about 20 seconds in total. A limit that resets every minute will still be closed when the last retry fires.
- Add Loop Over Items before the AI step with a small batch size, then a Wait node after it that loops back. Tune the wait to the provider's per-minute limit.
- For quota errors on OpenAI, n8n's OpenAI common issues page says to check the organisation billing overview, the organisation usage limits and Project > Limits, with the correct organisation and project selected.
Which n8n settings stop AI Agent errors from coming back?
Set three things on every production agent: Retry On Fail for short network blips only, On Error set to Continue (using error output) so one bad item does not stop the run, and an error workflow that alerts you. Then add a fallback model in the AI Agent node so a provider outage switches models instead of failing.
| Setting | Where | Recommended value |
|---|---|---|
| Retry On Fail | Node > Settings | On, Max Tries 3, Wait Between Tries 2000 ms |
| On Error | Node > Settings | Continue (using error output) |
| Error workflow | Workflow > Settings > Error Workflow | A workflow that posts to email or chat |
| Fallback model | AI Agent node > Enable Fallback Model | A second provider or a cheaper model |
Do the cost maths before you turn retries up. If one agent run can make 10 model calls and the node retries 5 times, a single bad input can trigger up to 50 paid calls. n8n Cloud bills per completed execution (Starter is 20 euros a month billed annually for 2,500 executions), but your model provider bills every call, failed or not.
Watch the time limits as well. The n8n pricing page lists a 5-minute maximum execution duration on Starter and a 180-second timeout on the free trial, so a looping agent can be cut off mid-run on those plans.
Fix the cause, then make the next failure cheap
Last verified: 25 November 2026, against n8n documentation and the n8n pricing page. Menu names can move between n8n versions, so check the node's Settings tab if a label differs.
Empowering AI. Centered on you.
Would rather not maintain agent workflows yourself?
If you don't want to build and maintain this flow yourself, UD can deploy and run AI staff by job role across marketing, HR, admin, customer service, accounting and IT, with zero setup fee and data kept in Hong Kong. We'll walk you through every step, starting with a free AI staff configuration assessment.
Frequently Asked Questions
Does n8n charge for failed executions?
n8n's pricing page says you only pay when a workflow runs from start to finish. Your model provider still charges for every API call made before the failure.
Can I use n8n from Hong Kong?
Yes. n8n Cloud is reachable from Hong Kong and stores data in Frankfurt, and the self-hosted Community Edition can run on a Hong Kong server. Check your AI model provider's supported regions separately.
Why does my agent work in the editor but fail in production?
Manual runs use pinned or sample data, while production items can have empty fields. Add an If node that drops empty items and check the execution log for the failing item's input.