> ## Documentation Index
> Fetch the complete documentation index at: https://developer.opus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Decision Agent

> Automatically route your workflow down different paths based on conditions you define.

The Decision Agent lets your workflow make decisions automatically. You set up a condition (like "is variable `{amount}` over \$1000?"), and the workflow takes one path if it's true, and another if it's false.

## Key Capabilities

<CardGroup cols={2}>
  <Card title="Rule Builder" icon="list-check">
    Build conditions using logical operators—no coding required.
  </Card>

  <Card title="Natural Language" icon="message">
    Or just describe your condition in plain English.
  </Card>

  <Card title="Smart Comparisons" icon="filter">
    Compare dates, numbers, text, and yes/no values with the right operators.
  </Card>

  <Card title="True/False Output" icon="toggle-on">
    Outputs True or False to send your workflow down different paths.
  </Card>
</CardGroup>

## Two Ways to Set Conditions

Each condition can be either a logical expression or natural language. You can add multiple conditions and combine them with AND or OR.

<Tabs>
  <Tab title="Logical Expression">
    Build your condition by selecting three things:

    | Field         | What It Does                           |
    | ------------- | -------------------------------------- |
    | **Source**    | The variable you want to check         |
    | **Operation** | How to compare it (see options below)  |
    | **Value**     | The reference value to compare against |

    **Available operations:**

    * Equals / Not Equals
    * Contains / Not Contains
    * Starts With / Ends With
    * Is Empty / Is Not Empty
    * Is Null / Is Not Null

    **Best for:**

    * Important decisions that need to be auditable
    * Precise conditions that must work the same way every time
  </Tab>

  <Tab title="Natural Language">
    Toggle on "Natural Language" and describe your condition in plain English.

    **Examples:**

    * "If the amount is greater than 10000"
    * "If the risk score indicates high risk"
    * "If the document contains sensitive keywords"

    **Best for:**

    * Quick prototyping
    * Simple conditions

    <Warning>
      For important decisions, use Logical Expression instead. Natural language can sometimes be interpreted differently than you expect.
    </Warning>
  </Tab>
</Tabs>

## Output

The Decision Agent produces these outputs:

| Output                   | What It Contains                                         |
| ------------------------ | -------------------------------------------------------- |
| **Final Decision**       | True or False—the combined result of all your conditions |
| **Condition 1, 2, etc.** | True or False for each individual condition              |

<Note>
  Make sure you connect both the True and False paths to something. If you leave one unconnected, your workflow might not work correctly.
</Note>

## How to Add a Decision Agent

<Steps>
  <Step title="Drop it into your workflow">
    Drag a Decision Agent into your workflow.
  </Step>

  <Step title="Choose your mode">
    Pick Logical Expression or Natural Language.
  </Step>

  <Step title="Write your condition">
    Set up what you want to check—like "amount greater than 1000" or "status equals approved".
  </Step>

  <Step title="Connect both paths">
    Wire the True output to one path and the False output to another. Make sure both are connected.
  </Step>

  <Step title="Test it">
    Run a preview with test data to make sure both paths work as expected.
  </Step>
</Steps>

## Tips for Better Results

<AccordionGroup>
  <Accordion title="Use Rule Builder for important decisions">
    Rule Builder gives you:

    * Clear logic you can audit later
    * Consistent behavior every time
    * Easier troubleshooting when something goes wrong
  </Accordion>

  <Accordion title="Always connect both paths">
    If you leave the True or False path unconnected:

    * Your workflow might get stuck
    * You might get unexpected results
    * Even if one path doesn't need to do anything, connect it to something
  </Accordion>

  <Accordion title="Test both outcomes">
    In preview mode, run tests that trigger both True and False:

    * Make sure the True path does what you expect
    * Make sure the False path does what you expect
    * Check that the right data flows to the next steps
  </Accordion>
</AccordionGroup>

## Common Use Cases

### High-Value Items

Send big transactions to manual review:

```
Condition: amount > 10000
True → Manual review
False → Process automatically
```

### Status Checks

Take different actions based on approval status:

```
Condition: status equals "approved"
True → Proceed to fulfillment
False → Send rejection notice
```

### Overdue Items

Flag items that missed their deadline:

```
Condition: deadline before today
True → Mark overdue, escalate
False → Continue normally
```

### Risk Levels

Route risky items to the right team:

```
Condition: risk_level equals "high"
True → Send to compliance
False → Standard processing
```

## Related

<CardGroup cols={2}>
  <Card title="Human Decision Agent" icon="user" href="/tasks/agent/human-decision-agent">
    Let a person make the decision instead of automated rules.
  </Card>

  <Card title="Agentic Review" icon="robot" href="/tasks/review/agentic-review">
    Have AI review and auto-correct outputs.
  </Card>

  <Card title="Workflows" icon="diagram-project" href="/guides/workflows">
    Learn how all the pieces fit together.
  </Card>

  <Card title="Builder" icon="hammer" href="/guides/builder">
    Master the workflow design environment.
  </Card>
</CardGroup>
