A shift swap broker on AWS for a few dollars a month
Shift swapping in a small business happens in a group chat, and the group chat is genuinely quite good at the social part. What it cannot do is check anything. So the swap gets agreed by two people on Tuesday and a manager discovers on Thursday that the cover is not trained on the till, or is already on a double, or has just gone into overtime. This post walks through a small system that does the checking before anybody agrees to anything.

Key takeaways
- Eligibility is checked before an offer is made, not after a swap is agreed.
- Four checks: qualified, free, not into overtime, not over their swap cap.
- Offers go out in an order you set, not to everybody at once.
- A manager approves one clean swap. Nothing writes the rota except that approval.
- Designed on AWS for about $2 a month.
The whole system on one page
Before any code, here is the shape of what we are designing.
- Machine learning
- Management
- Analytics
- People
The four checks
| Check | Reads | Why it has to come first |
|---|---|---|
| Qualified | The skills each station needs | A swap onto a station somebody cannot work is not a swap |
| Free | The rota for that day and around it | Already on, or on a rest day that would be broken |
| Overtime | Hours already rostered that week | A swap that quietly costs time-and-a-half |
| Swap cap | Swaps taken in a rolling window | One person absorbing every gap is a problem for them |
Every one of those is checkable in advance and none of them is checkable in a group chat. Doing them before the offer rather than after the agreement is the entire design, because a swap that gets agreed and then refused is worse for everybody than one that was never offered.
What runs on every request (the inside)
- Eligibility. Runs the four checks against everybody and produces a short ordered list, usually three to six people. It is arithmetic against a rota and a rules sheet, and no model is involved anywhere in it.
- The offer loop. Offers the shift to the list in order, one or a few at a time, with a time limit. Offering to everybody at once produces a race and hurt feelings; offering one at a time takes too long. Part 4 covers the middle ground.
- Approval. Sends the manager one message: who is giving up what, who is taking it, and the sentence that matters — that all four checks passed, or which one was overridden. One tap writes the swap to the rota.
One swap, end to end
- Machine learning
- Management
- Analytics
- Front-end & mobile
- People
In plain words
A supervisor cannot work Thursday evening and says so on Monday. The eligibility check runs: eleven people work that site, four are already on Thursday, two are not trained on the station, one would cross forty hours, and one has taken four extra shifts this month and is at their cap. That leaves three, ordered by who has taken the fewest extra shifts recently.
The offer goes to those three with a four-hour window. The second one accepts within twenty minutes. The manager gets one message: “Thursday 6–11, Ash giving up, Rae taking. Qualified, free, 31 hours before this, 3 swaps in the last 30 days. Approve?” They tap approve on their phone and the rota updates. Total manager involvement: about eight seconds, and the alternative is a group chat they have to read and then check four things by hand.
Design rules that shaped every decision
- Check before you offer. A swap that is agreed and then refused damages more than one that was never offered.
- Offer in an order, not to everybody. A free-for-all gives every shift to whoever has notifications on.
- The cap protects the person as much as the business. Somebody absorbing every gap is heading somewhere bad.
- Only approval writes the rota. The system proposes; a manager decides, always.
- An override is allowed and recorded. Sometimes the untrained person is the right answer and a manager knows why.
- Nobody is told who declined. A shift going to the third person on the list is not information anybody needs.
Why this shape
The group chat is not the problem; it is a reasonable place to ask a question. The problem is that the answer it produces is unverified, and verification is exactly the part a computer does well and a manager does slowly on a Thursday.
So the design leaves the social part alone — people still know who covered for them, and can still ask each other directly — and inserts the four checks in front of the offer. A manager stops being the person who discovers problems and becomes the person who approves a decision that has already been checked.
The next four posts walk through each piece: how a shift gets offered up, how eligibility is computed, how the offer loop works, and how an approval writes the rota. One diagram per post, a cost breakdown, and an engineering reference at the end.
All posts