Phase 0: AI Workflow Automation Fundamentals · 45 min · Zapier · n8n · OpenAI API
Cost Economics of AI Automation
If you can't estimate the cost per run, you can't estimate the ROI.
What you will learn
- Calculate the total cost per workflow execution: platform cost + AI API cost + infrastructure cost
- Compare platform pricing models: Zapier (task-based), Make (operation-based), n8n (self-hosted infra only)
- Estimate AI API costs: per-token pricing for OpenAI and Anthropic, typical token usage per workflow
- Calculate automation ROI: manual process cost vs automation cost at various volumes
The Problem
A company builds an n8n workflow that processes customer emails with AI: classify, extract data, draft response. It works great at 100 emails/day. They scale to 5,000 emails/day and get a $4,200 OpenAI bill in one month. The CFO kills the project. The team didn't calculate the per-execution cost before scaling. They used GPT-6.1 Sol for classification (which GPT-6 Luna could handle at 1/20th the cost), didn't cache common classifications, and didn't set token limits.
Cost economics isn't an afterthought — it's a design constraint that shapes which model you use, how many AI steps you include, and whether the automation is worth building at all.
Cost per run is the unit metric of automation economics
Every workflow has a cost per execution: platform cost + AI API cost + infrastructure cost. If you can't calculate it before building, you're flying blind. The formula is simple; the discipline is in tracking every token.
The Concept
The Three Cost Layers
┌─────────────────────────────────────────────────────────────┐
│ Total Cost per Execution = Platform + AI API + Infra │
│ │
│ Platform: Zapier ($0.012/task) or n8n ($0 self-hosted)│
│ AI API: OpenAI/Anthropic per-token pricing │
│ Infrastructure: VPS, database, vector store (amortized) │
└─────────────────────────────────────────────────────────────┘
AI API Pricing (October 2026)
| Model | Input ($/1M tokens) | Output ($/1M tokens) | Best For |
|---|
| GPT-6.1 Sol | $2.00 | $10.00 | Complex reasoning, high-stakes |
| GPT-6 Luna | $0.10 | $0.50 | Classification, extraction, most workflows |
| Claude Sonnet 5.5 | $2.00 | $10.00 | Long context, careful analysis |
| Claude Haiku 5.5 | $0.10 | $0.50 | Fast, cost-effective |
| Llama 3.1 8B (Ollama) | $0 | $0 | Local, no API cost |
Cost per Execution: Worked Example
Workflow: Email → AI Classify → AI Extract → DB Lookup → AI Draft Response → Send
| Step | Model | Input Tokens | Output Tokens | Cost |
|---|
| Classify | GPT-6 Luna | 300 | 20 | $0.000040 |
| Extract | GPT-6 Luna | 500 | 100 | $0.000100 |
| Draft response | GPT-6 Luna | 800 | 200 | $0.000180 |
| Total AI cost | | | | $0.000320 |
| Platform (n8n self-hosted) | — | — | — | ~$0.001 |
| Infrastructure (amortized) | — | — | — | ~$0.0005 |
| Total per execution | | | | ~$0.0018 |
At 5,000 emails/day: $0.00182 × 5,000 = $9.10/day ≈ $273/month
You're using GPT-6.1 Sol ($2.00/$10.00 per 1M tokens) for email classification. Each email uses 300 input tokens and 20 output tokens. At 10,000 emails/day, what's the monthly AI cost? What if you switch to GPT-6 Luna ($0.10/$0.50)?
Sol per email: 300/1M × $2.00 + 20/1M × $10.00 = $0.0006 + $0.0002 = $0.0008. Times 10,000 emails × 30 days = 300,000 emails: $240/mo. Luna per email: 300/1M × $0.10 + 20/1M × $0.50 = $0.00004, so $12/mo. $8 and $0.40 forget the 30 days; $480 doubles the output price; $2,400 slips a decimal. The 20x gap is the lesson: use the cheapest model that handles the task.
Platform Pricing Comparison
| Platform | Model | 1K exec/mo | 10K exec/mo | 100K exec/mo |
|---|
| Zapier | Per task | $20 | $103 | $799+ |
| Make | Per operation | $11 | $105 | $599+ |
| n8n (cloud) | Per execution | $20 | $50 | $200 |
| n8n (self-hosted) | Flat (infra only) | $30 | $30 | $50 |
| Dify (self-hosted) | Flat (infra only) | $30 | $30 | $50 |
ROI Calculation
ROI = (Manual Cost − Automation Cost) / Automation Cost × 100
Example:
Manual: 7 min/email × 5,000 emails/day = 583 hours/month
At $25/hour: $14,583/month in labor
Automation: $273/month (API) + $50/month (infra) = $323/month
ROI = ($14,583 − $323) / $323 × 100 = 4,415%
Cost Optimization Strategies
| Strategy | Savings | How |
|---|
| Model downgrading | ~20x | Use GPT-6 Luna instead of GPT-6.1 Sol for classification |
| Caching | 30–60% | Cache classification results for identical emails |
| Batch processing | 20% | Batch multiple items in one API call |
| Token limits | 15% | Set max_tokens to prevent runaway generation |
| Pre-filtering | 40% | Use deterministic rules before AI (regex, keywords) |
| Local models | 100% (API) | Use Ollama for simple tasks; pay only for infra |
This lesson is free
You've read the first 2 sections. The rest covers Build, Check Yourself, Key Terms & Next. A free account opens all of it, with its practice questions and its lab. No card.
Create a free account — the opening phases of 29 of 35 courses, and the first lesson of every phase, are free, no credit card.
Browse all courses · View pricing · DeVenture Academy