Skip to main content

Run Modes

Agent Actions supports two execution modes: online (real-time) and batch (cost-optimized).

Overview

ModeProcessingLatencyCostUse Case
onlineSynchronousReal-timeStandardInteractive, development
batchAsynchronousHoursUp to 50% savingsProduction, large datasets

Configuration

defaults:
run_mode: batch # or "online"

actions:
- name: my_action
run_mode: online # Override per-action
info

run_mode accepts the string values batch and online (case-insensitive). These map to the RunMode enum internally.

Online Mode

Requests process synchronously with immediate responses.

defaults:
run_mode: online

When to use:

  • Development and testing
  • Interactive applications
  • Small datasets (< 100 records)
  • Debugging workflows

Batch Mode

Requests queue for asynchronous batch processing with significant cost savings.

defaults:
run_mode: batch

When to use:

  • Production workloads
  • Large datasets (100+ records)
  • Cost-sensitive processing
  • Scheduled/overnight jobs

Provider Support

ProviderBatch APICost Savings
OpenAIYes~50%
AnthropicYes~50%
Google GeminiYesVaries
GroqYesVaries
MistralYesVaries
OllamaNo (local)N/A

Batch Commands

# Check batch status
agac batch status --batch-id batch_abc123

# Retrieve completed results
agac batch retrieve --batch-id batch_abc123

# Retry failed records
agac batch retry --batch-id batch_abc123

See batch Commands for complete CLI reference.

Mixing Modes

Override at the action level for hybrid workflows:

defaults:
run_mode: batch

actions:
- name: bulk_extraction
# Uses default batch mode

- name: interactive_validation
run_mode: online # Override for this action

See Also