Build and switch on a custom rule
Build your own automation rule on the rule editor (what it watches, what starts it, which records qualify and what it does), save it switched off, try it on a real record with a dry run, then switch it on and check its runs.
Build and switch on a custom rule
A workflow rule does something for you when a record changes, on a timetable, or when someone presses a button: notify the accounts team when a booking is created, raise a task for the legal team, email the buyer, call another system. This guide builds a rule, saves it switched off, tries it against a real record, and then switches it on.
Before you start
- You need the Create permission on Workflow Rules to build a rule and the Edit permission on Workflow Rules to switch it on. In the default roles only the Administrator has them. Seeing runs needs the View permission on Workflow Runs.
- You can only automate what you may do yourself. When you save or switch on a rule, each action is checked against your permissions: a Create task action needs the Create permission on Tasks, Close open tasks the Edit permission on Tasks, Generate document the Create permission on Generated Documents, Update field the Edit permission on the record's module, and so on. The rule then acts as you whenever it fires on its own.
- Prepare what the actions will use:
- an email's wording as a message template (see Design an email template), or write the subject and body inside the action;
- a document to attach or generate must be Published for the same record type under Document templates;
- a role named in a notify or task action must exist under Roles & Permissions.
- If a system rule already does most of what you want, clone it instead: see Customise a system rule.
Steps
- Open the account menu, choose Settings and click the Workflows tab (Workflows); it opens on the first tab you may see. Click Rules (Rules). The page reads "Each rule watches one kind of record, fires on a trigger, checks its conditions and runs its actions in order."
- Click New rule. The New rule page opens, headed "Automate what happens when records change."
- In Basics:
- Name (required, unique, up to 150 characters), for example "Booking created: tell legal";
- Entity (required): the kind of record the rule watches, such as Booking, Demand or Opportunity. It can't change once the rule is saved;
- Description, Project scope ("All projects", or one project) and Priority (lower runs first when several rules react to the same thing; 0 by default);
- untick Active, so the rule does nothing until you have tried it. The header shows the Inactive badge.
- In Trigger, pick what starts the rule and fill in its extra fields:
- On Create: "Runs once when a new record is created."
- On Update: "Runs when a record changes; optionally only when chosen columns change." Tick the Watched columns that matter, or none for every change.
- On Event: "Runs when a named event of this entity is raised (system or custom)." Choose the Event type, for example BOOKING_CREATED or DEMAND_OVERDUE.
- Scheduled: set Start date, Time, "Repeat every" (day, week, month or year), the weekdays or the day of the month, and an optional Until. The sentence under it reads, for example, "Occurs every week on Mon at 09:00 from 28 Sep 2026, with no end date · first run 2026-09-28, then for ever". Each firing runs once for every record that meets the conditions.
- Manual: "A button on the record; the user fills in a small form first." Click Add field for each value the person types (at least one), such as a reason.
- In Conditions, narrow the records the rule acts on. Click Condition, choose a field (from Columns, Related rows or Context), an operator and a value; use the AND / OR switch and Group to combine tests. The counter reads "<n> conditions". Leave it empty to act on every record the trigger delivers. A Scheduled rule can only compare the record's own columns.
- In Actions, click Add action. The "Add action" dialog lists Side effects ("Notify people, create tasks, send messages, call other systems.") and Domain operations ("Change records the way a user would; each needs the same permissions."). Pick one and fill in its card, for example for Notify users a Title and the Roles to tell, or for Create task a Title, Assign to and Due in days. Repeat for each step; the actions run in the order shown (Move up / Move down). Tick Continue on error on a step whose failure shouldn't stop the rest, and use Only when… for a condition on one step alone.
- Click Create rule. You see '"<name>" created.' and the rule's page opens (Rule) with the badges Inactive and v1.
- Click Test (greyed out with "Save first: the test runs the saved version" while you have unsaved changes). In the dialog, pick a Record; for an On Update rule add Simulate changes, for a Manual rule fill in the Input, for an On Event rule add Event extras if the rule reads them. Click Run dry run. The result shows Matches or Does not match, the badges In scope and Rule inactive, each condition with a green or red dot and the record's actual value, and a verdict per action (Would run, Skipped by conditions, Blocked: missing permissions…). Nothing is sent or changed. Adjust the rule, Save changes and test again until it behaves.
- Go back to Rules (breadcrumb) and flip the rule's switch in the Active column. You see '"<name>" activated.' (You can also tick Active on the rule's page and click Save changes.)
- Once the trigger has happened (a record created or changed, the scheduled time passed, or someone pressed the button), open the rule's row menu and choose Run history (Runs). Click the eye icon on a run: the panel shows its status and, under Actions, each step with its result or error.
What happens next
- You own the rule. When it fires on its own it acts as the person who last saved it or flipped its switch, and can only do what that person may do. A Manual rule acts as whoever presses its button instead; it appears in the Workflows menu of the record page (see Run a manual rule from a record).
- Each save of the definition raises the version (v2, v3…); flipping Active alone doesn't. Past runs keep the version they ran under.
- No run means no match. A rule only produces a run when its trigger fired and its conditions held. If nothing appears, use Test on the record.
- Rules don't set each other off. Whatever a rule changes never triggers other rules; to chain two rules, see Chain two rules with a custom event.
- A rule that has run can't be deleted, only switched off, so its runs keep their history.
- Rule changes are recorded in Settings > Audit log; there is no History button on the rule.
If something goes wrong
- Create rule or Save changes is refused with "Fix the problems below before saving.", "A rule needs at least one action or an emitted event", "A workflow rule named '<name>' already exists", "Contact rules are organization-wide", "Choose the event type this rule listens to", "Manual rules need at least one input field.", "conditions: <path> is not a field of <entity>" or an action line such as "SEND_EMAIL needs a message_template_id or both subject and body" or "Role '<name>' does not exist in this organization": fix the field or action card outlined in red. See Rule cannot be saved (trouble.workflows.rule-cannot-be-saved).
- A text with a merge-field mistake is refused as "<field>: <problem> (line <n>)". See Template syntax error (trouble.documents.template-syntax-error).
- "actions[<n>]: <ACTION> needs <permission>" on save, "You do not have permission to do that." on the Active switch, or Blocked: missing permissions in the test: you (or the rule's owner) lack a permission an action needs. Later, runs that end Errored with "permission_revoked: the acting user no longer holds …" have the same cause. See Run errored: permission revoked (trouble.workflows.run-errored-permission-revoked).
- Runs stay Pending, or a yellow bar reads "<reason>: rules are saved and events are staged, but runs stay Pending until it is fixed.": the engine isn't processing. See Runs stay Pending (trouble.workflows.runs-stay-pending) and Investigate a failed automation.
- New rule isn't shown, or the page reads "You do not have permission to view workflow rules. Ask your administrator.": see No access (trouble.admin.no-access).
Related
Related
- WorkflowsScreen
The Workflows area of Settings, where you manage automation rules, event types and message templates, and check the runs, the outbox and the engine's health.
- RulesScreen
Every automation rule in your organization, system and custom, with filters, the switch that turns each rule on or off, and shortcuts to edit, test, clone, see the run history of or delete a rule.
- New ruleScreen
Build an automation rule on a full page: which records it watches, what starts it, which records qualify, and the ordered actions it carries out.
- RuleScreen
One automation rule's page: read or change its basics, trigger, conditions and actions, test it against a record, clone or delete it, and switch a system rule on or off.
- Event typesScreen
The named events a rule can listen to: the system events NirmaanOne raises itself and the custom events you add to chain rules or to raise from your own integrations.
- Message templatesScreen
The list of your organization's message templates: the wording that Send email actions and campaigns use, with filters and the actions to create, open or delete one.
- RunsScreen
Every time a rule ran: what started it, which record it worked on, how each action went, and the panel from which an errored run is retried.
- Document templatesScreen
The list of your organization's document templates (demand letters, offer letters, termsheets, agreements, allotment letters, receipts, cost sheets), with filters and the actions to create, duplicate, open or delete one.
- Roles & PermissionsScreen
The list of your organization's roles: open one, create or clone a role, deactivate or reactivate it, and delete custom roles nobody holds.
- Audit logScreen
The organization-wide change log: every create, change and delete, every sign-in (including refused ones), sign-out and downloaded file, with who did it, when, from where and what changed.
- Customise a system ruleHow-to
Change what a ready-made system rule does (its timing, conditions, recipients or wording) by cloning it into your own rule, editing the copy, switching the copy on and the original off.
- Design an email template and use it in a ruleHow-to
Write a reusable email (subject, designed body, plain-text version and optional generated attachments) with merge fields, preview it against a real record, and have a workflow rule send it.
- Chain two rules with a custom eventHow-to
Make one rule start another: define a custom event type, let the second rule listen to it with the On Event trigger, and have the first rule raise it when it finishes.
- Put demand, payout and revenue runs on a scheduleHow-to
Have demand runs, payout runs, revenue runs and RERA sweeps prepared on a timetable instead of by hand: start from the ready-made schedule on each runs page, adjust the day, time and options, save the rule, or simply switch on the matching system rule.
- Run a manual rule from a recordHow-to
Press a workflow button on a booking, payment, opportunity, estimate, commission or demand page (for example "Send payment reminder" on a demand), fill in its small form, and follow the run to the end.
- Investigate a failed automationHow-to
When a reminder, task or automatic run didn't happen, check that the workflow engine is working, find the run that failed and read its error, fix the cause, then retry the run or requeue the event.
- Workflow rules, conditions, actions and the rule ownerConcept
What a workflow rule is made of (one kind of record, one trigger, conditions, ordered actions, an optional chained event), how conditions and action settings are evaluated, how versions, tests and clones work, and why every rule has an owner whose permissions its runs use.
- Triggers and event typesConcept
The five ways a workflow rule starts (On Create, On Update, On Event, Scheduled, Manual), the catalogue of system event types the app raises, the daily due-date events for instalments and overdue demands, how recurrences are counted, and custom event types that chain rules.
- Workflow runs and the outboxConcept
How a change becomes automation: the outbox event written with the change, the pick-up that hands it to the engine, one run per listening rule with a recorded result per action, the statuses each passes through, and how Errored runs are retried and Failed events requeued.
- Workflow rule will not save: a trigger, schedule, condition or action is incomplete or not allowedTroubleshooting
Create rule or Save changes is refused when the trigger is missing its event type, schedule or input form, when a condition names a field the record doesn't have, when an action is switched off on this server or is set up in a way the engine doesn't allow, or when the rule has nothing to do.
- Run errored or blocked with "permission_revoked": the rule's owner no longer holds a permission its actions needTroubleshooting
A rule's automatic runs act as the person who last saved or switched the rule, and manual runs as the person who pressed the button; each action is checked against that person's permissions when it runs, so a role change or a deactivated user makes the run fail until the permission is restored or someone who holds it takes the rule over.
- Workflow runs stay Pending: automation is off, its queue is down or processing has stoppedTroubleshooting
Rules keep saving and events keep being recorded, but nothing runs while automation is switched off on the server, the queue that carries changes to it is missing or down, or processing has stopped; the Health tab shows which, the NirmaanOne team fixes it, and the waiting work is then processed.
- Template will not save, publish or render: a tag, expression or the HTML is wrongTroubleshooting
A document template, message template or rule action that carries a broken merge tag is refused when saved or published, names the field and the line; a template that parses but fails while filling in a record, or whose HTML the PDF or Word engine cannot lay out, fails at preview, generation or sending; the editor's own dialogs and fields have their own checks.
- "No access" or "You do not have permission": your role lacks a permissionTroubleshooting
Every screen, button and picker is gated by a permission on a module; your role decides which you hold, so a missing one shows as a No access card, a refused action, a greyed-out button with a hover reason, or a picker that explains which permission it needs.