> **Source:** https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/what-is-a-rule > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # What counts as a rule? Not every requirement is a rule. Some things that *sound* like rules — "remind the signer after 3 days", "use the Hindi agreement if they pick Hindi" — belong to other parts of Leegality, or to your own systems. Before you build a rule (or promise one), run the requirement through three questions. Three YES answers mean it's a rule. Any NO means it's something else — and this page tells you what to do instead. ## The three-question test ### 1. Is everything happening inside one workflow? A rule lives inside a single workflow. It cannot reach across workflows or act on anything outside the one it belongs to. **If NO** → it's cross-workflow orchestration or external automation, not a rule. ### 2. Is the trigger a field value inside that workflow? A rule is evaluated against the value of a field within the same workflow — a loan amount, a customer type, a dropdown selection. The clock, an incoming API call from another system, or an action taken by the signer cannot trigger a rule. **If NO** → it's time-based, signer-triggered, or externally triggered — not a rule. ### 3. Does the outcome change one of the four field properties? A rule's outcome changes a field's **Mandatory** state, **Visibility**, **Editability**, or **Value** (including calculated values). If the desired outcome is something else — sending a message, swapping a template, starting another workflow — it isn't a rule. **If NO** → it's workflow composition or an external action, not a rule. > **Note — The test at a glance** > > ✓ One workflow · ✓ field-value trigger · ✓ outcome changes Mandatory / Visibility / Editability / Value = **it's a rule**. Any ✗ = not a rule — identify which pattern below it matches, and use the alternative. ## Three requirements that are *almost* rules Most "is this a rule?" confusion comes down to three recurring patterns. Learn to recognise them — each comes with a better solution. ### Anti-pattern 1: The clock triggers it, or the action reaches outside > "Send a reminder SMS 3 days after the borrower gets the link." Nothing inside the workflow caused this to fire — **time did**. And the action sends an SMS: it reaches *out* to the customer rather than changing a field in the workflow. This fails questions 2 and 3. **What to do instead:** use Leegality's reminder settings, or the notification tooling in your own system. This is automation, not a rule. ### Anti-pattern 2: The signer triggers it, or the ask swaps templates > "Use the Hindi loan agreement if the signer picks Hindi." Two problems. The **signer** is the trigger — rules can't react to signer actions. And the action swaps which template the workflow uses — rules change field properties, not which documents or templates a workflow contains. **What to do instead:** build a separate workflow per language, and have your system send each customer the right one. ### Anti-pattern 3: The ask spans more than one workflow > "Start the Sanction Letter workflow after the Loan Agreement workflow finishes." Two different workflows. Rules live inside one workflow only — they can't reach across. This fails question 1. **What to do instead:** Leegality signals when a workflow completes; your system listens for that completion notice and starts workflow #2. ## Rule vs not-a-rule at a glance | Requirement | Rule? | Why | | --- | --- | --- | | Make Reviewer mandatory IF Loan Amount > ₹10,00,000 | ✓ | Field-value trigger, changes the Mandatory property | | Hide the Co-applicant Name field IF Loan Type = Personal | ✓ | Field-value trigger, changes Visibility | | Stamp Duty Amount = Loan Amount × Stamp Duty % | ✓ | Field-value trigger, assigns a computed Value | | Block Proceed with an error IF IRN format is invalid | ✓ | Field-value trigger, validates before the stage completes | | Send a reminder SMS 3 days after the invitation | ✗ | Time-triggered, external action — use reminder settings | | Use the Hindi agreement if the signer picks Hindi | ✗ | Signer-triggered, swaps templates — use one workflow per language | | Start workflow B when workflow A finishes | ✗ | Spans two workflows — your system chains them on completion | ## Next steps It passed the test? Two moves from here: - Identify **which property** it changes — [Rule categories](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/rule-categories) walks through the four types with examples. - Write it as a six-line spec anyone can build from — [Turn a requirement into a rule](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/turn-a-requirement-into-a-rule). > **Tip — Borderline case?** > > If a requirement doesn't clearly pass or fail, write it up as a [rule spec](https://knowledge.leegality.com/document-execution/workflows/v4/rule-engine/turn-a-requirement-into-a-rule) anyway and send it to [support@leegality.com](mailto:support@leegality.com) — the spec makes it easy for us to confirm whether it's buildable and configure it if it is.