# Flows and Flow Studio

{/* AUTO-SYNCED SOURCE: this page lives in apps/app/src/modules/wa-bot/docs/ and is mirrored into the docs app by `bun sync:module-docs`. Edit it in the module, not in apps/docs. */}

<Lead>
A flow is a prepared conversation of your bot: greeting, questions, selection menus, actions. Eight standard flows are set up at installation and ready to use. In the **Flow Studio** you edit every flow as a card diagram or build your own, and the simulator shows you exactly what your customers would experience before you publish.
</Lead>

## The eight standard flows

Installation sets up these flows. Two of them are system flows (main menu and opt-out); the rest you can freely adjust or pause:

<DefinitionList>
  <DefItem term="Hauptmenü (main menu, system)">
    Trigger: "Startet jedes Gespräch" (starts every conversation). Greeting with bot disclosure, then the privacy notice, then a five-item menu: property info, viewing, selling, frequently asked questions, staff member. Needs no data source.
  </DefItem>
  <DefItem term="Objekt-Infos (property info)">
    Trigger: from the menu. The bot offers your active listings, shows a fact sheet with the key data and leads on to brochure or appointment. Needs at least one property in your property database.
  </DefItem>
  <DefItem term="Exposé-Versand (brochure delivery)">
    Trigger: by keyword "Exposé". Sends the brochure as a PDF in the chat, provided a brochure exists in the property documents. Without a stored brochure the bot hands over honestly to your team.
  </DefItem>
  <DefItem term="Besichtigung buchen (book a viewing)">
    Trigger: from the menu. Offers three real open slots from the booking tool, captures name and email and books bindingly. Requires the configured [booking tool](/tools/booking).
  </DefItem>
  <DefItem term="Immobilie verkaufen (sell a property)">
    Trigger: from the menu. Captures owner inquiries as a structured lead: property type, location, name, email. This creates a contact in the address book with fair assignment to your team. Needs no data source.
  </DefItem>
  <DefItem term="Häufige Fragen (frequently asked questions)">
    Trigger: from the menu. Answers with the approved entries from [Knowledge & FAQ](/tools/wa-bot/wissen), for example about availability, process and commission.
  </DefItem>
  <DefItem term="Mitarbeiter kontaktieren (contact a staff member)">
    Trigger: from the menu or by keyword "Mitarbeiter". Hands the conversation over to a colleague; it appears at the top of the [inbox](/tools/wa-bot/inbox).
  </DefItem>
  <DefItem term="Abmeldung (opt-out, system)">
    Trigger: STOP and related words. The legally required opt-out building block: immediate stop plus confirmation. Details under [Rules and privacy](/tools/wa-bot/regeln-und-datenschutz).
  </DefItem>
</DefinitionList>

<Info title="Honest start">
Installation only activates flows whose data source actually exists. The viewing booking waits for the booking tool, property conversations for your first listing. Such flows remain in **Entwurf** (draft) status and can be enabled later with one click.
</Info>

## The flow list

Under **Automation > Flows** (Automatisierung > Flows) you see all flows as cards. Each card shows two facts:

- **Status:** "Aktiv · v1" (published, with version number), "Pausiert" (paused) or "Entwurf" (draft).
- **Trigger:** "Startet jedes Gespräch" (starts every conversation), "Im Menü · Position 2" (in the menu at position 2), "Per Stichwort" (by keyword) or "Per Verknüpfung erreichbar" (reachable via link, meaning the flow is only jumped to from other flows).

Clicking a card opens the flow directly in the studio. The short code under the name is the handle other flows use to branch here.

## Creating a new flow

**Neuer Flow** (new flow) opens a gallery: start blank ("Von Grund auf selbst bauen.", build from scratch) or take one of the standard templates as a base and rework it freely.

## The Flow Studio

The studio is a card editor: every conversation step is a card, connections are lines. From the palette (the add menu at the bottom right) you drag or click new steps onto the canvas:

<DefinitionList>
  <DefItem term="Nachricht (message)">A bot text, optionally with up to three reply buttons.</DefItem>
  <DefItem term="Auswahlliste (selection list)">A WhatsApp list menu with up to ten rows.</DefItem>
  <DefItem term="Eingabe (input)">The bot asks for a detail, such as name or email, and validates it.</DefItem>
  <DefItem term="Aktion (action)">The bot does something: offer slots, send a property fact sheet, deliver a brochure, capture a lead. Actions have separate outputs for success ("Erfolgreich") and failure ("Bei Problem").</DefItem>
  <DefItem term="Zuweisung (assignment)">Defines who on the team is responsible: a fixed member or fair distribution (the member with the fewest open handovers).</DefItem>
  <DefItem term="Übergabe (handover)">Passes the conversation to a human; the bot pauses for this conversation.</DefItem>
  <DefItem term="Ende (end)">Ends the conversation cleanly.</DefItem>
</DefinitionList>

