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

Field Service Routing

    • 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
        • Time zones and daylight-saving time (DST)
      • Routing with Timefold’s maps service
      • Input validation
      • Model response
      • Key performance indicators (KPIs)
      • Metrics and optimization goals
    • Vehicle resource constraints
      • Shift hours and overtime
      • Lunch breaks and personal appointments
      • Fairness
      • Route optimization
      • Technician costs
      • Technician ratings
    • Visit service constraints
      • Time windows and opening hours
      • Skills
      • Visit dependencies
      • Multi-vehicle visits
      • Movable visits and multi-day schedules
      • Priority visits and optional visits
      • Visit service level agreement (SLA)
      • Visit requirements, area affinity, and tags
        • Visit requirements
        • Technician coverage area
        • Tags
    • Recommendations
      • Visit time window recommendations
      • Visit group time window recommendations
    • Real-time planning
      • Real-time planning: extended visit
      • Real-time planning: reassignment
      • Real-time planning: emergency visit
      • Real-time planning: no show
      • Real-time planning: technician ill
      • Real-time planning: pinning visits
    • Real-time planning (preview)
      • Real-time planning: extended visit (preview)
      • Real-time planning: reassignment (preview)
      • Real-time planning: emergency visit (preview)
      • Real-time planning: no show (Preview)
      • Real-time planning: technician ill (Preview)
      • Real-time planning: pinning visits (preview)
    • Scenarios
      • Long-running visits
      • Configuring labor law compliance
    • 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": "P1D",
        "unimprovedSpentLimit": "P1D",
        "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,
        "visitCompletionRiskMinimalTimeToShiftEnd": "PT4H",
        "visitCompletionRiskMinimalPriority": "6",
        "travelTimeAdjustment": {
          "multiplier": 1,
          "extraTime": "P1D"
        },
        "priorityWeights": [
          {
            "priority": "string",
            "weight": 0
          }
        ],
        "defaultTechnicianRating": 0,
        "minimizeWaitingTimeWeight": 0,
        "minimizeVisitsOutsidePreferredArea": 0
      }
    }
  }
}
Replace exampleConstraintWeight with the constraint weights you want to configure.

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

  • visitCompletionRiskMinimalTimeToShiftEnd makes it possible to avoid scheduling high priority visits late in the day to avoid the possibility of having to reschedule the visit if the technician is late finishing other visits. See the Priority visits and optional visits for more details.

  • visitCompletionRiskMinimalPriority sets the minimum priority level to consider for visit completion risk. See the Priority visits and optional visits for more details.

  • travelTimeAdjustment can be defined to implement a "buffer" to allow for unexpected traffic delays or long parking time when traveling. The travel time adjustment is configured as a function for every route between any two locations as follows:
    adjustedTravelTime = multiplier * mapTravelTime + extraTime

    • mapTravelTime is the travel time obtained from a map service,

    • multiplier The coefficient to multiply the original travel time obtained from a map service with. Must be greater than zero (typically will be greater than 1 to make the travel time longer). The default value is 1.0.

    • extraTime The additional time to add to the original travel time obtained from a map service. Must be positive or zero duration. The default value is "PT0S" (zero duration).

  • priorityWeights sets custom priorities for visits. See the Priority visits and optional visits for more details.

  • defaultTechnicianRating sets a default technician rating. See Technician ratings for more details.

Next

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

  • Learn more about field service routing 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