# Rules

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

<Lead>
**Rules** take routine work off your hands: when something happens on a contact, the tool does something you defined beforehand. The guiding example: someone on your team sets the acquisition status in onOffice to "Lead disqualified", and the rule takes the contact out of the scan. Nobody has to remember it anymore.
</Lead>

## Creating rules

You find rules in the tool settings, in the **Rules** section. A rule consists of one trigger, optional conditions, and up to five actions; you create it in the editor. Three templates get you started: "On a new finding: create a task", "On an inbound inquiry: follow-up in 2 days", and "On a maintained status field: exclude from the scan". A template is a pre-fill of the editor, not a concept of its own: you can change every part freely before saving.

## Triggers

<DefinitionList>
  <DefItem term="An onOffice field changes its value">You pick the field freely from the fields of your account. The change is detected during the sync with onOffice: the first sync after activating learns the starting value and does not fire yet; the rule fires from the following one.</DefItem>
  <DefItem term="A new agent-log entry arrives">Optionally narrowed to specific action kinds, action types, and the direction (inbound or outbound). Without narrowing, every new entry counts.</DefItem>
  <DefItem term="The scan creates a finding">This means newly created findings. The weekly confirmation of a finding that is already open does not trigger the rule again.</DefItem>
  <DefItem term="A contact changes phase">The contact moves into a different phase of your pipeline.</DefItem>
  <DefItem term="A follow-up becomes due">The moment a follow-up becomes due is an event like any other and can trigger a rule.</DefItem>
</DefinitionList>

## Conditions

Conditions narrow down when a trigger actually leads to an execution. You can add several and choose whether all of them must match (and) or one is enough (or). Examples: the contact type is one you picked (or explicitly is not), an onOffice field has a certain value, the last contact is older than a number of days. Without conditions, the trigger alone is enough.

## Actions

Up to five actions per rule. Available:

- Move to a phase
- Assign an agent
- Create a follow-up
- Create a task
- Generate an AI briefing
- Exclude from the database scan
- Write the assessment to onOffice
- Ask the contact for current details (data request)

<Callout tone="note" title="Deliberately no message action">
There is no action that sends a free-form message to the contact, and that is on purpose. If you want to automate outbound messages, you need the upcoming expansion stage of the rules.
</Callout>

An AI briefing created by a rule costs credits just like one you create by hand: charged silently, as everywhere on the platform. The add-on includes only the database scans. All figures: [Cost and add-on](/tools/db-leads/kosten).

## Every rule starts paused

A new rule is **paused** after saving. You activate it with the switch in the list, and from then on it applies exclusively to **new events from that moment**. Whatever happened during a pause never fires afterwards: a backlog that runs all at once on activation would be an automation that surprises you with the past.

A rule only reaches your existing contacts through **Apply to existing contacts**. That runs in two steps: first a dry run shows how many and which contacts match the rule today, and nothing happens. Applying is a separate, deliberate click afterwards.

Your action-approval settings apply to rules unchanged: whatever is set to approval there lands in the approvals list and waits for your click instead of going out. Whatever you have switched off stays off, even when a rule initiates it.

## Log and automation block

Every rule keeps its own log, reachable via its three-dot menu: every hit with the outcome per action, including "waiting for approval" or "not permitted". In a contact's dossier, the **Automation** block shows what rules have done on exactly this contact.

## Limits

Rules react to events the tool sees. A field change in onOffice is therefore detected at the next sync, not in the second of typing. And: if you delete a rule, its log is deleted with it. Actions the rule has already executed (tasks, phases, exclusions) remain in place.

## Related

How findings come about: [Database scan](/tools/db-leads/datenbank-scan). What the tool costs: [Cost and add-on](/tools/db-leads/kosten). All settings sections: [Settings in detail](/tools/db-leads/einstellungen). Back to the [overview](/tools/db-leads).
