Skip to main content

SLA & Conditional Logic (Deep Dive)

While the Step Properties panel handles who and how someone approves a document, SLA (Service Level Agreements) and Conditional Logic govern when and if the step executes.

1. Why do we need this?

  • The Problem: In early versions of workflows, if an executive went on vacation, a document could sit in their queue indefinitely, blocking entire financial operations. Additionally, forcing a VP to approve a $5 coffee receipt was inefficient, but early systems couldn't skip steps based on what was inside the document.
  • The Solution: To solve stalled workflows, we introduced SLA Timers to automatically push documents forward or backward if someone takes too long. To solve the $5 receipt problem, we introduced Conditional Logic, which looks at the actual data inside the document (like the amount or project) to decide if a step is even necessary.

2. SLA Escalation (Timers & Timeouts)

The SLA system ensures no document gets stuck in "Pending" forever. It acts as an automated assistant that watches the clock and takes action if an approver is unresponsive.

How it works behind the scenes

When you configure SLA rules, you are giving the system a set of instructions. The system constantly monitors all active workflows. If it notices that a document has been waiting at a specific step longer than your allowed time limit, it automatically executes the backup plan you designed.

The SLA Interface Explained

When you toggle Enable SLA Escalation to ON, you will interact with the following UI elements:

SLA Escalation Configuration

  1. + ADD ESCALATION STAGE (Button):
    • What you do: Click this to create a new timer rule (up to 5 maximum).
    • When it appears: This button will automatically disappear from the screen once you reach the maximum of 5 stages.
    • What happens in the future: When someone submits a document, a hidden countdown clock starts. If this clock reaches your time limit, the system intervenes.
  2. Hours from Step Start (Input/Dropdown):
    • What you do: Type a custom number or select a preset (e.g., 72 hours).
    • What happens in the future: This sets the exact length of the countdown clock before the system takes over.
  3. Action (Dropdown):
    • What you do: Choose the intervention type (Remind, Escalate, Auto-Reject, Auto-Approve).
    • What happens in the future: Once the countdown clock hits zero, the system forces this action to happen automatically without human input.
  4. Escalation Target (Dropdown):
    • What you do: Select a new Persona to take over (only visible if you chose "Escalate").
    • What happens in the future: The system strips approval rights from the original person who ignored the request and instantly reassigns the document to this new person.
  5. Notification Message (Comment Box):
    • What you do: Type an optional custom message into this text area.
    • What happens in the future: The system will automatically write an email to the approver (or the new target) and will inject exactly what you typed here into the body of the email (e.g., "This is your final warning").
  6. Trash Can (Icon):
    • What you do: Click the red delete button.
    • What happens in the future: That specific timer is permanently removed and the system will no longer monitor it.

Available Automated Actions

  1. 🔔 Remind Approver (REMIND): Re-sends the standard approval request notification to the current persona.
  2. ⬆️ Escalate to Persona (ESCALATE): Strips the approval rights from the current persona and re-assigns the document to a new target (e.g., escalating from Reporting Manager to Department Head). You must select a target Persona to use this.
  3. Auto Approve: The system forces the document forward, exactly as if the manager had clicked "Approve".
  4. Auto Reject: The system forces the document to fail, exactly as if the manager had clicked "Reject".

SLA Escalation Timeline

💡 Example Scenario: You set Stage 1 to 72 hours with the action Auto Approve. If the Reporting Manager doesn't respond within 3 days, the system automatically approves the expense and moves it to the next step!

💡 Note on Messaging: Every stage allows you to type a custom notification_message. This text is injected directly into the automated email (e.g., "This is your 3rd and final warning before this expense is auto-rejected.")

🌟 Best Practices & Common Mistakes (SLA)

  • Pro-Tip: Create a Cascade: Don't just auto-reject immediately. Build a chain of events! For example, set Stage 1 (24h) to send a polite Reminder, Stage 2 (48h) to send a firmer reminder, and Stage 3 (72h) to Escalate to their boss.
  • Pro-Tip: Watch for the Red Box: The system has built-in safety checks! If you accidentally set Stage 2 to be a shorter time than Stage 1, or if you forget to select an Escalation Target, that specific rule will instantly light up with a bright red border and show you an error message explaining exactly how to fix it.
  • Common Mistake: Impossible Timers: Remember that people sleep and take weekends off! Setting an SLA for "2 hours" might sound efficient, but it will likely cause massive auto-rejections overnight. Stick to 24, 48, or 72-hour increments for business workflows.
  • Gotcha: If you use the Escalate action, double-check your Escalation Target dropdown. Make sure you aren't escalating the document to the exact same Persona that just ignored it!

