Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
    • Task Scheduling
  • Platform
Try models
  • Task Scheduling
  • User guide
  • Resource-specific durations

Task Scheduling

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Scheduling API concepts
      • Integration
      • Constraints
      • Using the API
        • Using the OpenAPI spec
        • API tooling
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
      • Output datasets
        • Metadata
        • Model output
        • Input metrics
        • Key performance indicators (KPIs)
      • Job types and machine types
      • Resource-specific durations
      • Freeze jobs until
      • Metrics and optimization goals
      • Score analysis
      • Validation
    • Machine and employee resource constraints
      • Machine unavailability
      • Resource transitions
      • Employee resources
    • Job service constraints
      • Time windows
      • Time management
      • Job dependencies
      • Priority jobs
      • Tags and specific resources
    • Real-time planning
    • Changelog
    • Upgrading to the latest versions
    • Feature requests

Resource-specific durations

In many real-world scenarios, the same job takes different amounts of time depending on which machine or employee performs it. The Task Scheduling model supports specifying different durations for the same job with different resources.

1. Basic usage

By default, a job has a single duration that applies to all resources"

{
  "jobs": [
    {
      "id": "Job 1",
      "duration": "PT2H"
    }
  ]
}

This job takes two hours regardless of which machine or employee performs it.

2. Specifying resource-specific durations

You can specify different durations for specific resources using the durationOnResources field:

{
  "machines": [
    {
      "id": "Old machine",
      "start": "2024-12-01T00:00:00+00:00"
    },
    {
      "id": "New machine",
      "start": "2024-12-01T00:00:00+00:00"
    },
    {
      "id": "Machine C",
      "start": "2024-12-01T00:00:00+00:00"
    }
  ],
  "jobs": [
    {
      "id": "Machining job",
      "duration": "PT4H",
      "durationOnResources": [
        {
          "resource": "New machine",
          "duration": "PT2H"
        },
        {
          "resource": "Old machine",
          "duration": "PT6H"
        }
      ]
    }
  ]
}

In this example:

  • On the New machine, the job takes two hours.

  • On the Old machine, the job takes six hours.

  • On Machine C (not specified in durationOnResources), the job takes the default four hours.

The solver will consider these different durations when optimizing the schedule and may prefer the faster machine to minimize makespan.

3. How it works

The durationOnResources list provides overrides for specific resources:

  1. If a job is assigned to a resource listed in durationOnResources, the duration specified for that resource is used.

  2. If a job is assigned to a resource NOT listed in durationOnResources, the default duration is used.

  3. If no default duration is specified and the resource is not in durationOnResources, the job’s duration is considered invalid.

4. Use cases

Resource-specific durations are useful for modeling:

4.1. Machine capabilities

Different machines have different speeds and capabilities:

{
  "jobs": [
    {
      "id": "Cutting job",
      "duration": "PT1H",
      "durationOnResources": [
        {
          "resource": "Laser cutter",
          "duration": "PT30M"
        },
        {
          "resource": "Manual saw",
          "duration": "PT3H"
        }
      ]
    }
  ]
}

4.2. Employee skill levels

Different employees work at different speeds:

{
  "employees": [
    {
      "id": "Senior technician",
      "start": "2024-12-01T08:00:00+00:00"
    },
    {
      "id": "Junior technician",
      "start": "2024-12-01T08:00:00+00:00"
    }
  ],
  "jobs": [
    {
      "id": "Repair job",
      "duration": "PT2H",
      "durationOnResources": [
        {
          "resource": "Senior technician",
          "duration": "PT1H"
        },
        {
          "resource": "Junior technician",
          "duration": "PT3H"
        }
      ]
    }
  ]
}

4.3. Machine wear and maintenance

As machines age or require maintenance, they may slow down:

{
  "jobs": [
    {
      "id": "Production job",
      "duration": "PT8H",
      "durationOnResources": [
        {
          "resource": "Machine under maintenance",
          "duration": "PT12H"
        }
      ]
    }
  ]
}

5. Combining with other features

Resource-specific durations work seamlessly with other Task Scheduling features:

5.1. With required tags

{
  "jobs": [
    {
      "id": "Precision job",
      "duration": "PT4H",
      "requiredTags": ["Precision"],
      "durationOnResources": [
        {
          "resource": "Precision machine A",
          "duration": "PT3H"
        }
      ]
    }
  ]
}

The job will only be assigned to resources with the Precision tag, and if assigned to Precision machine A, it will take three hours instead of the default four hours.

5.2. With required resources

{
  "jobs": [
    {
      "id": "special job",
      "duration": "PT2H",
      "requiredResources": ["machine A", "machine B", "machine C"],
      "durationOnResources": [
        {
          "resource": "machine A",
          "duration": "PT1H"
        },
        {
          "resource": "machine B",
          "duration": "PT3H"
        }
      ]
    }
  ]
}

The job can only be assigned to machines A, B, or C. If assigned to A, it takes one hour; if assigned to B, it takes three hours, and if assigned to C, it takes the default two hours.

5.3. With unavailable time spans

When a resource has unavailable time spans, the job processing is paused during those periods. The effective completion time is extended by the duration of the unavailability, regardless of whether the duration is resource-specific or default:

{
  "machines": [
    {
      "id": "Machine A",
      "start": "2024-12-01T00:00:00+00:00",
      "unavailableTimeSpans": [
        {
          "start": "2024-12-01T12:00:00+00:00",
          "end": "2024-12-01T13:00:00+00:00"
        }
      ]
    }
  ],
  "jobs": [
    {
      "id": "Long job",
      "duration": "PT8H",
      "durationOnResources": [
        {
          "resource": "Machine A",
          "duration": "PT6H"
        }
      ]
    }
  ]
}

If this job starts at 10:00 on machine A, it would normally finish at 16:00 (10:00 + 6 hours). However, with the lunch break from 12:00 to 13:00, the job will actually finish at 17:00 (16:00 + 1 hour unavailability).

6. Best practices

  1. Provide a default duration: Always specify a duration field as a fallback, even when using durationOnResources.

  2. Be realistic: Resource-specific durations should reflect real-world timing differences.

  3. Consider solver performance: Using many resource-specific durations increases the search space; use them when the timing differences are significant.

  4. Test your model: Verify that the solver is making reasonable assignments given your duration specifications.

Next

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

  • Learn about tags and specific resources.

  • Learn about time windows.

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