How to Define and Manage SLA in Frappe/ERPNext?

I’m working on a custom workflow in Frappe/ERPNext where different stages have specific SLA requirements. I’d like to understand the recommended approach for implementing and managing SLAs in Frappe.

Example SLA Requirement

Suppose we have a custom Regulatory Updates Tracker with the following workflow:

Draft → Pending Regulatory Review → Pending Quality Review → Job Accepted → Work In Progress → Creative Review → Regulatory Review → Published

We want to define SLAs such as:

Workflow Stage Responsible Role SLA
Pending Regulatory Review Regulatory Content Reviewer 6 hours
Pending Quality Review Marketing Quality Reviewer 4 hours
Job Accepted Content Designer 2 hours
Work In Progress Content Designer 24 hours
Creative Review Regulatory Content Reviewer 4 hours
Regulatory Review Regulatory Content Reviewer 6 hours

For example, when a document enters Pending Regulatory Review, the SLA timer should start. If the responsible user does not complete the activity within 6 working hours, the system should consider the SLA breached and potentially send a reminder/escalation notification.

Questions

  1. What is the recommended way to implement SLA in Frappe/ERPNext for a custom DocType and workflow?

  2. Can the standard SLA functionality be configured for a custom DocType, or is it primarily intended for Support/SLA-related DocTypes?

  3. Can SLA timers be based on workflow state transitions, rather than only document creation?

  4. How can we configure working hours/business hours so that weekends and non-working hours are excluded?

  5. What is the best approach for SLA reminders and escalations?

  6. Is it better to use the standard SLA functionality, Assignment Rules + Notifications + Scheduler, or a custom implementation?

  7. How can we track:

    • SLA start time

    • SLA due time

    • Actual completion time

    • SLA status (Within SLA / Breached)

    • Time remaining

    • SLA breach history

  8. If a document moves from one workflow state to another, how should the previous SLA timer be stopped and the new state’s SLA timer started?

I would especially appreciate an example or recommended architecture for implementing this cleanly in Frappe Framework v16 / ERPNext v16 without creating unnecessary custom code.