Skip to content
ajan.io

Docs menu

On this page

Cost Management

Understand workflow costs and learn strategies to optimize spending while maintaining performance.

Understanding Workflow Costs

Workflows consume AI credits based on what they do. The main cost drivers are:

AI Agent Nodes

The biggest expense in most workflows. Costs depend on:

  • Model used: Larger models cost more than smaller ones
  • Input length: How much data you send to the agent
  • Output length: How much the agent generates
  • Tool usage: Web searches, code execution, and integrations add costs

Other Nodes

  • Web Search nodes: Small fee per search
  • Action nodes: Usually free (no AI involved)
  • Code/Condition/Loop nodes: Free (just logic)
  • HTTP requests and notifications: Free

Monitoring Costs

Per-Node Costs

After a workflow run, each node shows a cost badge in its footer. Hover over it to see:

  • Total cost for that node
  • Per-model breakdown with input/output tokens
  • Cost per model used

Per-Run Costs

View run costs in the Runs tab:

  1. Click on any run in the history
  2. See total execution cost
  3. Click individual nodes to see their cost breakdown

Workflow-Level Costs

The history panel shows aggregate stats:

  • Total runs
  • Nodes executed
  • Total cost (all-time)
  • Average cost per run

Setting Cost Limits

Protect yourself from unexpected charges in the workflow Settings panel:

Monthly Limit

Set a maximum spending cap for the workflow per month:

  1. Go to workflow settings
  2. Set Monthly Limit (e.g., \$100)
  3. New runs are blocked when the limit is reached
  4. Progress bar shows current spend vs limit

Per-Execution Limit

Prevent runaway costs from a single run:

  1. Set Execution Limit (e.g., \$5 per run)
  2. Run stops if it exceeds this amount
  3. Useful for catching issues with loops or large data

Hourly Rate Limit

Control how often the workflow can run:

  1. Set Max Executions Per Hour
  2. Prevents trigger floods from overwhelming your budget
  3. Useful for webhook-triggered workflows

Alert Thresholds

Get notified before hitting limits:

  1. Add custom alert amounts (e.g., $25, $50)
  2. Recipients with Spend alerts on get email and inbox when spend crosses each amount
  3. Built-in alerts at 80% and 95% of monthly limit

Notifications

Choose who is notified in Settings. Selections apply to email and inbox:

  1. Add people under Notifications
  2. Each recipient starts with Failures and Spend alerts on
  3. You can turn off one topic per person. Keep at least one on

Failures emails for published runs send at most once per hour. After that window, another email waits until a published run succeeds.

Cost Limits Hierarchy

Cost limits are enforced at multiple levels. Higher-level limits take precedence:

Workspace-Level Limits (Admin)

Admins can set workspace-wide limits in Settings β†’ Products β†’ Workflows:

SettingDescription
Workspace Spend CapMaximum total workflow spend. Applies to lifetime usage in trial workspaces and the current calendar month otherwise (default: €500)
Max Monthly Limit Per WorkflowCaps what users can set as their workflow's monthly limit
Monthly Run LimitMaximum workflow executions per month (based on plan)

When a workspace-level limit is reached, workflow executions stop regardless of their individual settings.

Admins get an in-app notification and an email when 50%, 90%, and 100% of the workspace spend cap are reached.

Workflow-Level Limits (User)

Users can set limits per workflow (within admin constraints):

SettingDescription
Monthly LimitCapped by admin's "Max Monthly Limit Per Workflow" setting
Per-Execution LimitStops a single run if it exceeds this amount
Hourly Rate LimitMaximum executions per hour

Optimization Strategies

Choose the Right Model

Don't use premium models for simple tasks:

TaskModel Choice
Extract email from textSmaller/faster model βœ…
Complex reasoningLarger model βœ…
Date formattingCode node (free) βœ…

Optimize Agent Prompts

Shorter, clearer prompts cost less and work better:

text
Analyze this feedback. Return:
- Sentiment: positive/neutral/negative
- Urgency: low/medium/high
- Key issue (1 sentence)

Feedback: {{trigger.output.message}}

Use Code for Simple Transformations

Don't use AI for tasks that code can handle:

Free with Code Node:

javascript
const date = new Date(trigger.output.date);
return {
  formatted: date.toISOString().split('T')[0]  // YYYY-MM-DD
};

When to use code instead of AI:

  • Date/time formatting
  • Mathematical calculations
  • Data filtering and sorting
  • String manipulation
  • JSON parsing/formatting

Cost-Effective Patterns

Smart Filtering

Filter data before sending to AI:

text
Trigger (100 items) β†’ Code: Filter relevant items (20 items)
                    β†’ Agent: Process 20 items (not 100)

Progressive Enhancement

Start cheap, escalate only if needed:

text
Data β†’ Quick check (code) β†’ [SIMPLE] β†’ Done
                          β†’ [COMPLEX] β†’ AI analysis

Estimating Costs Before Launch

1. Count Expected Runs

  • Forms: Expected submissions per month
  • Scheduled: Runs per day Γ— 30
  • Webhooks: Events per month from integration

2. Test with Real Data

Run 5-10 tests and check the cost badges:

text
Average cost per run: $0.13
Expected monthly runs: 1,000
Estimated monthly cost: $130
Add 20% buffer: $156

3. Set Appropriate Limits

text
Monthly limit: $200 (includes buffer)
Per-run limit: $1.00 (catches anomalies)
Hourly rate: Based on expected trigger frequency

Next Steps

  • Agent Node β€” Understand agent node costs and optimization
  • Code Node β€” Use code for free transformations

FAQ

Workflow cost depends on model usage, number of runs, selected models, input size, output length, and any AI-heavy nodes. Long prompts, repeated loops, and large retrieved files can increase cost.

Use the smallest model that works, keep prompts focused, avoid unnecessary loops, limit large file or knowledge retrieval, and test workflows with sample data before running them at scale.