> ## 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.

# The flow editor

> Edit a categorizer visually — categories, branches, and actions on a canvas — then test it on a sample email before trusting it on real mail.

The flow editor is the visual way to build and tune a categorizer. Instead of a settings form, you see your whole rule set laid out as a left-to-right flow: the categorizer fans out into **categories**, categories can fan out into conditioned **branches**, and each category or branch ends in one or more **actions**.

You open it by clicking a categorizer node on the [System Visualisierung](/user-guide/inbox/system-visualization), or any **Open in editor** button. Click **+ Kategorie** there to start a brand-new one.

## Reading the canvas

The flow runs left → right:

```
Categorizer  →  Category  →  (Branch with condition)  →  Action
                          →  Action (no condition — fires for every match)
```

* The **categorizer** node on the far left is the root — click it to edit the name, model, prompt, mailbox scope, knowledge, and confidence preset.
* Each **category** node is one label the AI can assign an email to.
* A **branch** node only appears when it has a condition on it. A branch with no condition is invisible — its actions attach straight to the category. So a categorizer with no conditional logic just looks like *category → actions*.
* **Action** nodes are the things that happen (archive, draft a reply, send an email, fire a webhook…).

Drag any node to rearrange the layout; positions are saved on the categorizer, so a teammate opening it later sees the same canvas. **Reset** (in the canvas controls) clears your manual positions and re-runs the automatic layout.

### Categories with multiple branches render as a switch

When a category has **more than one branch**, it no longer fans out into separate branch nodes — it renders as a single **switch card** so the whole decision is readable at a glance. The card shows:

* A header with the **category name**.
* **Numbered condition rows**, evaluated **top to bottom — first match wins**. Each row has its **own output dot** on the right that leads to that branch's action chain.
* A default **"Sonst (alle übrigen)"** row at the bottom that catches everything no row matched, with its own output dot.
* A **"+ Zweig hinzufügen"** button right on the node to add another branch.

Click a row to select and edit that branch (its condition and actions) in the side panel. A category with no conditions (or a single unconditional branch) still renders as a plain *category → actions* flow. See [Conditions & branches](/user-guide/inbox/conditions-branches).

## Editing nodes

Click any node to open its side panel on the right.

<AccordionGroup>
  <Accordion title="Categorizer">
    Name, the AI prompt and model, which mailboxes it covers (and whether it also runs on widget chats), knowledge sources, and the confidence preset (Vorsichtig / Standard / Aggressiv).
  </Accordion>

  <Accordion title="Category">
    The label the AI matches against and an optional description that tells the AI when to pick it. Write descriptions about intent, not keywords.
  </Accordion>

  <Accordion title="Branch">
    A condition the email must meet before the branch's actions fire — sender, subject/body text, attachments, known contacts, or a minimum confidence. See [Conditions & branches](/user-guide/inbox/conditions-branches).
  </Accordion>

  <Accordion title="Action">
    The action type, its mode (**automatisch tun** vs **nur vorschlagen**), and any action-specific config — the notification recipients + channels for *Benachrichtigung* (recipients picked in a multi-select with avatars; in-app / email / Slack-Teams webhook), ticket priority, the recipient and body for *Send email*, the note for *Forward email*, and so on. All the dropdowns here are searchable. The *Send email* / *Forward* recipient is always a **contact** — use the **Neuer Kontakt** button in the recipient dropdown to create one on the spot without leaving the editor.
  </Accordion>
</AccordionGroup>

### Adding categories, branches, and actions

Select a node to reveal the quick-add bar at the bottom of the canvas:

* With the **categorizer** selected → **Kategorie hinzufügen**.
* With a **category** selected → add a **Verzweigung** (branch), or add an action directly (Kontakt anlegen, Archivieren, Antwort entwerfen, Benachrichtigung, E-Mail senden, Weiterleiten).
* With a **branch** selected → add an action that fires only when that branch's condition matches.

Deleting a category, branch, or action always goes through a confirmation. Removing a branch doesn't lose its actions — they fall back to firing for every match on the category instead.

### Building a chain of actions

A category's actions run as a **chain, top to bottom** — that's the sequence. To build one, select the category and add actions (Archivieren, E-Mail senden, Benachrichtigen, …); they line up in order. **Reorder with the ↑/↓ arrows** on a node's panel — there's no order number to manage, the position *is* the order.

Action nodes are colour-coded by what they do: **archive = amber**, **hard-delete = red**, replies/drafts = green, send/forward = blue, notify = violet.

