Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
  • Platform
Try models
  • Pick-up and Delivery Routing
  • Real-time planning with patches
  • Real-time planning: no show (using patches)

Pick-up and Delivery Routing

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Use case guide
      • Planning AI concepts
      • Integration
      • Constraints
      • Understanding the API
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
        • Planning window
      • Input validation
      • Output datasets
        • Metadata
        • Model output
        • Input metrics
        • Key performance indicators (KPIs)
      • Routing with Timefold’s maps service
      • Metrics and optimization goals
    • Driver resource constraints
      • Lunch breaks and personal appointments
      • Route optimization
      • Shift hours and overtime
      • Driver capacity
    • Job service constraints
      • Time windows and opening hours
      • Skills
      • Multi-day schedules and movable stops
      • Dependencies between stops
      • Priority jobs and optional jobs
      • Stop service level agreement (SLA)
      • Job requirements and tags
        • Job required drivers
        • Job pooling
        • Prohibit job combinations
        • Maximum time burden
        • Tags
    • Recommendations
      • Job time window recommendations
      • Stop time window recommendations
    • Real-time planning
      • Real-time planning: pinning stops
      • Real-time planning: extended stop
      • Real-time planning: reassignment
      • Real-time planning: no show
      • Real-time planning: driver ill
    • Real-time planning with patches
      • Real-time planning: pinning stops (using patches)
      • Real-time planning: extended stop (using patches)
      • Real-time planning: reassignment (using patches)
      • Real-time planning: no show (using patches)
      • Real-time planning: driver ill (using patches)
    • Changelog
    • Upgrading to the latest versions
    • Feature requests

Real-time planning: no show (using patches)

This guide describes functionality that relies on the Patch feature, which is currently only available as a preview feature. If you’d like early access to this feature, please Contact us. For information about real-time planning without the Patch functionality, see Real-time planning.

There are many situations where Real-time planning with patches is necessary.

Sometimes customers are not available at the scheduled time.

When Carl arrives at his first stop of the day, the customer isn’t there. Carl lets head office know, and they start re-planning the stops for his shift.

Carl waits for 10 minutes at the customer location, but the customer doesn’t show up. The real-time plan is published and Carl goes to his next stop.

This guide explains real-time planning: no shows with the following:

  • 1. Batch schedule: no show
  • 2. Real-time planning update: no show

1. Batch schedule: no show

Learn how to configure an API Key to run the examples in this guide:
  1. Log in to Timefold Platform: app.timefold.ai

  2. From the Dashboard, click your tenant, and from the drop-down menu select Manage tenant, then choose API Keys.

  3. Create a new API key or use an existing one. Ensure the list of models for the API key contains the Pick-up and Delivery Routing model.

In the examples, replace <API_KEY> with the API Key you just copied.

Carl’s original schedule was generated from the following input dataset during the regular batch scheduling:

  • Input

  • Output

