Skip to main content
Demands let you specify coverage requirements without creating explicit shifts. The solver assigns employees to existing shifts that best satisfy the demand constraints.
Demand vs supply of shifts

Demand-based scheduling optimizes the overlap between shift supply and staffing demand

Use Cases

  • Peak hour coverage - Ensure minimum staffing during busy periods
  • Event staffing - Temporary increased coverage for special events
  • Flexible scheduling - Define needs without rigid shift boundaries

Basic Demand

Define a demand period with minimum and maximum staffing levels:
{
  "employees": [
    { "name": "Alice" },
    { "name": "Bob" },
    { "name": "Carol" }
  ],
  "shifts": [
    {
      "name": "morning",
      "from": "2022-01-01T08:00:00",
      "to": "2022-01-01T14:00:00",
      "min": 0,
      "max": 2
    },
    {
      "name": "afternoon",
      "from": "2022-01-01T12:00:00",
      "to": "2022-01-01T18:00:00",
      "min": 0,
      "max": 2
    }
  ],
  "demands": [
    {
      "name": "lunch-rush",
      "from": "2022-01-01T11:00:00",
      "to": "2022-01-01T14:00:00",
      "skills": [{ "name": "general" }],
      "min": 2,
      "max": 3
    }
  ]
}
The solver assigns employees to shifts that overlap with the demand period, ensuring at least 2 people cover the lunch rush from 11:00-14:00.

Demand Properties

name
string
required
Unique identifier for the demand period
from
datetime
required
Start time of the demand period (ISO 8601 format)
to
datetime
required
End time of the demand period (ISO 8601 format)
skills
array
required
Required skills for this demand period
min
integer
required
Minimum number of employees required during this period
max
integer
required
Maximum number of employees allowed during this period

Demand vs Shifts

ApproachBest For
Shifts onlyFixed schedules with predictable staffing
Demands onlyFlexible coverage requirements
CombinedComplex scenarios with both fixed and variable needs
Use demands when you care about coverage during a time window but don’t want to micromanage which specific shifts provide that coverage.