3. Conditional Logic (Smart Bypasses)

Conditional Logic acts as a bouncer for the approval step. It evaluates the raw data inside the submitted document before the step is allowed to trigger.

When you toggle this on, the step node on the visual canvas instantly generates a third connection line: CONDITION NOT MET (amber line). If the rules are not met, the document shoots down the amber line, bypassing the step entirely.

Dynamic Smart Fields

The system is smart enough to know what kind of document you are building a workflow for. The fields you can create rules against change entirely based on the module:

  • EXPENSE & EMPLOYEE_EXPENSE: Amount, Category, Expense Date, Currency, Project
  • LEAVE: Number of Days, Leave Type, Start Date
  • TIMESHEET: Total Hours, Week Number

Smart Operators & Live Connections

The system limits your math options based on what makes sense (you can't use "Greater Than" on a text field), and it pulls live data directly from your organizational settings:

  • Numbers (Amount, Days): Greater than, Less than, Equal to, etc.
  • Dates: After, Before, On, On or after.
  • Text (e.g. Leave Type): In addition to "Equal to", you can use Contains or Does not contain to catch partial matches (e.g., "Contains 'Medical'").
  • Projects: If you select the Project field, the dropdown automatically connects to your company's live project list. You can select exact projects without having to type their names. You also get special operators here: Is Empty and Is Not Empty, allowing you to route documents simply based on whether they are linked to ANY project at all!
  • Categories: Similarly, selecting Category pulls in your real accounting categories.

The Conditions Interface Explained

When you toggle Enable Conditional Logic to ON, you will use the following UI elements:

  1. + ADD CONDITION RULE (Button):
    • What you do: Click to add a new logic block (up to 10 maximum).
    • When it appears: This button will disappear from the screen once you hit the 10-rule limit.
    • What happens in the future: The system will check the data in the submitted document against this rule before letting the step run.
  2. AND / OR (Toggles):
    • What you do: Click to switch between AND (all rules must be true) or OR (only one rule needs to be true).
    • When it appears: These toggles are completely hidden when you only have 1 rule. They only appear when you add a 2nd rule.
    • What happens in the future: This changes how strict the system is when deciding whether to bypass the step.
  3. Field & Operator (Dropdowns):
    • What you do: Select a data point (e.g., "Amount") and a mathematical logic (e.g., "Greater than").
    • What happens in the future: The system will look at the exact amount requested by the employee and compare it using this math.
  4. Value (Input/Dropdown):
    • What you do: Enter your target threshold (e.g., typing "$500" or selecting "Project Alpha" from the live list).
    • When it appears: This field dynamically changes shape! If you select a Date field, it turns into a calendar. If you select Project, it turns into a dropdown. Crucially, if you select the "Is Empty" or "Is Not Empty" operators, this Value field disappears entirely (since you don't need a value to check if something is empty).
    • What happens in the future: This is the finish line the system compares the employee's document against. If it matches your logic, the step runs. If not, the step is skipped.
  5. Trash Can (Icon):
    • What you do: Click the red delete button.
    • What happens in the future: The rule is erased and will no longer be checked.
  6. Live Preview (Text Block):
    • What you do: Read the auto-generated sentence at the bottom.
    • What happens in the future: This serves as a real-time translation so you can verify exactly how the system will behave before you hit save.

💡 Example Workflow: You create an Expense workflow with two steps. Step 1 is "Reporting Manager" (always runs). Step 2 is "Finance Director" with a condition: "Only execute if expense amount > $500." If an employee submits an expense for $200, it clears the Reporting Manager, reaches Step 2, evaluates to false, shoots down the CONDITION NOT MET amber line, and goes straight to Final Approval.

🌟 Best Practices & Common Mistakes (Conditions)

  • Pro-Tip: Use the Live Preview: Always read the sentence generated at the bottom of the screen out loud. If the sentence sounds confusing to you, the rule is probably configured wrong!
  • Common Mistake: Conflicting "AND" Logic: Be very careful when using the AND toggle with multiple rules. If you set Rule 1 to Amount > 500 AND Rule 2 to Amount < 100, it is mathematically impossible for both to be true. The step will never run! Use OR if you want either scenario to trigger the step.
  • Gotcha: The Amber Line Routing: Remember that if a condition is not met, the step is skipped, and the document immediately shoots down the amber CONDITION NOT MET line. Always trace that amber line on your visual canvas to ensure it connects to the right place (usually the next step, or the final Approved node).