Mindket

Chat request that falls back to a second model on error

Newversion 1 · updated

Overview

An n8n workflow that sends one chat request to a primary model and, when that call fails, sends the same request to a second model. Both calls use one gateway address and one key.

Chat request that falls back to a second model on error is an n8n workflow in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

At a glance

Runs in
  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps
  • A larger workflow: replace the manual trigger with your own and pass on the four fields
  • Another service that takes the same chat request: change the address in both calls

Platform

Connects 1 app

How it works

Trigger

Manual test

It starts when you click Test workflow, using the values typed in Set inputs:

  • A prompt
  • A system line
  • A primary model ID
  • A fallback model ID

Actions

  1. Set inputs holds the prompt, the system line and the two model IDs
  2. The primary model is called through the DaoXE chat address
  3. If that call returns an error, the same request goes to the fallback model
  4. The answer, the model that served it and a primary or fallback label are saved

Result

An answer, the name of the model that gave it, and a note saying whether the primary or the fallback model answered

Integrations

What you need before you start.

DaoXE

Model gateway

Receives both chat requests and returns the answers of the two models.

NeedsA DaoXE API key in a Header Auth credential, and two model IDs from your account

Workflow check

Checked by Mindket on 13 Nov 2026

Steps
6 steps, starting by hand
AI
No step calls an AI model
Sign-ins
Signs in to: daoxe.com
API keys
No API key is left in the file
Step types
Mindket’s checker reads all 3 of its step types

Read from the workflow’s file, not from a run.

About

What it is

This n8n workflow asks one model a question and keeps a second model ready in case the first call fails. A Set node holds the prompt, a system line and the two model IDs. The primary call goes to a chat address, and an error sends the same request to the fallback model. The answer is saved with the name of the model that gave it. Six nodes do the work, beside a sticky note with the setup steps.

Who it suits

Developers who test models, and teams that want a backup when a model is down or refuses a call. Skip it if you want to switch on a slow or a poor answer. The fallback runs only after an error.

Who uses it, and how
IndustryWho uses itHow they use itExample
SoftwareDevelopersBuild a backup into a call before they ship itA developer pairs a large model with a cheaper one and tests that the second answers when the first is down.
Product teamsProduct managersCompare how two models answer the same promptA manager runs one prompt and reads which model served it.
ContentEditorsKeep drafts coming when one model is busyAn editor sets a second model so a morning run still finishes.
OperationsAutomation buildersUse the pattern inside a larger workflowA builder swaps the manual trigger for a webhook and reuses the two calls.

You need a little n8n and a DaoXE account: import a file, add one credential and type in two model IDs. Its author puts setup at about 2 minutes.

Where to use it

Any n8n that can reach the gateway will run it. The answer stays in the run, so plan where it goes next.

  • n8n Cloud: import the file into a new workflow there
  • Your own n8n server: the same file and steps
  • A larger workflow: replace the manual trigger with your own and pass on the four fields
  • Another service that takes the same chat request: change the address in both calls

Setup

Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. One key covers both calls.

What you need first
NeedDetail
n8nOn n8n Cloud or on a server of your own
DaoXEAn account and an API key, for a Header Auth credential named Authorization
Two model IDsExact IDs that your account can use, one for each call
  1. In n8n, create a workflow, open its menu, choose Import from File and pick workflow.json.
  2. Create a Header Auth credential with the name Authorization and the value Bearer <YOUR_DAOXE_API_KEY>, using your own key. Select it in Primary model (DaoXE) and in Fallback model (DaoXE).
  3. Open Set inputs and replace YOUR_DAOXE_MODEL_ID and YOUR_DAOXE_FALLBACK_MODEL_ID with two model IDs from your account.
  4. Click Test workflow and read the last node’s output.

How to use it

Click Test workflow. The last node shows answer, served_model and via, which reads primary or fallback. For daily use, change the prompt in Set inputs or feed in your own.

What to change for a different result
To changeWhere
The question and the system lineprompt and system in Set inputs
The two modelsprimary_model and fallback_model in Set inputs
The triggerSwap the manual trigger for your own, passing on the same four fields
The serviceThe address in both HTTP Request nodes

Example

A developer puts a large model in primary_model and a cheaper one in fallback_model, then clicks Test workflow with the sample prompt, which asks for three blog titles about automation.

When the large model answers, the result reads via: primary with its name in served_model. When that call returns an error, the second node asks the cheaper model and the result reads via: fallback.

For newcomers and experts

If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one forks after the first call: one line leads to the answer, and a second line, used only after an error, leads to the backup. Break the first model ID on purpose and run it to see the fork.

For experts. The primary node’s On Error setting sends a failed call to its error output, and the fallback node reads the inputs back from Set inputs by name.

