# Generate a schedule

> Create a draft for a period and let Staffedly fill it, then read the list of shifts it could not fill and why.

Generating fills a draft with shifts for a period. It places people only where your rules allow, spreads the work evenly, and gives you a named reason for every shift it could not fill. Nothing reaches your people until you publish.

![A draft after generating: 60 shifts created and four named gaps with their reasons](https://staffedly.com/docs/img/plan/generate-result.webp)

## Who can do it

Admins and schedulers. A teammate with custom access needs the **Scheduling** area at the manage level; see [Team and access](https://staffedly.com/docs/run/team-and-access).

Generation is part of every plan. It pauses if a free trial ends without a plan or a payment is overdue; editing the schedule by hand keeps working. See [Billing and plans](https://staffedly.com/docs/run/billing-and-plans).

## Before you start

The generator needs to know how many people each site needs.

- Add [shift types](https://staffedly.com/docs/plan/shift-types). The generator fills empty days in the period from them by itself.
- Or type the numbers on the [Coverage](https://staffedly.com/docs/plan/coverage) screen.

With neither, the run ends with a note that there is nothing to fill.

## Generate a draft

1. Open **Schedule**, then the **Versions & rotations** tab.
2. Under **Schedule versions**, pick the **from** and **to** dates and click **New draft**.
3. Click **open →** on the new row.
4. Click **⚡ Generate draft**.

The page shows the seconds elapsed while it builds. A large schedule can take a minute or more. You can leave the page: the build carries on, and the shifts are in the draft when you come back. The list of gaps is shown only on the page that started the build, so stay if you want to read it.

If your group schedules call, generate call first so that rest after call shapes the shifts. Open **Call**, then the **Generate** tab, and click **Draft call + shifts**. See [Call schedule](https://staffedly.com/docs/plan/call-schedule).

A new organization can do all of this in one click from the setup wizard; see [Your first schedule](https://staffedly.com/docs/getting-started/first-schedule).

## What the generator will not break

For every shift, each person of the right role is checked. A person is left out when any of these is true:

- They lack the skill the shift type needs.
- They are not eligible at the site: no current license for the site's state, an expired credential, no privileges there, or a supervision rule. See [Credentials](https://staffedly.com/docs/people/credentials).
- The site is outside their work area, or the trip from their other shift does not fit. See [Work area and travel limits](https://staffedly.com/docs/people/work-area).
- They have approved time off.
- They are already working at that time.
- They would be inside the rest period after in-house call, or have less than the minimum rest between two shifts.
- The shift would take them past the maximum days in a row.
- The shift would take them past their own weekly maximum of shifts or hours.

The rest periods and the days-in-a-row limit come from your [Rules](https://staffedly.com/docs/plan/rules). Weekly maximums are set per person under **Scheduling targets** on their page; see [Providers](https://staffedly.com/docs/people/providers).

## How it chooses between people

Among the people who pass every check, the shift goes to the one with the best score:

- Fewer shifts in the last 4 weeks, measured against their FTE, so a part-timer is not treated as behind.
- Fewer weekend shifts in the last 8 weeks, for weekend shifts.
- Not yet at their weekly target of 5 shifts times their FTE.
- The site is their home site, or a rule says to prefer them there.
- The site is near their home ZIP code. This counts for a little, after the fairness terms above.
- They said they are available at that time.
- They have not asked for the day off. A pending request counts against them; an approved one removes them.
- On a holiday, they did not work that holiday in recent years. See [Holidays and rotations](https://staffedly.com/docs/plan/holidays-and-rotations).

The same data always gives the same draft. No AI model picks people, and pay rates play no part.

Click any generated shift on the calendar to read **Why** that person was picked.

![The details of a generated shift, with the line that says why this person was picked](https://staffedly.com/docs/img/plan/generate-why.webp)

## The repair pass

After the first pass, the generator looks at each shift it could not fill. If someone placed elsewhere that same day could cover it, and a free person could take their place, it makes that swap. Both moves pass every check above, and both shifts say **Repair swap** in their reason.

## What "unfilled" means

A shift nobody could take is left empty and listed as a **named gap**: the site, the date, the role and why. The reason counts everyone who was checked, for example `10 CRNAs checked: 7 no Cardiac skill, 3 no current PA license`.

To close a gap before publishing, fix the cause (add the credential, change a rule, adjust coverage) and click **⚡ Generate draft** again, or assign someone by hand on the calendar. If you publish with gaps, each becomes an open shift; see [Open shifts](https://staffedly.com/docs/fill/open-shifts).

## Generate again

Generating a second time fills only what is still uncovered. It does not move or remove the shifts already in the draft, including ones you placed by hand. To start over, remove the draft's shifts or use a new draft.

Two builds of the same draft cannot run at once. A second click is refused with "This schedule is already being built." A draft cannot be published or discarded while it is being built.

If a build is cut short (for example by a Staffedly update while it runs), the draft keeps the shifts made so far. It may read as being built for up to 20 minutes; after that, click **⚡ Generate draft** again and it fills the rest.

## Questions

### Does generating notify anyone?

No. Shifts in a draft are private until you publish. See [Versions and publishing](https://staffedly.com/docs/plan/versions-and-publishing).

### Why did it leave a shift empty when someone looks free?

Read the gap's reason. Common causes are a missing license for that site's state, the days-in-a-row limit and a rest rule.

### Can it fill only one site?

Not from the screen. A draft covers every site, and generation fills every site that has coverage numbers in the period.
