Documentation · Build the client's app

Make it behave

Rules, workflows, watchers and escalations.

Audience: consultant. Prerequisite: Build the app.

The same checks this page relies on for rules and watchers also check definitions and reporting timezones — see Ship it. Two widgets claiming one term while computing it differently refuses a publish, as does a widget whose number differs from the term it claims (narrowing, grouping or sorting the term’s measure is fine), and a date bucket that reports in a different timezone from the rest of the app without saying why. An incomplete definition, and an app that has not declared its reporting timezone yet, only report.

An app that only stores data is a database with a nice front end. Behavior is what makes it worth deploying: it notices things, routes them to the right person, and moves work along without anyone watching.

All of this is Engagement ▸ Build.


The five mechanisms, and when to use which

MechanismFires whenUse it for
Rulea record changes“when a request is created, notify the ops manager”
Workflowa rule, an event, or a schedulemulti-step processes with waits and branches (an approval step can’t be added from the canvas yet)
Anomaly watchera metric moves oddly, on a schedule“refunds spiked”, “volume collapsed”
Surfacing rulea record matches a standing condition“these need a human”, ranked in Attention
Escalation chaina notification is not opened“if nobody responds in 15 minutes, tell the next person”

The mental model: detection proposes, rules act. A watcher notices; a rule decides what to do about it. Keeping them separate is why you can retune detection without rewiring notifications.

What the app does on its own

Build ▸ Behavior (/engagements/:id/build/behavior) is one list of everything the app does by itself — rules and workflows together — each read as a sentence: When an appointment is updated → Start escalation. Each says Live or Not live, and when it is not live, why (a workflow still in draft, a rule turned off). Open a row to edit it.

What you save here runs. New rule writes a rule, not a draft waiting for a second publishing step somewhere else — there is one place to author a rule and one meaning for “saved”.

Rules

New rule, on the Behavior list, opens the rule editor. It reads as the rule it builds:

  • When — a record type (Appointment, Pet, …) and what happens to it: created, updated, deleted, or an anomaly detected on it. A rule on created, updated or deleted must name its record type: the editor will not save it without one (Choose which records it watches.), and the list never shows such a rule as live.
  • Only if — optional; a condition over that record’s real fields.
  • Then — one or more actions: notify, set a field, assign, create a record, start an escalation, run a workflow. A field’s value takes that field’s own control — a choice list for a choice field, a number box for a number. A notification about a record reaches only the people who may read that record, and its words never show a field they cannot see — they get the plain wording instead. An escalation a rule starts reaches only the people who may read that record, at every step — a person on the chain who cannot read it is skipped — and it names the record only when everyone it reaches may read it.
  • Name — optional. Left empty, the rule is named by its own sentence. Its machine key follows the name and sits under Advanced.

A rule runs in the builder’s copy of the app the moment it is saved, while it is On. It reaches your client’s app with your next deploy, because a delivered app runs the rules it was deployed with. Saving says so, and a rule changed since the last Production deploy is marked Changed since last deploy in the list. Deleting one works the same way: it stops in the client’s app after your next deploy.

Every action the editor offers runs. A rule’s own write does not fire other rules (so a rule can never loop); a chain of steps is what a workflow is for. To tell another system about a record, use a flow’s Call webhook step (below).

On an anomaly, four of them. A rule on When an anomaly is detected offers notify, set a field, create a record and start an escalation. Assign and run a workflow are not offered there: an anomaly has no single record to assign, and the anomaly trigger already starts workflows itself.

Offered only if it runs. Require approval is not offered: approvals in a delivered app are not available from the builder yet. The editor does not offer On a schedule or When a business event happens either — nothing fires an app’s rule on those. For a schedule, build a multi-step flow, which can run on one. A rule that already carries something that does not run says so, in the editor and on the list.

Start escalation, an action in this editor, is the only control that points an escalation chain at anything.

Conditions, triggers and actions are written as words. The choices you read — “is greater than”, “is at least (≥)”, “when a record is created”, “Start escalation” — are the same words on every screen, never a stored code.

Automation follows a status’s lifecycle too. Where a choice field has a lifecycle, a rule’s Set field, a workflow’s Update record or Create record, an anomaly’s effect and a scheduled import move a record only along the moves it lists, and a new record starts in a starting value. Roles do not bind them; the moves do. A move the lifecycle does not list fails that step and is logged naming the rule or the run, and the record is left as it was. Automation never fills the “who moved it” fields — those name a person.