Where to look closer
NodeWhat it doesWhat to know
Primary model (DaoXE)HTTP Request 4.2, POST to https://daoxe.com/v1/chat/completionsContinue (using error output) feeds the second output into the fallback
Fallback model (DaoXE)The same request with fallback_modelNothing follows it, so a second failure stops the run
Answer (primary) and Answer (fallback)Set 3.4 nodes that keep answer, served_model and viaanswer is choices[0].message.content and served_model is the response’s model

Good to know

The backup runs only after an error, and a model ID left as a placeholder makes both calls fail.

  • Errors only: a failed status code or a lost connection starts the fallback. A slow answer or a weak one stays as the answer
  • No third model: when the fallback call fails too, the run stops there
  • Placeholders: YOUR_DAOXE_MODEL_ID and YOUR_DAOXE_FALLBACK_MODEL_ID stay in the file until you replace them
  • Sample prompt: the original asked for titles about the gateway’s own selling points. Mindket’s copy asks for titles about saving time with automation
  • The gateway: DaoXE is a third-party service that Mindket does not run. Its own note says it is not available in mainland China, and its terms and prices are its own
  • Billing: each call is billed by the gateway, and a run that falls back makes two calls
  • Your data: the prompt and the system line go to the gateway
  • Credentials: the JSON holds none, so add the Header Auth credential yourself

README and files

README

Chat request that falls back to a second model on error

An n8n workflow that sends one chat request to a primary model and, when that call fails, sends the same request to a second
model. Both calls go to one gateway address with one key, and the answer says which model gave it.

What is inside

  • workflow.json: the workflow as n8n exports it, six working nodes and one sticky note with the setup steps. It holds no
    credential.
  • README.md: these notes.

What we changed from the original copy

  • The sample prompt in Set inputs asked for blog titles about the gateway's own selling points. It now asks for three short
    blog-post titles about saving time with automation. Nothing else in the file changed except the removal of the credential
    links and the DaoXE tag.

Before you start

  • An n8n instance, on n8n Cloud or your own server.
  • A DaoXE account with an API key, and two model IDs that your account can use. The sticky note says to take them from the
    dashboard or from a request to GET /v1/models.
  • The sticky note says the service is not available in mainland China.

Set it up

  1. In n8n, create a workflow, open its menu and choose Import from File. Pick workflow.json.
  2. Create a Header Auth credential. Give it the name Authorization and the value Bearer <YOUR_DAOXE_API_KEY>, with your own
    key in place of the placeholder. Select it in Primary model (DaoXE) and in Fallback model (DaoXE).
  3. Open Set inputs. Replace YOUR_DAOXE_MODEL_ID and YOUR_DAOXE_FALLBACK_MODEL_ID with two exact model IDs from your
    account.
  4. Click Test workflow and read the last node's output. The sticky note puts setup at about 2 minutes.

How a run goes

  1. When clicking 'Test workflow' (Manual Trigger) starts the run by hand.
  2. Set inputs writes four fields: prompt, system, primary_model and fallback_model.
  3. Primary model (DaoXE) (HTTP Request 4.2) posts to https://daoxe.com/v1/chat/completions with the primary model, the
    system line and the prompt. Its On Error setting is Continue (using error output), so a failed call leaves through its second output.
  4. When the call works, Answer (primary) keeps choices[0].message.content as answer, the response's model as
    served_model, and sets via to primary.
  5. When it fails, Fallback model (DaoXE) posts the same prompt to the same address with the fallback model, and
    Answer (fallback) keeps the same fields with via set to fallback.

Both request bodies are built with JSON.stringify, so quotes and line breaks in the prompt do not break them.

Change the look

  • The question and the system line: prompt and system in Set inputs.
  • The two models: primary_model and fallback_model in Set inputs.
  • The trigger: swap the manual trigger for your own trigger, as long as the item it passes on carries those four fields, or edit
    Set inputs to build them.
  • The service: the address in both HTTP Request nodes, if you use another service that takes the same chat request.

Good to know

  • The fallback runs only after an error, such as a failed status code. A slow answer or a poor one stays as the answer.
  • There is no third model. When the fallback call fails too, the run stops at Fallback model (DaoXE).
  • The two model IDs are placeholders until you replace them, and both calls fail while they are.
  • The gateway is a third-party service. Mindket does not run it, and its terms and prices are its own. A run that falls back
    makes two calls.
  • The prompt and the system line go to the gateway.
Files
NOTICE.md  620 B
README.md  4 KB
workflow.json  8 KB

3 files, 12 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-12

Reviews

No ratings yet

Write a review

No reviews yet.

More from Mindket

See all from Mindket

Huashu Design

alchaincyf · Skill

Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…

New29.4k

Guizang PPT Skill

op7418 · Skill

Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…

New29.8k

Claude Code Skills & Plugins

alirezarezvani · Skill

Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…

New29.8k

Similar in Developer

See all in Developer

buzz

block · Kit

Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…

New37.3k

plannotator

backnotprop · Kit

Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.

New10.5k

open-code-review

alibaba · Kit

Reviews Git changes with an AI agent that reads files and searches the codebase, then writes comments tied to exact lines. It suits developers who want automat…

New50.7k