Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
  • Platform
Try models
  • Employee Shift Scheduling
  • User guide
  • Input datasets
  • Model configuration
  • latest
    • latest
    • 1.20.x

Employee Shift Scheduling

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terms
      • Use case guide
      • Planning AI concepts
      • Integration
      • Constraints
      • Understanding the API
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
        • Planning window
      • Planning window
      • Time zones and Daylight Saving Time (DST)
      • Tags and tag types
      • Input validation
      • Metrics and optimization goals
      • Score analysis
      • Visualizations
    • Employee resource constraints
      • Employee contracts
      • Employee availability
      • Employee priority
      • Pairing employees
      • Shift travel and locations
      • Employee activation
      • Work limits
        • Minutes worked per period
        • Minutes worked in a rolling window
        • Minutes logged per period
        • Days worked per period
        • Days worked in a rolling window
        • Consecutive days worked
        • Shifts worked per period
        • Shifts worked in a rolling window
        • Weekend minutes worked per period
        • Weekends worked per period
        • Weekends worked in a rolling window
        • Consecutive weekends worked
      • Time off
        • Days off per period
        • Consecutive days off per period
        • Consecutive days off in a rolling window
        • Consecutive minutes off in a rolling window
        • Shifts to avoid close to day off requests
        • Consecutive weekends off per period
      • Shift rotations and patterns
        • Shift rotations
        • Single day shift sequence patterns
        • Minimize gaps between shifts
        • Multi-day shift sequence patterns
        • Daily shift pairings
        • Overlapping shifts
        • Shift start times differences
        • Minutes between shifts
      • Shift type diversity
        • Shift tag types
        • Shift types worked per period
        • Unique tags per period
      • Fairness
        • Balance time worked
        • Balance shift count
    • Shift service constraints
      • Alternative shifts
      • Cost management
      • Demand-based scheduling
      • Mandatory and optional shifts
      • Shift assignments
      • Skills and risk factors
    • Manual intervention
    • Recommendations
    • Real-time planning
    • Real-time planning (preview)
    • Scenarios
      • Configuring labor law compliance
      • Configuring employee well-being
    • Changelog
    • Upgrade to the latest version
    • Feature requests

Model configuration

The model configuration config object of the input dataset includes the run and model objects.

1. Run

In the run object you can specify a name for the dataset, the termination settings to be applied to the dataset, the maxThreadCount, and tags to be applied to the dataset:

{
  "config": {
    "run": {
      "name": "Dataset name",
      "termination": {
        "spentLimit": "PT30M",
        "unimprovedSpentLimit": "PT3M",
        "stepCountLimit": 0
      },
      "maxThreadCount": 1,
      "tags": [
        "Control"
      ]
    }
  }
}

Termination settings can be specified per dataset to override the termination settings in the configuration profile.

  • spentLimit sets the maximum duration (in ISO 8601 duration format) for solving a dataset.

  • unimprovedSpentLimit sets the maximum duration (in ISO 8601 duration format) for a solving a dataset since the dataset score improved. If no value is provided, the default diminished returns termination will apply. If set, stepCountLimit must be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases

  • stepCountLimit sets the maximum solver step count for solving a dataset. The solver will stop solving after a pre-determined amount of steps. Use when you require results independently of the hardware resources performance. Use this termination if you want to benchmark your models, not recommended for production use. If set, unimprovedSpentLimit must be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases.

Diminished returns terminates the solver early if expected improvements are minimal, saving on CPU costs. This termination is desirable since it terminates based on the relative rate of improvement, and behaves similarly on different hardware and different problem instances. You can find more details in the documentation.

Learn more about termination settings.

Thread Count: The default number of threads used for solving is 1. maxThreadCount can be used to specify a maximum number of threads to use.

The maximum number of available threads is determined by the model and by the tenant plan.

Tags are applied to the dataset and allow you to filter your datasets in the Timefold Platform UI based on tags. Tags are helpful for organizing your datasets to represent different segments of your data, for instance, different regions or departments.

Learn more about tags and searching and categorizing datasets for auditability.

2. Model

The model object contains configuration overrides for individual (soft) constraints weights and additional global model configuration attributes:

{
  "config": {
    "model": {
      "overrides": {
        "exampleConstraintWeight": 0
      }
    }
  }
}
Replace exampleConstraintWeight with the constraint weights you want to configure.

For information about configuring constraint weights, see the Constraints documentation.

Next

  • See the full API spec or try the online API.

  • Learn more about employee shift scheduling from our YouTube playlist.

  • Learn about the Model input.

  • Learn about configuration parameters and profiles.

  • © 2026 Timefold BV
  • Timefold.ai
  • Documentation
  • Changelog
  • Send feedback
  • Privacy
  • Legal
    • Light mode
    • Dark mode
    • System default