Skip to Content

🔄 Workflow Modes

HippoX provides four distinct workflow modes to handle different types of tasks. Each mode is optimized for specific scenarios, from simple one-off commands to complex production workflows.

🎯

Not sure which mode to use? Start with ReAct mode — it’s the most flexible. As you identify patterns in your tasks, you can switch to more specialized modes for better performance.


🔄 ReAct Mode (Think → Act → Observe)

How It Works

ReAct follows a continuous loop: the LLM thinks about the current state, executes a skill, observes the result, and decides the next action. This repeats until the task is complete.

The Loop:

  • Think — Analyze the current situation and what needs to be done
  • Act — Execute one atomic skill with appropriate parameters
  • Observe — Examine the result of the skill execution
  • Repeat — Go back to Think with the new information

When to Use

  • Open-ended tasks with unknown steps
  • Tasks requiring dynamic decision making
  • Error recovery and adaptive behavior
  • Multi-step reasoning
  • Exploratory or investigative tasks

Real-World Example

User request: “Find the largest file in my Downloads folder, check if it’s over 100MB, and if so, compress it and move it to Archive”

ReAct execution flow:

  • Step 1 — Think: Need to find files first
  • Step 2 — Act: Execute file_list on Downloads folder
  • Step 3 — Observe: Got list of 50 files with sizes
  • Step 4 — Think: Need to identify the largest one
  • Step 5 — Act: LLM determines which is largest from data
  • Step 6 — Observe: Found video.mp4 at 250MB
  • Step 7 — Think: 250MB is greater than 100MB, need compression and move
  • Step 8 — Act: Execute archive_compress on the file
  • Step 9 — Observe: Compression successful, file is now 80MB
  • Step 10 — Think: Now need to move to Archive
  • Step 11 — Act: Execute file_move to Archive folder
  • Step 12 — Observe: Move successful
  • Step 13 — Think: Task complete
  • Step 14 — Act: Return final answer to user

Pros and Cons

ProsCons
Flexible and adaptiveMultiple LLM calls (slower)
Can handle unexpected situationsHigher token usage
Built-in error recoveryLess predictable execution time

⚡ Batch Mode (Parallel Execution)

How It Works

Multiple independent skills are executed simultaneously. The LLM generates a batch plan once, then all skills run in parallel. Results are collected and returned together.

The Process:

  • Plan — LLM analyzes request and identifies all needed skills
  • Batch — All skills execute simultaneously
  • Collect — Results are gathered as they complete
  • Return — All results presented together

When to Use

  • Independent operations with no dependencies
  • Bulk data collection from multiple sources
  • Parallel API calls
  • Monitoring multiple systems at once
  • When you know all required steps upfront

Real-World Example

User request: “Show me my current CPU usage, memory usage, disk space, and network status”

Batch execution:

All four checks run at the SAME time. No waiting for one to finish before starting another. Results appear as they become available. Final response includes all four results.

What happens if one fails? Other skills continue executing. Failed skill’s error is reported, but successful results are still returned.

Pros and Cons

ProsCons
Fast — skills run in parallelNo dependency support
Single LLM callCannot pass data between skills
Great for dashboardsAll skills must be independent
Efficient for bulk operationsLimited error recovery

⛓️ Chain Mode (Sequential with Variable Passing)

How It Works

Skills execute one after another in a defined sequence. Each skill’s output can be passed as input to the next skill using variable references.

The Process:

  • Plan — LLM generates a linear sequence of skills
  • Execute Step 1 — Run first skill, save output as result1
  • Execute Step 2 — Run second skill, can reference result1
  • Execute Step 3 — Run third skill, can reference result1 or result2
  • Return — Final step’s output is returned to user

When to Use

  • Linear data transformation pipelines
  • When each step depends on previous output
  • ETL (Extract, Transform, Load) operations
  • Batch processing with order requirements
  • Multi-stage calculations

Real-World Example

