Approval Overview

The TechMaju Core Approval System provides a comprehensive, policy-driven approval workflow that can be applied to any DocType within your application. It supports configurable approval policies, hard-lock enforcement, automated notifications, and flexible approval modes.

Overview

The Approval system is designed to control document modifications through configurable approval workflows. It operates independently of business DocTypes, making it a decoupled solution that can be applied universally across your application.

Key features include:

  • Policy-driven automation - Configure approval requirements based on DocType events
  • Hard lock enforcement - Prevent document modifications until approval is granted
  • Flexible approval modes - Support for All, Any One, or Count(n) approval patterns
  • Multi-channel notifications - Email, SMS, and Slack integration
  • Escalation and reminders - Automated SLA management with customizable escalation paths
  • Role-based security - Granular permissions for approval administrators and users

Core Components

The approval system consists of five main DocTypes that work together to provide complete workflow management:

1. Approval Settings

Global configuration that enables the approval system and defines which DocTypes are subject to approval workflows.

2. Approval Policy

Defines the rules and conditions under which approvals are triggered, including:

  • Target DocType and triggering events
  • Filter conditions for selective triggering
  • Approval mode and required approvers
  • Lock behavior and post-decision effects
  • SLA settings and escalation rules

3. System Approval

Runtime records that track the overall approval status for specific documents. Each System Approval represents one approval workflow instance tied to a particular document.

4. Approval Request

Individual approval tasks assigned to specific users. Multiple requests can exist for a single System Approval, depending on the approval mode configured in the policy.

5. Approval Notification

Audit trail of all notifications sent during the approval process, linking to actual communication records.

ℹ️ By default, System Notifications are generated for key approval events such as request creation and approval/rejection decision.

Approval Flow

Document Event → Policy Evaluation → System Approval Creation → Request Generation → User Actions → Completion
  1. Trigger: A document event (save, submit, etc.) occurs on a whitelisted DocType
  2. Policy Check: The system evaluates active policies that match the DocType and event
  3. Approval Creation: If conditions are met, a System Approval is created
  4. Request Distribution: Individual Approval Requests are sent to designated approvers
  5. User Interaction: Approvers can approve, reject, or request additional information
  6. Completion: The System Approval reaches a final state (Approved/Rejected/Cancelled)
  7. Post-Processing: Configured effects are applied to the original document

Important Behavioral Notes

Single Approval Per Document

The system enforces one active approval per document at a time. This prevents duplicate or overlapping approval workflows, even when multiple policies could potentially match the same document event.

  • Hard Lock Policies: If a hard lock approval exists, no additional approvals will be created
  • Advisory Policies: Even for non-blocking (advisory) policies, only one approval workflow can be active per document
  • Policy Priority: The first matching policy to execute will create the approval; subsequent matching policies are ignored until the approval is resolved

Avoiding Circular Approval Loops

⚠️Critical: Post-decision effects can inadvertently trigger new approval workflows, creating circular loops. Users must design policies carefully to prevent this:

Field Setter Considerations

When configuring On Approve Set Field or On Reject Set Field: - Filter Exclusions: Ensure policy filter conditions exclude documents where the target fields have the values you're setting - Example: If setting approval_status = "Approved", add filter condition approval_status != "Approved" - Multiple Fields: Consider all fields being modified in your filter logic

Script Function Considerations

When using On Approve Call Script or On Reject Call Script: - Careful Field Modifications: Avoid modifying fields that could trigger the same approval policy - Condition Checking: Include logic in scripts to check if approval has already been processed - Event Prevention: Use document flags or status checks to prevent re-triggering

Security and Permissions

The system includes two primary roles:

  • Approval Admin: Full access to configure policies, view all approvals, and manage approval settings
  • Approval User: Limited access to view and act on approvals where they are assigned as approver or document owner

ℹ️ Data permission queries ensure users only see approvals relevant to their role and assignments.

Discard
Save

On this page

Review Changes ← Back to Content
Message Status Space Raised By Last update on