PromptForge
Prompt library

Error Handling & Idempotency in n8n

ChatGPT (inside n8n)Automation From a course

Real automations fail: APIs time out, models return malformed JSON, webhooks fire twice.

The prompt

Return ONLY valid JSON: {"category": string, "reply": string, "confidence": number 0-1}. If you cannot classify confidently, set category to "unknown" and confidence below 0.5. Never add text outside the JSON.

Input: {{$json.body}}

What to replace

Swap these placeholders for your own details before running the prompt:

  • {{$json.body}}your own value

Pro tip: Route confidence < 0.7 to a human-review branch. The 10% of cases you don't automate protect the reputation of the 90% you do.

How to use this prompt

  1. Copy the prompt using the button above.
  2. Replace {{$json.body}} with your own details — the more specific you are, the better the output.
  3. Paste it into ChatGPT (inside n8n) and run it.
  4. If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.

Learn the technique

Error Handling & Idempotency in n8n

Module 3 — Advanced: Reliable Production Workflows · AI Automation with n8n

Related prompts