Make a shift schedule
generate_shift_scheduleUse this when the user wants an employee schedule maker or work schedule maker: build a weekly staff or shift schedule for a restaurant, cafe, retail store, clinic front desk or similar from staff names, roles or skills, availability (days or times people cannot work), min/max hours, and the shifts to cover with headcount, e.g. "make a weekly schedule for 6 employees", "need 2 people on each shift, nobody over 40 hours", "make a rotating schedule so weekends are fair", "who should close on friday", "Sam cannot work Mondays". Accepts typed lists or an attached availability CSV/XLSX. A deterministic solver checks each hard rule (roles, availability, max hours, overtime cap, minimum rest between shifts, shifts per day, consecutive days), balances weekend and closing shifts, and when coverage is impossible returns each open shift with the binding reason. Returns hours per person, overtime flags, fairness ranges, and a printable PDF, Excel file and per-employee calendar (.ics) files. Overnight shifts and daylight-saving weeks are counted in real elapsed hours. Does not post schedules, message staff, track clock-ins or run payroll. Do not use for job searches or for checking a schedule the user already made (use check_schedule).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| staff | No | The team, one item per person (up to 80), e.g. [{"name":"Ana","roles":["cook"],"max_hours":40,"unavailable":["Sun"]}]. Can be combined with staff_file. | |
| shifts | No | Shifts to cover, e.g. [{"day":"Mon-Fri","start":"07:00","end":"15:00","role":"cook","headcount":2}]. Required unless the attached .xlsx has a Shifts sheet. | |
| time_zone | No | The business's time zone, IANA or US name, e.g. "America/Chicago", "Pacific". Default America/New_York. Used for daylight-saving weeks and calendar files. | |
| staff_file | No | Optional staff availability spreadsheet the user attached (CSV or Excel .xlsx), e.g. availability.xlsx: a Name column plus Role, Max hours, Min hours, Unavailable, Preferred, and/or day columns (Mon..Sun) holding "off", "9-15" or blank for any time. An .xlsx may also hold a Shifts sheet (Day, Start, End, Role, Headcount). | |
| week_start | No | First day of the week to schedule, e.g. "2026-10-05". Default: next Monday. Dates pin calendar files and daylight-saving weeks to real hours. | |
| business_name | No | Optional name printed on the PDF, e.g. "Blue Door Cafe". | |
| allow_overtime | No | false (default): nobody is scheduled past overtime_after_hours. true: overtime is allowed when needed for coverage, kept as low as possible, and flagged. | |
| min_rest_hours | No | Minimum hours off between two shifts of the same person (the "clopening" rule), default 10, e.g. 8 or 11. 0 only blocks overlaps. | |
| max_shifts_per_day | No | Default shifts per person per day, default 1. Use 2 to allow split shifts (same-day shifts need no rest gap, only no overlap). | |
| max_consecutive_days | No | Most days in a row anyone may work in this week, default 6, e.g. 5. | |
| overtime_after_hours | No | Weekly hours after which time counts as overtime, default 40 (US federal FLSA workweek), e.g. 40. 0 turns overtime tracking off. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| week | Yes | ||
| notes | Yes | ||
| rules | Yes | ||
| staff | Yes | ||
| coverage | Yes | ||
| fairness | Yes | ||
| schedule | Yes | ||
| downloads | Yes | ||
| assumptions | Yes | ||
| open_shifts | Yes | ||
| open_shifts_not_shown | No |