# Prerequisites

A prerequisite is a task that has to finish before another task can start. This is
how a workflow enforces its order instead of relying on people to remember it.

## How they work

Draw a line from one task to another in the [builder](building-a-workflow.md) and
you have said: *the second one waits for the first one.*

On a [checklist](checklists.md), the second task shows as **Blocked**, with a line
reading "Waiting on Deploy job". Nobody can work it yet. When the first task
closes, the second turns **Ready** on its own -- no one has to release it.

A task with no prerequisites is Ready from the moment the checklist is generated.

## Several prerequisites

A task can wait on more than one. It stays blocked until **every** one of them has
closed, and its "Waiting on" line names what is still outstanding.

## Things that happen at the same time

Two tasks that share the same prerequisite both turn Ready together, and either
can be done first. This is how you say "these two can happen in parallel" -- give
them the same predecessor and no line between them.

The Production deploy workflow does exactly this: `prep-release` unblocks both
`run-migrations` and `flip-flags`, and `ci-deploy` waits for both of them.

## Skipping still unblocks

A [skipped](task-statuses.md) task counts as closed for this purpose. Skip a task
and everything waiting on it turns Ready, exactly as if it had been completed.

That is deliberate -- it means Skip is a safe way past a task that does not apply
this time, rather than something that strands the rest of the checklist.

## Circular prerequisites

If A waits on B and B waits on A, neither can ever start. The builder catches this
and refuses to publish until you break the loop.

## Next

- [Task and checklist statuses](task-statuses.md)
- [Building a workflow](building-a-workflow.md)
- [Why is my task blocked?](faq.md)
