Plan routes for one or more drivers
plan_routesSplit up to 100 stops across up to 10 drivers from one depot and put each driver's stops in the best order on real roads (Great Britain and US), within a shift length including time at each stop. Each driver gets google_maps_links: the day as chained Google Maps links of up to 9 stops each, every link starting where the last one ended (the Maps app takes about 10 stops a route), so a driver opens the first and then the next; plus google_maps_link_all_stops, one link with every stop, for a desktop browser. Stops that do not fit or cannot be reached come back in unassigned with the reason. A driver over the daily driving limits (EU/UK 9 hours, US 11) gets driving_limit_warning; low bridges under 4.6 m near a driver's road come back as low_bridges (advisory). The map of each driver's stops, numbered in order, shows in the chat by itself (no road line: the Google Maps links are the route). Set render to true only when the user wants to keep or share the map: it returns a link, GeoJSON and KML, and update_map can change it later. A kept route map carries each driver's Google Maps links.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depot | Yes | Where the drivers start: an address or {lat, lng}. | |
| stops | No | Addresses, or {id, name, address} / {id, name, lat, lng}. name labels the stop on the map and in the plan. | |
| title | No | The kept map's title when render is on. | |
| render | No | Also keep the map: a link to share with the drivers, GeoJSON and KML. | |
| source | No | Instead of typing rows: { sheet: "<Google Sheets link>", tab?: "Sites" } (shared with the InstaMaps service account, or viewable by anyone with the link), { file: "<Drive link to a CSV or Excel file>" }, or { run: "<run_id from an earlier answer>" }. Columns are found by their headers (id, name, address or its parts, lat/lng); name them if they aren't obvious (id_column, address_column, lat_column, lng_column; from_column and to_column for road distances). Rows with coordinates are used as they are. | |
| drivers | No | ||
| traffic | No | weekday (default): road times with the area's measured weekday slowdown (DfT delay on local 'A' roads by council and on motorways in Great Britain; the Urban Mobility Report's Travel Time Index by US urban area). free_flow: empty roads. | weekday |
| shift_hours | No | ||
| return_to_depot | No | ||
| service_minutes | No | Time spent at each stop. |