Try this example in Timefold Platform by saving this JSON into a file called sample.json and make the following API call:
curl -X POST -H "Content-type: application/json" -H 'X-API-KEY: <API_KEY>' https://app.timefold.ai/api/models/pickup-delivery-routing/v1/route-plans [email protected]
{
  "config": {
    "run": {
      "name": "Original shift plan: no show example"
    }
  },
  "modelInput": {
    "drivers": [
      {
        "id": "Carl",
        "shifts": [
          {
            "id": "Carl Mon",
            "startLocation": [33.77284, -84.42989],
            "minStartTime": "2027-02-01T09:00:00Z",
            "maxEndTime": "2027-02-01T13:30:00Z"
          }
        ]
      }
    ],
    "jobs": [
      {
        "id": "Job 1",
        "stops": [
          {
            "id": "Stop A",
            "name": "Stop A",
            "location": [33.74648, -84.46461],
            "duration": "PT30M"
          },
          {
            "id": "Stop B",
            "name": "Stop B",
            "location": [33.65207, -84.46496],
            "duration": "PT30M"
          }
        ]
      },
      {
        "id": "Job 2",
        "stops": [
          {
            "id": "Stop C",
            "name": "Stop C",
            "location": [33.77911, -84.49644],
            "duration": "PT30M"
          },
          {
            "id": "Stop D",
            "name": "Stop D",
            "location": [33.65979, -84.46366],
            "duration": "PT30M"
          }
        ]
      },
      {
        "id": "Job 3",
        "stops": [
          {
            "id": "Stop E",
            "name": "Stop E",
            "location": [ 33.78468, -84.48469],
            "duration": "PT30M"
          },
          {
            "id": "Stop F",
            "name": "Stop F",
            "location": [ 33.67966, -84.30062 ],
            "duration": "PT30M"
          }
        ]
      }
    ]
  }
}
To request the solution, locate the ID from the response to the post operation and append it to the following API call:
curl -X GET -H 'X-API-KEY: <API_KEY>' https://app.timefold.ai/api/models/pickup-delivery-routing/v1/route-plans/<ID>
{
  "metadata": {
    "id": "ID",
    "originId": "ID",
    "name": "Original shift plan: no show example",
    "submitDateTime": "2026-04-10T09:48:00.417874+02:00",
    "startDateTime": "2026-04-10T09:48:00.478676+02:00",
    "activeDateTime": "2026-04-10T09:48:00.479147+02:00",
    "completeDateTime": "2026-04-10T09:48:30.483707+02:00",
    "shutdownDateTime": "2026-04-10T09:48:30.483709+02:00",
    "solverStatus": "SOLVING_COMPLETED",
    "score": "0hard/0medium/-3815soft",
    "validationResult": {
      "summary": "OK"
    }
  },
  "modelOutput": {
    "drivers": [
      {
        "id": "Carl",
        "shifts": [
          {
            "id": "Carl Mon",
            "startTime": "2027-02-01T09:00:00Z",
            "itinerary": [
              {
                "id": "Stop E",
                "arrivalTime": "2027-02-01T09:06:17Z",
                "startServiceTime": "2027-02-01T09:06:17Z",
                "departureTime": "2027-02-01T09:36:17Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT6M17S",
                "travelDistanceMetersFromPreviousStandstill": 5233,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop C",
                "arrivalTime": "2027-02-01T09:37:47Z",
                "startServiceTime": "2027-02-01T09:37:47Z",
                "departureTime": "2027-02-01T10:07:47Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT1M30S",
                "travelDistanceMetersFromPreviousStandstill": 1250,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop A",
                "arrivalTime": "2027-02-01T10:13:23Z",
                "startServiceTime": "2027-02-01T10:13:23Z",
                "departureTime": "2027-02-01T10:43:23Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT5M36S",
                "travelDistanceMetersFromPreviousStandstill": 4671,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop D",
                "arrivalTime": "2027-02-01T10:54:57Z",
                "startServiceTime": "2027-02-01T10:54:57Z",
                "departureTime": "2027-02-01T11:24:57Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT11M34S",
                "travelDistanceMetersFromPreviousStandstill": 9640,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop B",
                "arrivalTime": "2027-02-01T11:25:59Z",
                "startServiceTime": "2027-02-01T11:25:59Z",
                "departureTime": "2027-02-01T11:55:59Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT1M2S",
                "travelDistanceMetersFromPreviousStandstill": 867,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop F",
                "arrivalTime": "2027-02-01T12:14:36Z",
                "startServiceTime": "2027-02-01T12:14:36Z",
                "departureTime": "2027-02-01T12:44:36Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT18M37S",
                "travelDistanceMetersFromPreviousStandstill": 15515,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "kind": "STOP"
              }
            ],
            "metrics": {
              "totalTravelTime": "PT1H3M35S",
              "travelTimeFromStartLocationToFirstStop": "PT6M17S",
              "travelTimeBetweenStops": "PT38M19S",
              "travelTimeFromLastStopToEndLocation": "PT18M59S",
              "totalTravelDistanceMeters": 52996,
              "travelDistanceFromStartLocationToFirstStopMeters": 5233,
              "travelDistanceBetweenStopsMeters": 31943,
              "travelDistanceFromLastStopToEndLocationMeters": 15820,
              "endLocationArrivalTime": "2027-02-01T13:03:35Z"
            }
          }
        ]
      }
    ],
    "unassignedJobs": []
  },
  "inputMetrics": {
    "jobs": 3,
    "stops": 6,
    "drivers": 1,
    "driverShifts": 1,
    "pinnedStops": 0
  },
  "kpis": {
    "totalTravelTime": "PT1H3M35S",
    "totalTravelDistanceMeters": 52996,
    "totalActivatedDrivers": 1,
    "totalUnassignedJobs": 0,
    "totalAssignedJobs": 3,
    "assignedMandatoryJobs": 3,
    "totalUnassignedStops": 0,
    "totalAssignedStops": 6,
    "assignedMandatoryStops": 6,
    "travelTimeFromStartLocationToFirstStop": "PT6M17S",
    "travelTimeBetweenStops": "PT38M19S",
    "travelTimeFromLastStopToEndLocation": "PT18M59S",
    "travelDistanceFromStartLocationToFirstStopMeters": 5233,
    "travelDistanceBetweenStopsMeters": 31943,
    "travelDistanceFromLastStopToEndLocationMeters": 15820
  }
}

