KEEP LEARNING
Build the bigger picture.
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
Tips > Data, APIs & Webhooks
Not every AI task needs the most powerful (and expensive) model.
Not every AI task needs the most powerful model. Use cheaper, faster models like gpt-4o-mini or claude-3-5-haiku for classification, routing, extraction, and short summaries, and reserve full-size models for long-form generation and complex reasoning. In n8n, set the model per node so simple decisions cost a fraction of a cent.
Not every AI task needs the most powerful (and expensive) model. Use cheaper, faster models for classification, routing, extraction, and yes/no decisions. Reserve the full-sized models for tasks that genuinely need them -- long-form generation, complex reasoning, or nuanced analysis.
Real-world example: A support ticket workflow classifies incoming emails into categories (billing, technical, feature request, spam), then routes them to the right team. Classification is a simple task that a small model handles perfectly.
Task-to-model mapping:
Classification/routing:
Model: gpt-4o-mini or claude-3-5-haiku
Cost: ~$0.0001 per classification
Example: "Is this email about billing, technical support, or a feature request?"
Data extraction:
Model: gpt-4o-mini or claude-3-5-haiku
Cost: ~$0.0003 per extraction
Example: "Extract the customer name, order ID, and issue from this email."
Summarization (short):
Model: gpt-4o-mini or claude-3-5-haiku
Cost: ~$0.0005 per summary
Example: "Summarize this support ticket in one sentence."
Long-form generation:
Model: gpt-4o or claude-sonnet-4
Cost: ~$0.01-0.05 per generation
Example: "Write a detailed response to this customer's technical issue."
Complex reasoning:
Model: gpt-4o or claude-sonnet-4
Cost: ~$0.02-0.10 per query
Example: "Analyze this contract clause and identify potential risks."In n8n, configure the OpenAI or Anthropic node to use the appropriate model per task:
// Classification node (cheap model)
{
"resource": "chat",
"model": "gpt-4o-mini",
"messages": [
{
"role": "system",
"content": "Classify the following support email into exactly one category: billing, technical, feature_request, spam. Respond with only the category name."
},
{
"role": "user",
"content": "={{ $json.emailBody }}"
}
],
"temperature": 0,
"maxTokens": 10
}The generation node uses the powerful model, and only when it is actually needed:
// Generation node (powerful model, only called when needed)
{
"resource": "chat",
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "Write a helpful, empathetic response to this customer support ticket. Include specific steps to resolve their issue."
},
{
"role": "user",
"content": "={{ $json.emailBody }}"
}
],
"temperature": 0.7,
"maxTokens": 500
}Cost comparison for 1000 support tickets/day:
All gpt-4o: 1000 x $0.03 = $30/day = $900/month
Smart routing: 1000 x $0.0001 (classify) + 200 x $0.03 (generate) = $6.10/day = $183/month
Savings: ~80%The key insight: most tickets only need classification and a template response. Only the complex ones need a powerful model to generate a custom reply.
Related: Use Structured Output (JSON Mode) for Parseable Responses · Configure Payload Size and Binary Data Mode for Large Files
KEEP LEARNING
The Workflow Engineer connects individual n8n concepts to testing, deployment and running a complete workflow.
APPLY IT TO YOUR SYSTEM
Bring the process, the tools involved and an example of where the current workflow gets stuck.