Dashboard

How to Use AI to Write a Staff Rota

A staff rota is a constraints problem, not a writing problem. The exact constraints to give AI, and the three it will quietly break if you do not.

Steve Jefferson
Steve Jefferson
Developer Advocate
3 October 20261 min read

A rota is not a document. It is a set of constraints with a timetable fitted inside them, and the reason AI rotas come back wrong is that people paste in a list of names and shifts and expect the constraints to be inferred. They will not be. Give the model the constraints explicitly and the quality jumps immediately, because the hard part was never the writing.

This is the process, including the three constraints that get broken silently if you leave them out.

Start with the inputs, not the prompt

Before you open a chat, write down five things. Most of them live in your head and nowhere else, which is exactly why the rota takes two hours every week.

  1. Opening hours per day, including the days that differ.

  2. Minimum cover per period: how many people on the floor at 8am Tuesday versus 7pm Saturday. Not an average. The periods where you have been caught short.

  3. Each person's contracted or expected hours, and whether they are a maximum or a target.

  4. Each person's availability, including the standing ones: college Wednesdays, no Sunday evenings, school run until 9:30.

  5. Who is trained for what. The till, the coffee machine, opening up, closing the money, being the only first-aider on site.

That last one is the list most places have never written down. Writing it down is worth more than the rota.

The three constraints AI breaks silently

Give it everything above and you will still get a rota that looks plausible and is wrong in one of three specific ways. These are the ones to state in hard language, because the model will otherwise optimise straight through them.

Minimum rest between shifts. The classic failure is a close followed by an open: finish at 23:00, start at 07:00. The hours add up correctly, the person's weekly total is right, and nobody can work it. State a number: "no shift may start less than 11 hours after the previous shift ends."

Holiday and absence already approved. If you paste a list of names, the model treats every name as available all week. Approved leave has to be an explicit exclusion, by person and date, or it will schedule straight over it and you will find out when somebody does not arrive.

Station coverage, not just headcount. Three people on a shift satisfies "three people on a shift" while leaving nobody who can open the till. Express this as a per-period requirement: "every trading period needs at least one keyholder and at least one person trained on coffee."

The prompt

Give it the structure, the constraints, and the output format. Fill in your own numbers.

text
Build a staff rota for the week of 6 October.

Opening hours:
Mon to Fri 07:00 to 18:00, Sat 08:00 to 17:00, Sun closed.

Minimum cover:
Mon to Fri 07:00 to 10:00: 3 people
Mon to Fri 10:00 to 15:00: 2 people
Mon to Fri 15:00 to 18:00: 3 people
Sat all day: 4 people

Staff, contracted hours, availability, trained stations:
- Amira, 32h, not available Wednesdays, trained: till, coffee, keyholder
- Dan, 16h, evenings only after 15:00, trained: till
- Priya, 38h, fully available, trained: till, coffee, keyholder, first aid
- Tom, 20h, no Saturdays, trained: coffee

Hard constraints, do not violate any of these:
- No shift may start less than 11 hours after the previous one ends.
- Approved leave: Dan is off Thu 9 Oct and Fri 10 Oct.
- Every trading period needs at least 1 keyholder on shift.
- Every trading period needs at least 1 person trained on coffee.
- Nobody exceeds their contracted hours.
- A first-aider must be on site whenever we are open.

Output a table with one row per person and one column per day,
showing start and end times or OFF. Below the table, list each
person's total hours. Below that, list any constraint you could
not satisfy and why. Do not silently drop a constraint.

That final instruction earns its place. Without it, an unsatisfiable rota comes back looking satisfied, because the model will quietly relax whichever rule was in the way. With it, you get told which rule bit, which is usually the real finding: you do not have enough keyholders.

Check it before anyone sees it

Four checks, two minutes, in this order. Do them yourself, not with the model, because asking the model to grade its own rota reproduces the same blind spot.

Check

How

Rest gaps

Scan for any close followed by a next-day open

Leave respected

Compare against your approved leave list, not the prompt

Station cover

For each trading period, is the required skill actually present

Hours

Add each row up yourself, the totals are often confidently wrong

Arithmetic is the one to watch. Language models are poor at adding columns of numbers and completely unembarrassed about it. If the rota software you already use can import a table, let it do the totals.

What to do with the leftovers

The useful output is often the "could not satisfy" list. It tends to say the same thing every week, and the thing it says is a staffing decision rather than a scheduling one: one keyholder short, or one person carrying every Saturday. That is the part to act on. The rota itself only moves names around a problem that is fixed elsewhere, usually by training one more person on the station that keeps appearing as the blocker. Onboarding a new employee with AI covers getting that training written down once.

Where this fits

A rota is one of several weekly admin jobs where the value is in forcing the constraints into writing rather than in the generated output. The same shape applies to using AI for inventory reordering, and the pattern of running it on your own numbers rather than a template is the general approach in AI for small business. If the rota keeps breaking because people do not turn up, that is a different problem, handled in reducing no-shows with AI scheduling.

If your rota has to respect availability and shift limits, the companion guide on how to schedule staff shifts with AI covers that side of the problem.

FAQ

Should I give AI my staff's real names?

Use first names only, and leave out anything you would not put on a noticeboard. Medical reasons for availability, for instance, do not belong in a prompt. Write "not available Tuesday mornings" rather than why.

Can AI replace rota software?

For a team of four to twelve, a chat and a spreadsheet work. Above that, or anywhere with shift swapping and clock-ins, use rota software and let AI help with the awkward weeks rather than the routine ones.

Why does it keep going over contracted hours?

Because minimum cover and contracted hours are usually in conflict and the model resolves the conflict in favour of whichever you stated more forcefully. Mark hours as a hard cap and ask explicitly for a shortfall list.

How do I handle shift swaps after the rota goes out?

Re-run the whole week with the swap as an added constraint rather than patching one cell. Patches are where the rest-gap violations creep back in.

How did this land?

About the author

Steve Jefferson
Steve Jefferson

Developer Advocate

Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.