---
schema_version: "1"
id: 46c0f162d8e57387f20808a6bb4bc2706bc78cabc2ca7b0ac230766fbcdbd302
title: In-Day and Global Optimization for Workforce Scheduling
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/wfs_optimize_inday_global.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.wfs_optimize_inday_global.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 909e120376d0ed95f8250fbbed8787d96785ff497e37c3934ddbdc70252c5fa4
description: Use In-Day Optimization to recover from same-day disruptions — such as last-minute schedule changes — by optimizing the team’s schedule across one or more service territories. Use Global Optimization to reoptimize the schedule across one or more service territories over a longer date range. In-Day and Global Optimization are relevant to field work only.
products:
  - Public Sector
  - Service Cloud
release: "264"
---
# In-Day and Global Optimization for Workforce Scheduling

Use In-Day Optimization to recover from same-day disruptions — such as last-minute schedule changes — by optimizing the team’s schedule across one or more service territories. Use Global Optimization to reoptimize the schedule across one or more service territories over a longer date range. In-Day and Global Optimization are relevant to field work only.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions</td></tr></tbody></table>

In Setup, configure the org-level pin criteria (which statuses lock appointments during optimization) and the Commit Mode (what happens when a scheduling change occurs during a run) for each optimization type. See [Configure Optimization for Field Work in Workforce Scheduling](https://help.salesforce.com/s/articleView?id=service.wfs_config_scheduling_field_opt.htm&release=264.0.0&type=5 "Configure org-level defaults for field-work optimization, including pin criteria and commit mode for global, in-day, and resource schedule optimization runs. Optimization is relevant to field appointments only.").

Trigger In-Day and Global Optimization through the Workforce Scheduling optimization [APIs](https://developer.salesforce.com/docs/platform/connect-rest-api/references/connect-rest-api-core#tag/Workforce-Scheduling-Resources). The API request specifies the optimization type, service territories in scope, date range or day, and scheduling policy to apply.

## In-Day Optimization

In-Day optimization is ideal for same-day schedule changes such as last-minute appointments that need immediate action, or cancellations that leave gaps in the schedule. It runs in up to 5 minutes, fast enough for on-demand changes. This only covers the optimization engine runtime and doesn’t include data fetching or committing results to the Gantt. For example, if a dispatcher sees the Gantt as disabled for 10 minutes during an in-day optimization run, the system hasn’t crashed. The data loading and saving happens on either side of the 5-minute calculation window. In-Day Optimization runs across the current day and next day, over one or more service territories. You can extend In-Day optimization across multiple days, but it’s best for immediate issues on the current or next day.

## Global Optimization

Global Optimization is the most thorough optimization type — use it to reoptimize the entire schedule. It optimizes every unpinned appointment across the selected service territories and applies the highest-scoring schedule the engine can find within the run’s time horizon (date range). Global Optimization runs across one or more service territories and a date range of up to 30 days. Runtime is capped at 2 hours. This only covers the optimization engine runtime and doesn’t include data fetching or committing results to the Gantt. For example, if a dispatcher sees the Gantt as disabled for 3 hours during a global optimization run, the system hasn’t crashed. The data loading and saving happens on either side of the 2-hour calculation window. Global Optimization is designed for overnight batch use — schedule it for a time when concurrent changes are unlikely. For example, use Global Optimization for:

- Nightly rebalancing to prepare for the next day of service.
- End-of-week resets after a busy period changes the schedule.
- Recovery after a change to work rules, service objectives, or scheduling policies.

If a run stays in the In Progress status longer than expected, increase your org’s session timeout to at least 2 hours.

#### See Also

- [Configure Optimization for Field Work in Workforce Scheduling](https://help.salesforce.com/s/articleView?id=service.wfs_config_scheduling_field_opt.htm&release=264.0.0&type=5 "Configure org-level defaults for field-work optimization, including pin criteria and commit mode for global, in-day, and resource schedule optimization runs. Optimization is relevant to field appointments only.")
- [Resource Schedule Optimization for Workforce Scheduling](https://help.salesforce.com/s/articleView?id=service.wfs_optimize_rso.htm&release=264.0.0&type=5 "In Workforce Scheduling, use Resource Schedule Optimization (RSO) to reoptimize a single service resource’s schedule when a last-minute disruption occurs. RSO reshapes a single resource’s day due to a shift change, a cancellation, or an unexpected block of unavailability — without affecting the rest of the team. RSO is relevant to field work only.")
- [Prioritizing Service Appointments for Optimization](https://help.salesforce.com/s/articleView?id=service.wfs_optimize_priority.htm&release=264.0.0&type=5 "Priority values on Workforce Scheduling service appointments tell the optimization engine which appointments to schedule first when your team’s availability is limited. Priority reflects business factors like due dates and service level agreements — not just urgency. Optimization is relevant to field work only.")