User request: “Read data.csv, calculate the average of the sales column, then write the average to summary.txt”

Chain execution flow:

  • Step 1 — file_read on data.csv → output stored as csv_content
  • Step 2 — math_statistics using csv_content → output stored as average_result
  • Step 3 — file_write to summary.txt with content average_result

Variable reference format: {{variable_name}}

Where variables can be used:

  • Skill parameters
  • File paths
  • Email content
  • Any string field

Pros and Cons

ProsCons
Single LLM callLinear only — no branches
Clear, predictable flowCannot skip steps based on conditions
Variables enable complex pipelinesAll steps must succeed (or fail early)
Great for data transformationNo parallel execution

đź“‹ PlanAndExecute Mode (Conditional Workflows)

How It Works

A complete execution plan is generated upfront. The plan supports conditional branching, variable references, and sophisticated error handling strategies.

The Process:

  • Plan Generation — LLM creates a full workflow plan with conditions
  • Plan Validation — Engine validates plan structure
  • Execution — Engine executes steps, checking conditions at each branch
  • Error Handling — If a step fails, follow defined error strategy (retry, skip, or fail)
  • Completion — Return final result or last successful output

When to Use

  • Complex workflows with conditional logic
  • Production deployments requiring reliability
  • Tasks that need retry logic
  • When you want a complete execution plan upfront
  • Compliance or audit-heavy workflows

Real-World Example

User request: “Check disk space on production server. If below 10 percent, send alert email to ops team and clean up old logs. Otherwise, proceed with daily backup.”

PlanAndExecute execution plan steps:

  • Step 1 — disk_usage on /production, output_as: “disk_status”
  • Step 2 — Condition: if disk_status.available_percent is less than 10, then send_email to ops@company.com with subject “Low Disk Space Alert” and body containing the available percentage
  • Step 3 — Condition: if disk_status.available_percent is less than 10, then clean_old_logs keeping only 7 days
  • Step 4 — Condition: if disk_status.available_percent is greater than or equal to 10, then run_daily_backup

Error Handling Strategies

StrategyBehaviorUse Case
RetryAutomatically retry failed step up to N timesNetwork calls, temporary failures
SkipLog error but continue with next stepNon-critical operations
FailStop execution and report errorCritical operations, security tasks

Condition Operators

OperatorMeaningExample
eqEqual tostatus equals “success”
neNot equal tocount not equal 0
gtGreater thansize greater than 100
ltLess thanpercent less than 10
containsString containsmessage contains “error”

Variable Reference Syntax

Use $ref syntax to reference previous step outputs.

Example:

  • left: $ref to disk_status.available_percent
  • right: 10

Pros and Cons

ProsCons
Single LLM plan callPlan generation can be complex
Full conditional logicOverkill for simple tasks
Sophisticated error handlingRequires structured planning
Predictable executionLess flexible than ReAct
Great for productionHigher upfront planning cost

🎯 How to Choose the Right Mode

If you need…Use…
Maximum flexibility and adaptivityReAct
Speed and parallel executionBatch
Linear data transformationChain
Conditional logic and reliabilityPlanAndExecute
To explore an unknown problemReAct
To run a production workflowPlanAndExecute
To collect data from multiple sourcesBatch
To transform CSV to calculate to outputChain

🔄 Switching Between Modes

You can initialize HippoX with any mode:

ReAct mode (default) — use Hippox::new with your skills directory, provider, api_key, config

Batch mode — use Hippox::with_workflow_mode with WorkflowMode::Batch

Chain mode — use Hippox::with_workflow_mode with WorkflowMode::Chain

PlanAndExecute mode — use Hippox::with_workflow_mode with WorkflowMode::PlanAndExecute

đź’ˇ

Pro Tip: Start with ReAct mode during development. Once you understand the pattern of your task, you can optimize by switching to Batch, Chain, or PlanAndExecute for production use.

Last updated on