When you see a “Node execution failed” error in n8n, it means something went wrong in a specific node during workflow execution. This can happen for various reasons — from invalid input to failed API calls or code errors.
Here’s a structured guide to help you diagnose and fix this error quickly:
🧯 How to Fix “Node Execution Failed” Errors in n8n
✅ Step 1: Open Execution Log
Go to Execution History (Executions menu).
Click the failed run.
Look for the red "Node execution failed" label.
Expand that node to see:
Error Message
Stack Trace
Input/Output data
📌 Tip: Often the error message contains the exact cause — e.g., “401 Unauthorized”, “Cannot read property of undefined”, etc.
🧠 Step 2: Understand the Common Causes
| Cause | Error Clue | Fix |
| ------------------------------ | ----------------------- | ---------------------------------------------- |
| 🔑 Invalid Credentials | 401, 403 | Check credentials in Credential Manager |
| 📥 Missing Input Data | undefined, null, etc. | Use Set, IF, or default values to validate |
| 🌐 API Request Fails | 400/404/500 errors | Use HTTP node logs to debug |
| 🧮 Code Error in Function Node | JavaScript error | Add logging (console.log), test in isolation |
| 🧰 Node Misconfiguration | Required field missing | Double-check node settings and input mapping |
🛠 Step 3: Use “Continue On Fail” for Debugging
To avoid breaking the whole flow and help with troubleshooting:
- Click on the failing node
- Enable: ✅ "Continue On Fail"
- Connect an IF node afterward to check:
{{$json["error"] !== undefined}}
Then log or alert the error for future visibility.
🔍 Step 4: Validate Input Data Before the Node
Use these tools to pre-check what’s going into the node:
- Set Node: Use it to restructure or set default values
- IF Node: Add conditionals to block null/undefined
- Merge Node: Join expected data correctly
- Function Node: Inspect inputs using
console.log(items)
📌 Example validation in Function Node:
if (!item.json.email) {
throw new Error("Missing email address");
}
🔐 Step 5: Check API or External Services
If you're using an API (e.g., Gmail, Airtable, Stripe):
- Check:
- Rate limits
- Expired access tokens
- Required parameters
- Use HTTP Request Node and log the full response
📌 Turn on “Full Response” to see status codes and headers.
🧪 Step 6: Isolate the Node and Test
- Run the failing node manually:
- Select it
- Click "Execute Node"
- Confirm if it fails alone or only with specific data
🚨 Step 7: Check Function/FunctionItem Node Syntax
Typical JS errors:
undefined is not a function
Cannot read property of ...
💡 Tip: Test small chunks in Node.js REPL or browser console first
🛡 Bonus Tips
- Catch errors and send them to Telegram/Slack with
Function → Set → Notification
- Use environment variables to test in dev/staging before deploying
- Export your workflow before making big changes
📦 Example Fix: HTTP Node Fails with 401
Problem:
Error: 401 Unauthorized
Fix:
- Go to Credentials
- Refresh or reauthorize the service (e.g., Gmail, Notion, Airtable)
- Test with a
curl or Postman call to validate manually
⚠️ Still Stuck?
Send me:
- A screenshot of the error log
- The failing node name
- The error message or snippet of the workflow JSON
And I’ll walk you through the fix. Want to try that now?