### Letting several categories share one chain

To make two categories end in the **same** chain (e.g. *Spam* and *Newsletter* both archive, or both run *Ticket → Antwort entwerfen*), drag from the second category's **right-edge dot onto the first action of the chain** you want it to share. That category now runs the same shared actions from that point on — one set of action nodes, fed by both categories. Editing a shared action (or reordering the chain) updates every category that feeds it; you maintain the sequence in one place.

Dragging onto an action **replaces** whatever the source category had there — it's converging onto the shared chain, not adding a duplicate.

### Actions see each other

Because the chain runs in order, each step is handed a short record of what the earlier steps did. So *Kontakt anlegen* links the sender first, then *Unternehmen recherchieren* writes the company research, and a *Antwort entwerfen* / *Ticket erstellen* placed after them knows a contact and company exist and can reference that research. For AI-bodied **E-Mail senden**, the action panel shows a **Prompt-Vorschau** of the instruction plus the context (sender, subject, summary, previous steps) the system adds at send time.

### Order warnings & auto-fix

Because actions depend on the steps before them, the editor flags an order that breaks a dependency:

* **Unternehmen recherchieren** *requires* **Kontakt anlegen** before it — a **hard warning** with a **one-click auto-fix** that inserts/moves the contact step. Without it, the research is skipped at runtime.
* **Antwort entwerfen**, **Mit KI antworten**, and **Ticket erstellen** show a **softer tip** suggesting you place **Unternehmen recherchieren** before them to enrich what they produce.

See [Action order & dependencies](/user-guide/inbox/categorizers#action-order--dependencies) for the full rules.

## Saving and discarding

Edits are held in memory until you save — an **Ungespeichert** badge appears the moment something changes.

* **Save** (or <kbd>⌘</kbd>/<kbd>Ctrl</kbd> + <kbd>S</kbd>) writes the whole flow at once.
* **Verwerfen** (Discard) throws away unsaved changes and restores the last saved version — no page reload needed.

<Note>
  Categorization runs **automatically on new mail** once the categorizer is saved. There's no "apply to inbox" button in the editor — when you save (or first connect a mailbox), InboxMate also backfills recently-received threads in the background, so a change takes effect on mail that's already sitting there without any manual step.
</Note>

## Test on a sample email

Before trusting a rule on real mail, click **Test**. Paste in a sample — sender, subject, body, and whether it has an attachment — and InboxMate dry-runs the full classification path **without saving anything or firing any action**. You get back:

* The category that matched (and which branch, if any).
* The AI's confidence and whether it cleared the categorizer's match threshold.
* The AI's summary and reasoning.
* The **planned actions** — each shown with its configured mode *and* its effective mode. An action set to "auto" downgrades to "suggest" here when confidence falls between the match and auto thresholds, so you see exactly what would happen.

Use it to confirm a new branch matches the senders you expect, or that a tightened description doesn't accidentally pull in the wrong mail.

## Backfilling existing mail

New rules apply automatically to every email that arrives *after* you save them — there's nothing to press. On top of that, saving a categorizer (and connecting a new mailbox) backfills recently-received threads (about the last two weeks) in the background, so a change takes effect on mail that's already in the inbox. The backfill **skips threads this categorizer has already classified**, so re-saving never double-processes the same mail.

## Trace mode — see the path an email took

You can replay the exact route a real email (or chat) took through a categorizer's nodes. Open trace mode from any of these:

* The **Letzte Läufe** popover on the [System Visualisierung](/user-guide/inbox/system-visualization#letzte-l%C3%A4ufe-recent-runs) toolbar — click a run to open its categorizer in trace mode.
* The **Im Flow ansehen** link in the categorizer's activity feed.
* The clickable **category badge** in a conversation's header (see [Inbox overview](/user-guide/inbox/overview#see-how-an-email-was-sorted)).

All three load the editor with `?traceType=…&traceId=…` in the URL. The canvas then:

* Dims every node the email *didn't* travel through.
* Colours the path it *did* take — green for actions that **executed**, amber for actions that were **suggested**, red for actions that **failed**.
* Shows the AI's summary of that email in a small legend overlay.

It's the fastest way to answer "why did this email get archived?" — you literally see the route through your rules. Click **Trace beenden** (or remove the URL params) to return to normal editing.

<Note>
  Trace mode is read-only — dragging and editing are locked while a trace is loaded, so you can't accidentally change a rule while inspecting one email's path.
</Note>
