Elbuz emails or texts a customer, changes a status or creates a document once something happens to a document or contact. Set the event, condition and command once — then it runs by itself.
When you need this:
- A website order arrives — the customer gets a confirmation email.
- An invoice is overdue — a daily reminder goes out until a payment date is entered.
- A manager sets a given status — the customer gets an SMS right then.
- An order reaches shipping — a sales invoice with the same items appears.
Where to start: your first rule in seven steps — document list → header menu → “Automatic rules”.
What automatic rules can do
A rule is made up of an event, a condition and a command. Each part has its own article.
- Twelve events — the rule waits for a document to be created, saved or posted, for a contact to change, or for a payment to become overdue.
- A condition from the builder — the rule filters records by the fields of your list and can react specifically to a status change.
- Eleven commands — email, SMS, task, new document or contact, field changes, HTTP request, starting a flow.
- Formulas in field values — a value the app calculates on its own for each record.
- Protection against repeats — a command runs once per record, or no more often than a set interval.
- Testing and the log — a rules diagram with warnings, an “Operation log” entry for every command, and cleaning up the results.
How it works
A rule has three parts, and each answers its own question. The event — when to check. The condition — whether this record matters. The command — what to do. A rule can have several commands; they run one after another in “Execution order”.
- Action or result
- Decision: the path depends on the answer
1
Event2
Check interval3
Active- Event — chosen once when the rule is created and never changed afterwards.
- Check interval — 0 means the rule fires once per record and never again; the unit list is next to it.
- Active — the rule switch, currently off.
The key thing to understand from the start: commands run synchronously, in the same request that saved the record. No queue, no delay. Click “Save” in an order card and the email is sent before the window closes. There's one exception: the “Run flow” command starts a background run and doesn't wait for it to finish.
Second: the event fires on any save of a record, wherever it comes from — the card, the list, an import, an integration, cron or another rule. A trigger can't tell “a person clicked a button” from “a file was imported”.
Schedules and triggers are two separate mechanisms. A schedule answers “when to start” and watches the clock; a trigger watches the data and fires on what was done to it.
They share exactly two things: the system schedule that checks documents every 32 minutes (more on it), and the “Operation log”, where both write their results. For time-based runs, see the separate article on schedules and the job queue.
Your first rule in seven steps
Rule: “email the customer about a new order”
Scenarios
Test each scenario on a single record with a narrow condition first, as described in the section on mass firing.
A confirmation email for every new order
Goal: the customer gets an email when their order arrives in the app from your website.
- Event: “Document: add”.
- Condition: “Document type” equals “Customer order”.
- Command: “Send mail” with a completed template.
- “Check interval”: 0.
Result: the email goes out at the end of the same website order import that created the order. An order added by hand from the document list won't get an email: the create event raised by manual adding carries no document number, so the rule skips that record.
Later saves of the order don't send the email: “Document: add” fires only once per order. For the same reason, an email that didn't go out — no mailbox or an empty recipient — won't be retried on its own: the “Operation log” will show “Failed!”, and there won't be another add event for that order.
Reminders about an unpaid invoice until it's paid
Goal: a customer who hasn't paid by the due date gets a reminder, and the reminder repeats until the payment arrives.
- Event: “Document: payment overdue”. The app fills in the sample condition “Pay by” less than
{current_date}itself; to send emails only after three days overdue, change the value to{current_date-3day}. - Command: “Send mail”.
- “Check interval”: 1, “Unit” — days.
Result: every 32 minutes the system schedule picks documents whose “Pay by” date passed no more than 90 days ago and have no payment date — up to 300 of the newest per run — and the rule sends an email for each.
The repeat is counted from the time of the email: the log entry is cleared once a full day has passed since sending. So an email sent on Monday is repeated on Tuesday, in the first schedule run after 24 hours have passed.
What won't happen: a document with a payment date entered drops out of the filtered set, and reminders for it stop. They also stop once more than 90 days have passed since “Pay by”. If the system schedule row is turned off in the account, no emails go out at all.
An SMS when an order moves to a specific status
Goal: the customer gets an SMS at the moment a manager moves the order to a specific status, not every time the card is saved.
- Event: “Document: update”.
- Condition: “Document status” does not equal “Initial value” and “Document status” equals the status you need.
- Command: “Send SMS”.
- “Check interval”: 0.
Result: the SMS goes out when the status is changed to the one you need and the document is saved. Saving without a status change doesn't send an SMS. If the status moves to another one and then comes back, the SMS is sent again: when the field changes, the trigger log for that document is cleared.
The system schedule also raises “Document: update” — for unposted documents from the last 30 days, without the “before save” state. Here the current status stands in for the “Initial value”, so “status does not equal Initial value” isn't met and the schedule sends no SMS. The message goes out only when the status really changed on save.
A sales invoice from an order without copying by hand
Goal: when an order reaches the shipping status, a sales invoice with the same items is created for it.
- Event: “Document: update”.
- Condition: “Document type” equals “Customer order” and “Document status” equals the status you ship from.
- Command: “Create document”: in the document type field — “Sales invoice”; if the invoice should also be posted — the posting field set to 1.
- “Check interval”: 0.
Result: the app creates a copy of the order as a “Sales invoice” with all items, linked to the order and numbered in that type's format. If posting is set, the invoice is posted and moves stock just like manual posting (about stock levels). Each order gets the invoice once: later saves of the order won't create a second copy.
What won't happen: without the document type field nothing is created — the “Operation log” will show “Failed!”.
FAQ
When exactly does a command run — right away or later?
Right away, in the same request that saved the record. There's one exception — the “Run flow” command: it starts a background run and doesn't wait for it to finish.
Why did a rule fire once and never again?
The app remembers every “command + record” pair and won't run the command a second time. To allow repeats, set “Check interval” above zero or add an “Initial value” item to the condition (about repeats).
What happens if several rules match one event?
They all fire, one after another, in “Execution order”, and by name when the order is the same. The first rule can't stop the ones after it.
Will a rule fire on documents that come from an import or from the website?
Yes. The event fires on every saved record, whoever saved it: a person, an import, an API integration or another rule.
Can I run a rule on a timer, for example every day at 3 a.m.?
No, a rule waits for data to change. Time-based runs are handled by the schedule and job queue. The exception is overdue payments and unposted documents: the system schedule goes through them every 32 minutes.
Can I attach a rule to a product, price list or category?
No. All twelve events relate to documents and contacts; there are no events for products, price lists or categories.
Can I undo what a rule has already done?
No. A sent email, a posted document and a changed record can't be rolled back. That's why a new rule is first tested on a single record with the narrowest possible condition.
Where to find it and who has access
This window has no menu item and no desktop shortcut. It opens only from the header of the list you're creating rules for, and that list decides which events you're offered: documents show document events, contacts show contact events.
- From the document list
- header menu → “Automatic rules”
- From the contact list
- header menu → “Automatic rules” (the “Triggers (system events, conditions, commands)” window)
- Message templates
- light bulb button in the header — a rule created here has no condition (see below)
- Access right
- the “Automatic rules” window; add, delete and edit are granted separately
- Prepare
- a mailbox for emails; the system schedule turned on for overdue payments
1
Automatic rules- Automatic rules — the only entry point to document rules, found in the Automation section of the additional operations menu.
In the rule list itself, three columns can be edited without opening the card: “Active”, “Title” and “Execution order”. Double-click a cell and the change is saved to the database at once, with no Save button. Other columns also open for editing but aren't saved: after you refresh the window, the old value is back.
A rule created from the “Message templates” window has no condition, so it fires on every single record.
From there the window opens without being tied to documents or contacts, and that link is where the condition fields come from: the builder in such a rule is empty, with nothing to build a condition from.
The app will still handle the event itself — it works out the record type from the event data — but it has no way to filter anything out. Create rules from the document list or the contact list, where the condition builder sees the fields of your list.
Access to the window opens all rules in the account, not just yours: there's no author filter. Clearing “Add”, “Delete” or “Edit” removes the matching header button or the grid pencil rather than showing an error. The “Rules diagram”, the rule card and command settings have no separate right — access is checked on the list. More: access rights.
Related topics
- If an action should run on a timer rather than on a data change — schedule and job queue.
- If you need automation for deals and manager tasks in — CRM automations.
- If not every employee should see the rules — access rights.
- If you build the condition on order statuses and fields — customer order.