Scope an anomaly rule to a record type, too. One with no record type fires for every watcher — so with two watchers, each one’s anomalies notify both audiences. The wizards set it for you.

Recipients

A notify action addresses a role of this app, picked from the app’s roles, or an email address, typed. Each person holding the role gets their own notification.

There is no individual-person option. The app is built here and runs somewhere else, and a person’s account in the delivered app is created there — no person you could pick here is the same account in the app. Who holds a role is the client’s to change, without a redeploy. Assign likewise sets a field or a role, not a person.

Workflows (Behavior Canvas)

Build a multi-step flow, on the Behavior list, opens the canvas; so does any workflow’s row.

The canvas is the single workflow editor. A workflow runs only once it is published — the list says Not live — a draft until then. Nodes are typed and click-authored — you do not hand-write JSON. The palette offers conditions, record operations, email, attention-queue items, AI invocation, HTTP calls, variables and arithmetic, waits, and document-generation requests.

What starts a workflow — and where it runs

Every way of starting a workflow actually starts one:

  • On a schedule runs at its times, in the builder and in the delivered app. The first run is the next time after you publish it; it does not catch up on times it missed while dormant. Times are UTC (a UK summer 08:00 schedule runs at 09:00 local). You choose them by clicking — how often, which days, what time — the same picker a scheduled import uses; a schedule written some other way opens under Advanced and is kept exactly as written.
  • When an anomaly is detected runs when a watcher records a new anomaly, not one already on record. It narrows to the record type (or watcher) you pick. A record type no watcher watches can never start it. The canvas’s Records picker warns you and names the types that are watched, and the list shows Not live with the reason.
  • When someone runs it by hand has a Run now on its row in the Behavior list. That runs it here, in the builder. The client’s app has no button that can start a workflow, and the row says so.

What an Add to attention queue step raises is visible to the client’s own staff, on Needs attention in their app’s side rail (see Using your application). Each item can be marked done.

Branches, and the record that started the run

  • A condition has two exits, Yes and Otherwise. Draw from the exit you mean. The Otherwise path runs only when the condition does not hold.
  • A run started by a record can use that record. Beside a record step’s values, Insert… offers its fields (The record’s Title); typed, that is {{record.title}} (any field, plus {{record.id}}, {{record.createdAt}}), in a title, a message or a value; Calculate can use record.amount * 2. Update record and Delete record offer The record that started this run.
  • Call webhook sends that record — with its record type and what happened to it. Choose a saved connection and the connection decides the address and the method.
  • Has related record and Within time window read the record that started the run, so they mean the same thing in Simulate and in a real run.
  • User has role is not offered. Nothing that starts a run supplies the acting person’s roles, so it could never be true. A workflow that already carries one still opens.

Two honesty notes worth knowing before you promise a client something:

  • Request document records an auditable generation request. No file is rendered — there is no PDF render service yet. The node says so.
  • Invoke AI is metered, and its cost is recorded against whoever you attribute it to: a picker limited to this engagement or your firm as a whole — never another engagement.

Approvals

Approvals in a delivered app are not available from the builder today. The canvas cannot add a “wait for a person” step, and a rule’s Require approval action does not run. (Approval steps when you publish to production are a separate thing — that is your firm’s own release approval, covered in Ship it.)

What the engine does with such a step, should a workflow carry one (only a workflow created outside the builder can): the run pauses, the assignee gets an Action needed notification, and completing the task resumes the run. The delivered app has no screen yet to open or complete the task, so do not promise a client an approval flow. If the workflow behind a waiting task has been deleted, resuming fails loudly rather than hanging silently.

  • Name who decides. A wait step without an assignee is refused at publish, because its task would go to nobody.
  • A task is for its assignee. An app user can see and complete a task only when it is assigned to them, by name or by a role they hold, and they may read the record that started the run. So a region manager is only ever given their own region’s tasks. App admins see every task.
  • Cancelling a run closes its open task, so nobody is left holding a decision nobody is waiting for.

Anomaly watchers

Build ▸ Anomaly Watchers (/engagements/:id/build/anomaly-watchers).

A watcher is a metric over a record type, in a time window, with a detection method. Author it in the five-step wizard: Metric → Method → Tune & preview → Action → Save.

