NextRouteNextRoute

Master Routes (Templates)

Understand master route templates — the recurring patterns that drive daily route generation.

Master Routes (Templates)

A master route (also called a route template) is a recurring pattern that defines which customers get serviced, on what day, and in what order. Daily routes are generated from these templates.

Master Routes

Template Structure

FieldDescription
nameTemplate name (e.g., "North Charleston - Tue")
service_zone_idThe zone this template covers
day_of_weekWhich day of the week this template runs
default_driver_idDriver inherited by generated routes
default_vehicle_idVehicle inherited by generated routes
max_stopsMaximum stops per generated route (optional)
is_activeWhether this template generates routes

Template Stops

Each template contains a list of template stops — one per property to be serviced. Each stop defines:

FieldDescription
property_idThe property to visit
customer_idThe owning customer
sequenceOrder in the route (1, 2, 3...)
frequencyweekly, biweekly, monthly, quarterly, annually, seasonal, one_time
week_parityFor biweekly: A, B, or every
month_weekFor monthly: 1st, 2nd, 3rd, 4th, or last
service_duration_minEstimated time at this stop
preferred_time_window_startEarliest arrival time
preferred_time_window_endLatest arrival time
approval_statusapproved or pending
is_activeWhether this stop is included in generation

Approval Workflow

When a new customer is added to a zone (either manually or via auto_add_to_route), a template stop is created. The stop's approval status depends on your settings:

  • Auto-add enabled (auto_add_to_route = true): Stop is created with approval_status = 'approved' and immediately included in route generation.
  • Manual approval required (auto_add_to_route = false): Stop is created with approval_status = 'pending'. A dispatcher must review and approve it before it appears on generated routes.

To approve pending stops:

  1. Open the master route template
  2. Look for stops with a "Pending" badge
  3. Click Approve to include them in future routes

Stop Sequence & Optimization

Template stops have a sequence field that determines the default order. You can:

  • Drag and drop stops to manually reorder them
  • Optimize the template to set the most efficient sequence based on geographic proximity
  • The optimized sequence carries over to generated daily routes

Cloning Templates

To duplicate a template (useful when splitting a large zone):

  1. Open the template
  2. Click Clone
  3. A new template is created with the same stops and settings
  4. Modify the clone as needed (rename, remove stops, assign different driver)

Template Lifecycle

Template created (from zone)

Stops added (manual or auto-add)

Stops approved (if manual approval)

Template optimized (optional)

Daily routes generated from template

How Generation Uses Templates

When the route generation engine runs for a given date:

  1. Finds all active templates where day_of_week matches the date
  2. For each template, iterates through approved, active stops
  3. Filters stops by frequency:
    • Weekly: Always included
    • Biweekly: Included if the week parity matches (A or B)
    • Monthly: Included if the week-of-month matches (1st, 2nd, 3rd, 4th, last)
    • Quarterly: Included in the first month of each quarter
    • Annually: Included once per year
    • Seasonal: Included only during configured active months
  4. Excludes stops for customers with active vacation holds or service skips
  5. Excludes the date if it is a blackout date
  6. Creates a draft route with the filtered stops