modelOutput contains Carl’s shift itinerary.

2. Real-time planning update: no show

Carl reported the customer of his first job was not present when he arrived, so he waited at the pick-up location.

Update the duration for Stop E from 30 minutes to 10 minutes.

As Carl hasn’t picked up the order, the delivery stop for this job should be removed from the dataset.

The customer was not present and the work wasn’t completed. Assuming the customer still wants the work completed, the whole job will need to be rescheduled for a later time.

The duration for Stop E needs to be updated from 30 minutes to 10 minutes.

The following shows the required input and the patch operation that will change the original input:

  • Input

  • Patch

{
  "id": "Job 3",
  "stops": [
    {
      "id": "Stop E",
      "name": "Stop E",
      "location": [ 33.78468, -84.48469],
      "duration": "PT10M"
    }
  ]
}
[
  {
    "op": "replace",
    "path": "/jobs/[id=Job 3]/duration",
    "value": "PT10M"
  },
  {
    "op": "remove",
    "path": "/jobs/[id=Job 3]/stops/[id=Stop F]"
  }
]
In case, the job has a demand, the demand should also be updated to reflect the fact that the job was not completed.

Carl arrived at Stop E at 09:06 and waited 10 minutes. freezeTime is set to 09:15 so that his next stops can be rescheduled, and he can travel to the next location.

The following shows the required input and the patch operation that will change the original input:

  • Input

  • Patch

{
  "modelInput": {
    "freezeTime": "2027-02-01T09:15:00Z"
  }
}
{
  "op": "add",
  "path": "/freezeTime",
  "value": "2027-02-01T09:15:00Z"
}

Submit the following patch to generate a new revision of the plan.

  • Patch

  • Output