MethodFires when
Thresholdthe value crosses a fixed number
Rolling baselinethe value deviates from its own recent mean/median
Seasonalit deviates from the same point in previous cycles
Contextualit deviates from its peer group (per customer, per region)
Percentage changeit moves more than N% versus a prior window

Tune & preview replays the last 90 windows and shows you where the watcher would have fired. Use it. A watcher tuned without a preview is a guess.

Sustained windows

Threshold watchers have a Sustained windows setting. Leave it at 1 and the watcher fires on the first breaching window. Set it to 2 or 3 and the breach must persist that many consecutive windows before an event fires — which is how you stop a one-window spike from paging someone at 3am.

Editing a watcher

An existing watcher’s configuration is editable: open it and use Edit configuration, which reopens the same wizard with the watcher loaded. You never need to delete and recreate a watcher to retune it — doing so would throw away its detection history.

A watcher that notifies nobody

Detection alone changes nothing. A watcher needs a rule with a When an anomaly is detected trigger to turn a detection into a notification. There is no link to set on the watcher: every enabled When an anomaly is detected rule on the watcher’s record type (or on every record type) fires when it detects. The wizard’s Action step lists those rules under Rules that will fire, and lets you create one inline, scoped to the watcher’s record type. If there are none, the list says so, and the platform raises a configuration warning — a watcher that can detect but never notify is half-built, and it says so rather than looking healthy.

An anomaly rule’s notify goes out on the channels it names — PagerDuty or Slack as well as the bell, say; with none named, it is the bell and email. And it can start an escalation: “if the numbers go wrong and nobody opens it in 15 minutes, tell the next person” is a rule on the watcher plus a chain. That escalation reaches only the people who may read what the watcher counts — its record type and every field it uses — the same people who may open the anomaly itself.

Watchers run on their own

Deployed watchers are scanned on a schedule by the delivered app. Nobody has to click anything. That is the point: the app notices while everyone is asleep.

Run now counts what the schedule counts. Pressing Run now runs the watcher as the app’s own scan, not as you: your role and your clearance play no part, and you are recorded only as the person who started it. On a record type that carries a classification, a watcher therefore counts unmarked records only, however much you yourself are cleared to read. The events it records can be listed by anyone signed in to the app, so a count over marked records would disclose them.

An anomaly that is still going is one event, not one per scan. Each scan looks at the window ending now. When that window overlaps an event this watcher has already raised for the same group, it is the same anomaly seen again: the event is refreshed in place, keeps its acknowledged status, and does not notify again — so a watcher scanning hourly does not turn one anomaly into ten copies and ten alerts.

Surfacing rules

Build ▸ Surfacing Rules (/engagements/:id/build/surfacing).

Where a watcher asks “is this number strange?”, a surfacing rule asks “does this record need a human?” Matching records are ranked into Run ▸ Attention. A surfacing rule can also notify a role, using the same expansion the rule and watcher paths use.

Escalation chains

Build ▸ Escalation Chains (/engagements/:id/build/escalation-chains).

A chain is notify → wait → escalate: each step has recipients (at least one, each naming someone), channels (at least one — PagerDuty included), and a wait. If nobody opens the notification inside the wait, it climbs to the next step. Opening it, at any step, stops it climbing.

Each step’s recipients are the app’s roles, picked, or email addresses, typed — the same two kinds as a rule’s (above), for the same reason.

A chain a rule starts for a record names that record at every step: “Urgent work order needs a technician — WO-0012 (step 2)”, by the record’s display field. While a chain is running for a record, starting it again for the same record joins the one already running. So a rule that fires on every edit escalates a record once, not once per edit.

Notification routing — the part people get wrong

Routing is per event type, and the test of a correct routing is two-sided:

the right role receives it and every other role receives nothing.

Check both. A notification that reaches everyone is nearly as bad as one that reaches nobody — it trains the client to ignore the bell.

Channels (in-app, email, and the configured external channels) are set per step or per action. The in-app bell is always available; external channels need to be configured at Firm ▸ Platform ▸ Notification Channels.


What “done” looks like for Behavior

  • Every rule names its record type.
  • Every watcher has a preview you actually looked at, and a notify rule.
  • Every notification was tested two-sided (right role yes, other roles zero).
  • Nothing that acts on a schedule depends on you remembering to click it.
  • You have not promised the client a rendered PDF.