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

# Conditions & branches

> Reference for branching a category into conditioned paths — match on sender, subject, body, attachments, contacts, or confidence, and run different actions per branch.

A plain category runs the same actions on every email that matches it. **Branches** let one category fan out into different paths — each with its own condition and its own actions. Use them when "Kundenanfrage" from your biggest client should behave differently from any other Kundenanfrage, or when an invoice with a PDF attached should be handled differently from one without.

You add branches in [the flow editor](/user-guide/inbox/flow-editor): select a category, click **Verzweigung**, then open the branch's side panel. The panel starts empty — click **+ Bedingung hinzufügen** to add one clause at a time (so you only see the fields you actually use), and remove any clause with its ✕.

## The switch card

A category with **more than one branch** is drawn as a single **switch card** node instead of separate branch nodes. The card lists each branch as a **numbered condition row** (evaluated top to bottom — first match wins), each with its own output dot leading to that branch's action chain, plus a default **"Sonst (alle übrigen)"** row for everything else. A **"+ Zweig hinzufügen"** button on the card adds a new branch, and clicking any row selects it for editing. This keeps the whole decision readable in one place rather than spread across the canvas.

## How branches are evaluated

<Steps>
  <Step title="The AI picks one category">
    Every email is classified into exactly one category first, as usual.
  </Step>

  <Step title="Branches are checked top to bottom">
    Within that category, InboxMate evaluates each branch in order. **First match wins** — once a branch's condition is met, its actions run and no later branch is considered.
  </Step>

  <Step title="The “else” branch catches the rest">
    A branch with no condition always matches. Put it last as your "Sonst" (else) fallback. A category's actions that aren't attached to any conditioned branch behave the same way — they fire for every match.
  </Step>
</Steps>

Reorder branches with the up/down arrows in the branch panel — order is what decides priority.

## Available conditions

A condition can combine any of the clauses below. With two or more clauses, a toggle at the top of the panel chooses how they combine: **Alle (UND)** requires every clause to match (the default), **Mindestens eine (ODER)** fires the branch if any single clause matches. Within a single clause that takes a list, **any one entry matching is enough** — so `senderDomainIn: [a.de, b.de]` matches an email from either domain regardless of the AND/OR setting.

| Condition              | Field in the panel        | Matches when…                                                           |
| ---------------------- | ------------------------- | ----------------------------------------------------------------------- |
| **Sender email**       | Absender-E-Mail           | the sender is one of the listed addresses                               |
| **Sender domain**      | Absender-Domain           | the sender's domain is one of the listed domains (e.g. `firma.de`)      |
| **Known contacts**     | Bekannte Kontakte         | the sender is one of the selected CRM contacts                          |
| **Subject contains**   | Betreff enthält           | the subject contains the given text                                     |
| **Body contains**      | Inhalt enthält            | the message body contains the given text                                |
| **Has attachment**     | Nur wenn Anhang dabei ist | the email has at least one attachment                                   |
| **Minimum confidence** | Mindest-Konfidenz         | the AI's classification confidence is at or above the given value (0–1) |

<Info>
  Leaving the **"Diese Verzweigung greift nur bei Bedingung"** checkbox off turns the branch into the unconditional "always" / else fallback. Tick it to reveal the condition fields above.
</Info>

## Worked examples

<AccordionGroup>
  <Accordion title="VIP customer gets a notification, everyone else gets a ticket">
    On the **Kundenanfrage** category:

    1. **Branch — "Großkunde"**: condition *Absender-Domain = grosskunde.de* → action **Benachrichtigen** (auto) + **Antwort entwerfen**.
    2. **Branch — "Sonst"** (no condition) → action **Ticket erstellen**.

    Because first-match wins, mail from `grosskunde.de` takes the first branch; everything else falls through to the ticket.
  </Accordion>

  <Accordion title="Only treat it as an invoice if a PDF is attached">
    On the **Rechnung** category:

    1. **Branch — "Mit Beleg"**: condition *Nur wenn Anhang dabei ist* **and** *Betreff enthält "Rechnung"* → action **Weiterleiten** to accounting.
    2. **Branch — "Sonst"** → action **Antwort entwerfen** (ask for the missing document).
  </Accordion>

  <Accordion title="Only auto-act when the AI is very sure">
    Add **Mindest-Konfidenz = 0.9** to a branch so its actions only run when the AI is highly confident, and let a lower-confidence "Sonst" branch merely suggest instead. This is a per-branch safety net on top of the categorizer's global confidence preset.
  </Accordion>
</AccordionGroup>

## A note on attachments

InboxMate sees an attachment's filename, type, and size — not its contents. So *"only when a PDF is attached"* works reliably, and you can match on the subject or filename wording, but a condition can't depend on what's *inside* the file.

## Relationship to the confidence preset

Branch conditions don't replace the categorizer's [confidence behaviour](/user-guide/inbox/categorizers#confidence-behavior) — they stack with it. The preset still decides whether a match is confident enough to act on at all, and whether an "auto" action fires or merely gets suggested. A branch's **Mindest-Konfidenz** is an extra, per-branch floor on top of that.
