Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt

Use this file to discover all available pages before exploring further.

Feature: SLA Definition Management & Configuration
Spec: PF-83
Last Updated: 2026-03-17

Overview

This guide covers administrative configuration for SLA Management: creating and managing SLA definitions, configuring module settings, and assigning permissions.

Permission Model

Permission Keys

PermissionDescription
pf.sla.viewRead access to SLA dashboard, definitions, and instances
pf.sla.definition.manageCreate, edit, and deactivate SLA definitions
pf.sla.instance.managePause, resume, and extend SLA instances
pf.sla.settings.manageConfigure SLA module settings

RLS Enforcement

All SLA tables enforce multi-tenant isolation via the pf_has_org_access SECURITY DEFINER function. Only users within the same organization can access SLA data. UPDATE policies include WITH CHECK clauses.

Initial Setup

Step 1: Configure Module Settings

SLA-related settings are stored in pf_module_settings (one row per organization):
SettingTypeDescriptionRecommendation
Default warning thresholdINTEGERPercentage of deadline at which “at-risk” triggers75–80%
Max active instancesINTEGERCap on concurrent active SLA instances per orgStart with 1000
Max definitionsINTEGERCap on SLA definitions per orgStart with 50

Step 2: Create SLA Definitions

  1. Navigate to SettingsSLADefinitions
  2. Click New Definition
  3. Fill in:
    • Name — Descriptive label (e.g., “Lead Response Time”)
    • SLA Typeresponse_time, resolution_time, follow_up, or custom
    • Owning Core — Which module this SLA belongs to (e.g., ce, hr, rh)
    • Trigger Event — The fw_domain_events event type that starts the clock
    • Completion Event — The event type that stops the clock
    • Target Duration (hours) — The deadline
    • Warning Threshold (%) — When to flag as “at-risk” (default: 80%)
    • Escalation Config — Optional escalation levels with notification targets
    • Priority Overrides — Optional per-priority deadline adjustments
  4. Click Save

Step 3: Assign Permissions

RoleRecommended Permissions
org_adminAll SLA permissions
platform_adminpf.sla.view, pf.sla.definition.manage, pf.sla.settings.manage
Staff / Managerspf.sla.view
To assign:
  1. Go to SettingsRoles & Permissions
  2. Select the role
  3. Enable the required SLA permissions
  4. Save

Database Tables

TablePurposeKey Fields
pf_sla_definitionsSLA templatesid, organization_id, name, sla_type, owning_core, trigger_event_type, completion_event_type, target_duration_hours, warning_threshold_pct
pf_sla_instancesRunning SLA clocksid, organization_id, definition_id, status, started_at, deadline_at, elapsed_seconds, remaining_seconds, percentage_elapsed

Event Integration

SLA Management publishes these events to fw_domain_events:
Event TypeWhen Fired
pf_sla_warning_triggeredInstance crosses warning threshold
pf_sla_breachedInstance exceeds deadline
pf_sla_completedInstance completed within deadline
These events can trigger PF-10 notifications for escalation.

Best Practices

  1. Start simple — Create 2–3 critical SLA definitions before expanding
  2. Set realistic thresholds — Warning at 75–80% gives staff time to act
  3. Audit regularly — Review compliance rates monthly; adjust targets as needed
  4. Least privilege — Grant definition.manage only to admins; most staff need only view
  5. Use priority overrides — Different urgency levels may need different deadlines

Troubleshooting

IssueSolution
Definition not creating instancesVerify trigger event type matches events in fw_domain_events
Permission changes not reflectingPermission queries have 5-minute stale time; wait or hard refresh
Instance never completesCheck that the completion event type is correct and the event is actually being published
Too many active instancesReview and increase the max active instances setting, or archive old definitions

References