
See What's Earning in AI Automation Freelancing.
DigiNo helps new AI automation freelancers earn faster by tracking what clients actually pay for.
Clients with AI chat products waste money sending every query to the same expensive model regardless of complexity. This workflow classifies each incoming message and routes it to the most appropriate model automatically, so your client gets optimised costs and response quality without touching a single setting.
What This Automation Does
- Classifies each incoming chat message by type — coding, research, general conversation, or other — using a structured output parser before any model is called
- Routes the classified query to the best-fit model: Claude for complex or code-heavy requests, Gemini for research, and GPT-4.1 mini for fast general responses
- Maintains per-session conversation memory so each user gets contextually aware replies across multiple turns without manual state management
- Keeps classification logic, routing rules, and model execution in separate layers so new models or query types can be added without rebuilding the whole system
Tools Used
- n8n
- Claude
- OpenAI
- Google Gemini
- OpenRouter
Where to Get Hired for This Skill
On Contra, top freelancers across this stack have earned 306 combined verified reviews from real client projects.
Source: Contra freelancer search · refreshed 30 May 2026
Start Earning as a Freelancer on Contra
Contra is a commission-free professional network for independents. Browse live AI automation work and keep what you earn.
Join Contra Free →How To Build It
Define the classification schema
Set up a structured output parser that forces the classifier to return a clean, machine-readable category label for every incoming message, eliminating ambiguous free-text responses that would break downstream routing.
Wire up the model selector logic
Build a routing layer that reads the classification label and maps it to a specific model provider — Claude receives code and complex reasoning tasks, Gemini handles research-heavy queries, and GPT-4.1 mini processes general conversation where speed matters most.
Connect all three model providers
Authenticate Claude, OpenAI, and Google Gemini separately so the workflow can call any of the three on demand; using OpenRouter as a fallback layer means the client is never left with a failed response if one provider has an outage.
Attach session memory to each model branch
Bind a memory buffer to every model execution path using the session ID passed in with each chat message, so the correct conversation history is retrieved and appended regardless of which model handled the previous turn.
Test routing accuracy across edge cases
Run a set of deliberately ambiguous prompts — questions that mix code with research, or casual messages that contain technical terminology — to verify the classifier assigns them consistently and that no query reaches the wrong model in production.
Pitfalls
- Classification drift: if the client's users start sending hybrid queries (e.g. ‘write me a Python script that summarises this research paper'), the classifier may route inconsistently and you will need to expand the category schema and retrain the classification prompt to handle compound intent.
- API rate limits across three providers: under load, hitting rate ceilings on OpenAI, Anthropic, and Google simultaneously is a real risk — build retry logic and set up OpenRouter as a fallback from the start, not as an afterthought after the client reports failures.
- Session memory bloat: memory buffers that store full conversation history without a token or turn limit will eventually cause context window errors on the model side; cap the buffer window early and communicate that limitation to the client before it surfaces as a bug.
FAQ
Can I build this without coding?
Yes. The routing and classification logic is built entirely inside n8n using low-code configuration. You will need to write and iterate on the classification prompt, but no custom code is required to connect the models or manage session memory.
How long does it take?
A working version with two model branches and basic classification takes around three to four hours to build and test. Adding a third model branch, memory, and edge-case testing brings a production-ready delivery to roughly one to two days.
What can I charge?
Scope and price based on the number of model integrations, the complexity of the classification logic, and whether the client needs memory, analytics, or ongoing maintenance included. Delivering a tested, documented system justifies a meaningful project fee rather than an hourly rate.
Which tool is required vs optional?
n8n and at least one model provider are required — the workflow cannot function without a classifier and a model to route to. Claude, OpenAI, and Google Gemini are interchangeable depending on the client's existing contracts; OpenRouter is optional but strongly recommended as a resilience layer for production deployments.
This is original DigiNo analysis. The underlying automation pattern is a community workflow template – view the original on n8n.

See What's Earning in AI Automation Freelancing.
DigiNo helps new AI automation freelancers earn faster by tracking what clients actually pay for.

AI Automations using Veed