The canvas offers zoom (also with <Kbd>Ctrl</Kbd> + mouse wheel), a minimap at the bottom left, free panning and drag & drop for cards and connections. Undo and redo work from the toolbar or with <Kbd>Ctrl</Kbd>+<Kbd>Z</Kbd> and <Kbd>Cmd</Kbd>+<Kbd>Z</Kbd>.

### Saving and publishing

The studio autosaves your draft about two seconds after the last change ("Entwurf gespeichert", draft saved). **Speichern** (save) and **Veröffentlichen** (publish) are deliberately separate: changes only take effect after publishing; saving stores the draft. Until you publish, your bot keeps answering unchanged.

### System nodes are mandatory

The building blocks **Begrüßung** (greeting), **Datenschutz-Hinweis** (privacy notice) and **Abmeldung** (opt-out) are protected system nodes: they cannot be deleted, and a flow missing a mandatory node cannot be published. The error message reads, for example: "Der System-Knoten „Begrüßung“ ist Pflicht in diesem Flow und fehlt." (the system node "greeting" is mandatory in this flow and is missing). This keeps your bot compliant no matter how creatively you build.

## Checks and publishing

At the top of the studio a check chip shows the flow's state: "Fehlerfrei" (no issues), a number of warnings ("2 Hinweise") or a number of errors ("1 Fehler"). Warnings are non-blocking; errors block publishing (the publish gate). Typical errors:

- **Dead ends:** a step has no outgoing connection and is not an end, handover or jump.
- **Unknown targets:** a connection points to a step that no longer exists.
- **Unreachable steps:** a card is not reachable from the start.
- **Missing mandatory nodes:** greeting, privacy notice or opt-out are missing.
- **Missing required fields before booking:** the booking action needs details such as name and email captured earlier in the path. If the input step is missing, the check reports an error.
- **Unknown placeholders:** a free-typed placeholder the bot does not know is flagged as an error ("Unbekannter Platzhalter").

If publishing fails, the studio reports "Nicht veröffentlicht" (not published) and asks you to fix the flagged errors. On success, the flow is live immediately: "Der Flow ist jetzt live."

## Placeholders

In message texts you insert placeholders as chips with one click. The bot fills in the right values when sending; if a value is unknown it falls back to a neutral phrasing. These placeholders exist:

| Placeholder | Meaning |
| --- | --- |
| `bueroName` | Your office name from the settings or the company profile |
| `maklerName` | Name of the responsible team or contact person |
| `kundeName` | The contact's name, if known |
| `objektTitel` | Title of the selected property |
| `objektAdresse` | Address of the selected property |
| `objektPreis` | Price of the selected property |
| `objektFakten` | Multi-line fact sheet of the property (location, rooms, size, price) |
| `terminDatum` | Date of the selected appointment |
| `terminUhrzeit` | Time of the selected appointment |
| `erreichbarkeit` | Your availability text from the settings |
| `slot1`, `slot2`, `slot3` | Dynamic slot buttons: the three offered open appointments |
| `objekt1`, `objekt2`, `objekt3` | Dynamic property buttons: the listings offered for selection |

The dynamic button placeholders (`slot1` to `slot3`, `objekt1` to `objekt3`) are resolved at runtime; buttons without a resolved value are simply dropped when sending. Free-typed curly braces with unknown content are reported as an error by the check.

## WhatsApp limits

WhatsApp imposes hard limits which the studio checks as you edit (text fields show a character counter):

- At most **3 buttons** per message
- At most **10 rows** per selection list
- Button label: at most **20 characters**
- List row label: at most **24 characters**

## Simulator

The simulator opens right inside the studio and shows the conversation in WhatsApp look, driven by the real conversation engine. No real messages are sent.

- **Mode:** the **Aktionen gelingen** / **scheitern** switch (actions succeed / fail) controls whether actions like booking a slot or sending a brochure succeed or fail in the test. This lets you verify the honest handover paths too.
- **Time-lapse:** when the flow waits for a reply with a reminder timer, a chip such as "4h ohne Antwort" (4 hours without a reply) appears. Clicking it fast-forwards the wait and fires the reminder.
- **Neu starten** (restart): resets the simulation at any time.
- **Status:** below the conversation the state is shown: "tippt gerade …" (typing), "an Mitarbeiter übergeben" (handed over to staff), "Gespräch beendet" (conversation ended) or "abgemeldet" (opted out).

## Versions and rollback

Every publish creates a new version; the flow card shows it as "Aktiv · v3". Published versions are kept, so you can roll back to an earlier version at any time. Each flow can also be **paused** and **reactivated** without deleting it: the bot temporarily stops using a paused flow.

## Next steps

Test the finished flow in the simulator and then take the bot live via the [connection](/tools/wa-bot/verbindung). FAQ content is easier to maintain under [Knowledge & FAQ](/tools/wa-bot/wissen). If a flow refuses to publish, see [troubleshooting](/tools/wa-bot/troubleshooting). Back to the [overview](/tools/wa-bot).
