Templates / Retry LLM calls with OpenAI and Anthropic and log costs in Data Tables

Retry LLM calls with OpenAI and Anthropic and log costs in Data Tables

Ready for 3.0

by Huseyin Hobek ✓ · 3 views · created 2026-09-29 · Engineering, AI Chatbot

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 16 nodes and runs when a chat message arrives (plus 1 other trigger). Along the way it connects Telegram.

How it runs

Trigger: When a chat message arrives (plus 1 other trigger).

  1. Set Reliability Settings (Edit Fields (Set)): sets 18 fields: prompt, systemPrompt, primaryProvider…
  2. Prepare LLM Request (Code): runs custom JavaScript code
  3. Route by Provider (If): checks a condition and branches into true / false
  4. Post to OpenAI API (HTTP Request): calls an HTTP API (POST)
  5. Post to Anthropic API (HTTP Request): calls an HTTP API (POST)
  6. Analyze API Response (Code): runs custom JavaScript code
  7. Route by Response Status (Switch): routes items into 4 branches
  8. Compile Final Result (Code): runs custom JavaScript code
  9. Wait: pauses before continuing
  10. Check Log Table Exists (Data table): create (table)

…plus 4 more steps. See the full node list below.

Services it uses

Telegram

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (10)

From the author

Quick overview This workflow accepts a prompt from n8n Chat or another workflow, calls OpenAI with automatic retries, falls back to Anthropic on hard failures, logs each run to an n8n Data Table with token and cost estimates, and sends a Telegram alert if all…

Excerpt from Huseyin Hobek's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.