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

# Control Flow

> Understand how data moves through your Odella workflows

<Callout type="info">
  Control flow in Odella determines how data moves through your workflow and how different parts of your workflow are executed.
</Callout>

## How Odella Processes Your Workflow

Odella processes your workflow in two main steps:

### Step 1: Planning the Workflow

<Card title="Mapping the Journey" icon="map">
  Odella first looks at your entire workflow to understand how all the blocks are connected. It identifies where data enters your workflow (input blocks) and where it ends up (output blocks).
</Card>

### Step 2: Executing the Workflow

<Card title="Running the Process" icon="play">
  Odella then starts running your workflow, beginning with the input blocks. It processes multiple blocks at the same time when possible, making your workflow efficient.
</Card>

## Special Situations in Your Workflow

### Skipping Parts of Your Workflow

<Callout type="warning">
  Sometimes, parts of your workflow might be skipped based on certain conditions. This is called "control flow exclusion".
</Callout>

For example, if you have an "If" block in your workflow, and the condition isn't met, the blocks connected to the "false" path won't run. This helps your workflow make decisions and only execute the relevant parts.

### Handling Skipped Sections

Some special blocks in Odella can work with these skipped sections:

<CardGroup cols={2}>
  <Card title="If/Else Block" icon="code-branch">
    Chooses between two paths based on a condition.
  </Card>

  <Card title="Coalesce Block" icon="layer-group">
    Picks the first available value from multiple options.
  </Card>

  <Card title="Race Inputs Block" icon="flag-checkered">
    Uses the first result that becomes available.
  </Card>

  <Card title="Output Block" icon="arrow-right-from-bracket">
    Sends results out of your workflow.
  </Card>
</CardGroup>

### Loops in Your Workflow

<Card title="Loop Controller" icon="rotate">
  This special block allows parts of your workflow to repeat. It's designed to handle skipped sections carefully, ensuring your loop works as expected.
</Card>

<Tip>
  When using loops, it's a good idea to include checks (like an If/Else block) to make sure your loop doesn't unexpectedly stop due to skipped sections.
</Tip>

By understanding these concepts, you can create more sophisticated workflows that make decisions and handle different scenarios effectively.
