Workflow Engine (WFL)¶
Module Purpose: The rules engine. It automates permissions, approvals, and process flows. It ensures no user can bypass authority limits (e.g., Sales Rep approving a ₹1 Cr quote).
[!TIP] Core Concept: "Trust but Verify." Every critical action (Discount > 10%, Credit Limit Override) requires a digital signature (Approval) stored in the audit trail.
Use Case Quick Reference¶
| ID | Title | Priority |
|---|---|---|
| WFL-001 | Create Workflow Template | P1 |
| WFL-002 | Define Approval Chain | P1 |
| WFL-003 | Route Document for Approval | P1 |
| WFL-004 | Send Approval Notifications | P1 |
| WFL-005 | Track Approval Status | P1 |
| WFL-006 | Handle Rejections/Revisions | P2 |
UC-WFL-001: Create Workflow Template¶
What It Does¶
An Admin tool to design process flows graphically. It allows defining "Stages" (Review -> Approval -> Verification) and "Conditions" (Value > 10k).
Who: System Admin
When: Setup
How It Works¶
- Template Name: "High Value Quote Approval".
- Triggers: Condition
Quote Value > ₹50,00,000. - Stage Design:
- Stage 1: Sales Head (SLA: 4 hours).
- Stage 2: Finance Director (SLA: 24 hours).
- Logic: Both stages must pass for final status "Approved".
UC-WFL-002: Define Approval Chain¶
What It Does¶
Maps "Roles" to "People". It handles hierarchy logic like "Reporting Manager" so you don't need to hardcode names in every workflow.
Who: Admin / HR
When: Setup
How It Works¶
- Role Mapping:
Role: Regional Manager= "Rahul", "Priya".Role: CFO= "Mr. Mehta".- Hierarchy Rule:
- If Submitter = "Sales Rep A", then
Reporting Manager= "Regional Manager (West)". - Delegation:
- "Mr. Mehta" is on leave? Auto-delegate to "Deputy CFO".
UC-WFL-003: Route Document for Approval¶
What It Does¶
The runtime engine. When a user clicks "Submit for Approval" on a Quote/PO, this engine grabs the document, locks it, and finds the right approver.
Who: System Engine
When: User Action
How It Works¶
- Lock: Document status changes to
Pending Approval. Edit Access = Read Only. - Find Approver:
- Workflow: "Invoice Approval".
- Step 1: "Manager". System looks up Submitter's Manager -> "Steve".
- Queue: Add task to Steve's "Inbox".
UC-WFL-004: Send Approval Notifications¶
What It Does¶
Ensures the approver knows there is work waiting. Uses multi-channel pings to drive faster Turnaround Time (TAT).
Who: System Notifier
When: New Task in Inbox
How It Works¶
- Instant: Push Notification to Mobile App.
- Email: "Action Required: Quote #123 waiting for approval." (Contains "Approve/Reject" buttons directly in email).
- Reminder: If untouched for 4 hours -> SMS "Urgent: Pending Approval".
UC-WFL-005: Track Approval Status¶
What It Does¶
The "FedEx Tracking" for approvals. Submitters can see exactly whose desk the file is stuck on.
Who: Submitter (Sales Rep)
When: Checking Status
How It Works¶
- Timeline View:
- 10:00 AM: Submitted by You.
- 10:05 AM: Approved by Manager (Steve).
- Current: Pending with Finance (Mr. Mehta) since 2 hours.
- Nudge: Button to "Send Reminder" to the current blocker.
UC-WFL-006: Handle Rejections/Revisions¶
What It Does¶
Handles the "No". If an approver rejects, they must provide a reason. The workflow then routes back to the submitter for correction, not to the start.
Who: Approver
When: Rejecting
How It Works¶
- Input: Approver clicks "Reject".
- Mandatory: System prompts "Enter Rejection Reason" (e.g., "Margin too low").
- Routing: Document Status ->
Draft (Changes Requested). - Notify: Email Submitter "Rejected: Margin too low. Please fix and resubmit."
- Resubmit: Logic resets mostly, but keeps "Version 2" history.