Model Rules and Automations

Intermediate

Check your model against your own rules, and let it react to changes with automations: both managed in the navigator.

Model rules check your model against your own standards, such as "every process has an owner". Automations let the model react when something changes, for example by emailing the owner when a ticket is marked done. Both live in the navigator, in the Rules and Automations sections.

Not to be confused with display rules in a type's Display section, which only change how elements look (see The Display Section: Fields and Rules).

Create a rule

  1. In the navigator, click + and choose New Rule. (The Rules section only appears once the model has a rule.)
  2. In the properties panel, give it a Name. Names are unique, because each finding names its rule.
  3. Under Applies to, choose a node or relationship type. Subtypes are included. Use Only elements in to limit it to a filter.
  4. Write the Check. It runs once for each element, which it calls el. Return true when the element is fine, false to report the Message, or a text to report that text instead. Example: el.has_prop("Owner") reports every process that has no owner.
  5. Choose a Severity and a Mode:
    • Report: findings appear when you run the check.
    • Enforce: a change that would make an element break the rule is also refused.

The check is saved as soon as it is correct, and the panel tells you while it isn't.

Test this rule checks the whole model against this one rule straight away, even when the rule is switched off, and shows the findings in Admin → Checks. To check against everything, open Admin → Checks and click Run check.

Lock a rule

Click Lock rule to protect a rule that others rely on. A locked rule can't be edited or deleted, but you can still switch it on and off with Enabled. Click Unlock rule to edit it again. Anyone who can edit the model can do that: the lock prevents accidents and is not a permission.

Organise rules and automations

Rules and automations work like the other items in the navigator:

  • Folders: right-click the Rules or Automations section and create a folder, then drag items into it.
  • Order: drag an item up or down to put it where you want it, or use the section's sort menu.
  • Tags: add tags in the properties panel to find related rules and automations again.
  • Duplicate: right-click an item and choose Duplicate to start from a copy. A copied rule is never locked, and a copied automation starts switched off.

Create an automation

  1. In the navigator, click + and choose New Automation.

  2. Choose the type it watches under Applies to.

  3. Under When, pick the trigger:

    • A property changes, optionally to one particular value (Status changes to done)
    • A condition becomes true, written as a check like the one in a rule
    • A rule starts failing or passing
  4. If you like, tick Ask for approval first. The automation then opens a comment thread with your question on the element, and runs its actions only once the thread is decided.

  5. Under Actions, click + Add action… and add one or more, which run in order:

    • Leave a note: a comment on the element
    • Set a property
    • Call a webhook: one of the model's on-demand webhooks (from the model settings)
    • Ask the AI (prompt): choose where the answer goes:
      • Answer as a comment: opens a discussion on the element, for answers someone should reply to
      • Answer as a resolved comment: keeps the answer on the element without adding an open discussion to Admin → Discussions
      • Answer as an asset: attaches the answer to the element as a Markdown file
      • Don't store the answer: only passes it on to the next action, such as an email. The run log still shows it.
    • Send an email: to the owner, to everyone with access, or to chosen people with access to the model. Leave the text empty to send the answer of the AI step before it.

    Texts can use placeholders such as {{el.label}}, {{el.auto_id}} and {{el.prop("Status")}}.

  6. Set Runs per hour (at most) so that an automation can't fire on every single edit.

The automation is saved as soon as every field is filled in. Until then, the panel shows Not saved yet and the last saved version keeps running.

See what automations did

Open Admin → Checks and switch to Runs, or click Show runs on an automation. Each run shows when it happened, the element, what changed, and each action's result: sent, failed, awaiting approval or not sent. For an AI step you also see its answer, and for an approval there is a link to the thread.

Good to know

  • Rules and automations can also be created and changed by the AI assistant and by tools connected over MCP.
  • Each Ask the AI step counts toward your AI calls, like a message to the assistant.
  • Each automation sends at most 20 emails a day, and only to people with access to the model.
  • Deleting a rule or automation can be undone. A deleted one also appears in Admin → Deleted, where you can restore it, together with its folder if you deleted that too.

This content was written collaboratively with AI.