SfSkills Domains Docs GitHub

Home / architect / fsl-optimization-architecture

fsl-optimization-architecture

Use this skill when designing or evaluating the FSL scheduling engine architecture: optimization mode selection (Global/In-Day/Resource/Reshuffle), ESO adoption strategy, territory sizing for optimization, and fallback planning. Trigger keywords: FSL optimization engine, ESO enhanced scheduling, global optimization timeout, in-day optimization, OAAS architecture, territory optimization design. NOT for tuning an optimization run in Setup — use admin/fsl-scheduling-optimization-design. NOT for per-appointment scheduling API calls — use apex/fsl-scheduling-api.

Open the skill folder on GitHub


FSL Optimization Architecture

This skill activates when an architect needs to design or evaluate the FSL scheduling optimization engine configuration: selecting between optimization modes, planning Enhanced Scheduling and Optimization (ESO) adoption, sizing territories for optimization performance, and designing fallback strategies for optimization failures. It covers the architectural decisions that determine whether optimization runs reliably at scale.


Before Starting

Gather this context before working on anything in this domain:


Core Concepts

Four Optimization Modes

ModeScopeTriggerTimeout
GlobalFull territory, 1–7 day horizonScheduled or on-demand2 hours hard limit
In-DaySame-day disruptionsTriggered by cancellation/no-showNo published timeout (faster)
Resource ScheduleSingle resource's scheduleOn-demandNo published timeout
ReshufflePinned appointments + gapsOn-demandNo published timeout

Global optimization is the primary batch scheduling run (nightly or weekly). In-Day optimization handles real-time disruptions during the work day. Resource Schedule optimizes an individual technician's route. Reshuffle fills gaps around pinned (locked) appointments.

Pinned appointments are never moved by any optimization mode — this is the mechanism for protecting customer commitments from being rescheduled by the engine.

ESO vs. Legacy Engine

Enhanced Scheduling and Optimization (ESO) is a Hyperforce-backed optimization engine introduced to replace the legacy engine:

AttributeLegacy EngineESO
Per-territory adoptionNot applicable — globalTerritory-by-territory in Setup
FallbackN/ANone — no automatic fallback
Work chain supportNoYes
ThroughputLowerHigher
ESO operation limitsN/ASee release notes per release

Critical architecture decision: ESO adoption is per-territory and irreversible in the current release cycle. Once enabled for a territory, that territory uses ESO exclusively. Plan ESO rollout in phases: start with lower-criticality territories, validate, then expand.

Optimization Performance Limits

The recommended maximums per territory for Global optimization to complete within the 2-hour timeout:

Exceeding these limits does not prevent optimization from starting but consistently causes jobs to exceed the 2-hour timeout and be silently cancelled. The FSL optimization history record shows a cancelled status.

Architecture implication: Territory design is a performance design decision, not just an organizational one. Territories that exceed size limits will have unreliable optimization. Redesign large territories into geographic sub-territories before reaching scale.


Common Patterns

Phased ESO Adoption

When to use: Org has multiple territories and wants to migrate to ESO without risking all territory optimization simultaneously.

How it works:

  1. Identify pilot territories: 2–3 with medium volume and non-critical SLAs
  2. Enable ESO for pilot territories in Setup > Field Service > Enhanced Scheduling
  3. Run 2 weeks of Global optimization with ESO and compare job completion times and solution quality to legacy
  4. If successful, adopt territory-by-territory in priority order, deferring high-criticality territories last
  5. Document that adopted territories have no fallback — build a manual dispatch contingency plan

Why not all at once: ESO has no automatic fallback. A rollout issue affecting all territories simultaneously leaves no fallback for any territory.

Nightly Global + Daytime In-Day Architecture

When to use: Operations that have significant daytime disruptions (cancellations, emergency insertions, resource unavailability) in addition to regular scheduled appointments.

How it works:

Why both modes: Global optimization builds the optimal schedule before the day starts. In-Day reacts to disruptions without rebuilding the entire territory's schedule.


Decision Guidance

SituationRecommended ApproachReason
Territory > 50 resourcesSplit into geographic sub-territoriesReduces Global timeout risk
ESO available, ready to adoptPhased territory-by-territory adoptionLimits blast radius of any ESO issues
High daily disruption rateGlobal + In-Day comboIn-Day handles real-time disruptions
Emergency insertionOAAS Resource Schedule for affected techFaster than full territory re-optimization
Pinned appointments during optimizationUse Pinned status — never manually lockPinned is the mechanism; manual locks don't persist
Legacy engine, no ESOKeep Global under 50 resources/1000 SA/territoryOnly mitigation for legacy engine timeout risk

  1. Inventory territories and volumes — Document resource count and daily SA volume per territory. Flag any territory exceeding 50 resources or 1,000 SA/day.
  2. Design territory sizing — If territories exceed limits, propose geographic sub-territory splits. Model the new structure before ESO or optimization configuration.
  3. Choose optimization modes — Determine which modes are needed: Global (always), In-Day (if disruptions are frequent), Resource Schedule (if individual-level changes are common).
  4. Plan ESO adoption — If ESO is licensed, design a phased territory-by-territory adoption plan. Identify pilot territories and success criteria. Build a manual dispatch contingency.
  5. Configure optimization schedules — Set up scheduled Global optimization jobs per territory (one territory at a time, not concurrent overlapping territories).
  6. Monitor optimization job history — Build a dashboard or scheduled report on FSL optimization job records to detect silent cancellations from timeouts.
  7. Document fallback procedures — For each territory, document what dispatchers do if optimization fails: manual dispatch sequence, escalation path, customer communication.

Review Checklist


Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

  1. Global optimization has a 2-hour hard server-side timeout — Silent cancellation with no exception thrown. The FSL optimization job record shows cancelled status. Monitor job records rather than relying on exception alerting.
  2. ESO has no automatic fallback to the legacy engine — A territory enrolled in ESO uses ESO exclusively. Plan manual dispatch procedures for all ESO-enrolled territories.
  3. Concurrent Global optimization jobs for overlapping territories conflict — Run optimization per-territory sequentially, not in parallel for territories that share resources (cross-territory resource assignment via Secondary ServiceTerritoryMember).
  4. Pinned appointments are excluded from ALL optimization modes — Once pinned, an appointment is never moved, rescheduled, or reassigned by any optimization operation. Use pinning deliberately.

Output Artifacts

ArtifactDescription
Territory sizing analysisTable showing current resource/SA volumes vs. optimization limits
ESO adoption phasing planOrdered territory list for ESO rollout with pilot criteria
Optimization mode architecture diagramWhich modes run when and on what trigger

Dependencies

Package files