Try this example in Timefold Platform by saving this JSON into a file called patch.json and make the following API call:
curl -X POST -H "Content-type: application/json" -H 'X-API-KEY: <API_KEY>' https://app.timefold.ai/api/models/pickup-delivery-routing/v1/route-plans/<ID>/from-patch [email protected]
{
  "config": {
    "run": {
      "name": "Real-time planning: no show example"
    }
  },
  "patch": [
    {
      "op": "add",
      "path": "/freezeTime",
      "value": "2027-02-01T09:15:00Z"
    },
    {
      "op": "replace",
      "path": "/jobs/[id=Job 3]/duration",
      "value": "PT40M"
    },
    {
      "op": "remove",
      "path": "/jobs/[id=Job 3]/stops/[id=Stop F]"
    }
  ]
}
To request the solution, locate the ID from the response to the post operation and append it to the following API call:
curl -X GET -H 'X-API-KEY: <API_KEY>' https://app.timefold.ai/api/models/pickup-delivery-routing/v1/route-plans/<ID>
{
  "metadata": {
    "id": "ID",
    "originId": "ID",
    "name": "Original shift plan: no show example",
    "submitDateTime": "2026-04-10T10:39:47.865413+02:00",
    "startDateTime": "2026-04-10T10:39:47.934356+02:00",
    "activeDateTime": "2026-04-10T10:39:47.935839+02:00",
    "completeDateTime": "2026-04-10T10:40:17.951177+02:00",
    "shutdownDateTime": "2026-04-10T10:40:17.95118+02:00",
    "solverStatus": "SOLVING_COMPLETED",
    "score": "0hard/0medium/-2554soft",
    "validationResult": {
      "summary": "OK"
    }
  },
  "modelOutput": {
    "drivers": [
      {
        "id": "Carl",
        "shifts": [
          {
            "id": "Carl Mon",
            "startTime": "2027-02-01T09:00:00Z",
            "itinerary": [
              {
                "id": "Stop E",
                "arrivalTime": "2027-02-01T09:06:17Z",
                "startServiceTime": "2027-02-01T09:06:17Z",
                "departureTime": "2027-02-01T09:16:17Z",
                "effectiveServiceDuration": "PT10M",
                "travelTimeFromPreviousStandstill": "PT6M17S",
                "travelDistanceMetersFromPreviousStandstill": 5233,
                "minStartTravelTime": "2027-02-01T00:00:00Z",
                "load": [],
                "pinned": true,
                "kind": "STOP"
              },
              {
                "id": "Stop C",
                "arrivalTime": "2027-02-01T09:17:47Z",
                "startServiceTime": "2027-02-01T09:17:47Z",
                "departureTime": "2027-02-01T09:47:47Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT1M30S",
                "travelDistanceMetersFromPreviousStandstill": 1250,
                "minStartTravelTime": "2027-02-01T09:15:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop A",
                "arrivalTime": "2027-02-01T09:53:23Z",
                "startServiceTime": "2027-02-01T09:53:23Z",
                "departureTime": "2027-02-01T10:23:23Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT5M36S",
                "travelDistanceMetersFromPreviousStandstill": 4671,
                "minStartTravelTime": "2027-02-01T09:15:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop D",
                "arrivalTime": "2027-02-01T10:34:57Z",
                "startServiceTime": "2027-02-01T10:34:57Z",
                "departureTime": "2027-02-01T11:04:57Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT11M34S",
                "travelDistanceMetersFromPreviousStandstill": 9640,
                "minStartTravelTime": "2027-02-01T09:15:00Z",
                "load": [],
                "kind": "STOP"
              },
              {
                "id": "Stop B",
                "arrivalTime": "2027-02-01T11:05:59Z",
                "startServiceTime": "2027-02-01T11:05:59Z",
                "departureTime": "2027-02-01T11:35:59Z",
                "effectiveServiceDuration": "PT30M",
                "travelTimeFromPreviousStandstill": "PT1M2S",
                "travelDistanceMetersFromPreviousStandstill": 867,
                "minStartTravelTime": "2027-02-01T09:15:00Z",
                "load": [],
                "kind": "STOP"
              }
            ],
            "metrics": {
              "totalTravelTime": "PT42M34S",
              "travelTimeFromStartLocationToFirstStop": "PT6M17S",
              "travelTimeBetweenStops": "PT19M42S",
              "travelTimeFromLastStopToEndLocation": "PT16M35S",
              "totalTravelDistanceMeters": 35476,
              "travelDistanceFromStartLocationToFirstStopMeters": 5233,
              "travelDistanceBetweenStopsMeters": 16428,
              "travelDistanceFromLastStopToEndLocationMeters": 13815,
              "endLocationArrivalTime": "2027-02-01T11:52:34Z"
            }
          }
        ]
      }
    ],
    "unassignedJobs": []
  },
  "inputMetrics": {
    "jobs": 3,
    "stops": 5,
    "drivers": 1,
    "driverShifts": 1,
    "pinnedStops": 1
  },
  "kpis": {
    "totalTravelTime": "PT42M34S",
    "totalTravelDistanceMeters": 35476,
    "totalActivatedDrivers": 1,
    "totalUnassignedJobs": 0,
    "totalAssignedJobs": 3,
    "assignedMandatoryJobs": 3,
    "totalUnassignedStops": 0,
    "totalAssignedStops": 5,
    "assignedMandatoryStops": 5,
    "travelTimeFromStartLocationToFirstStop": "PT6M17S",
    "travelTimeBetweenStops": "PT19M42S",
    "travelTimeFromLastStopToEndLocation": "PT16M35S",
    "travelDistanceFromStartLocationToFirstStopMeters": 5233,
    "travelDistanceBetweenStopsMeters": 16428,
    "travelDistanceFromLastStopToEndLocationMeters": 13815
  }
}

modelOutput contains Carl’s updated shift itinerary.

Stop E was a no show, so Stop C, Stop A, Stop D and Stop B are rescheduled for earlier in the day. Stop F was removed from the itinerary as it was the delivery stop for the job that wasn’t completed.

Next

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

  • Learn about real-time planning.

  • Real-time planning with pinned stops.

  • Real-time planning with extended stops.

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