> ## Documentation Index
> Fetch the complete documentation index at: https://errand.nuvrel.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> How `.ern` playbooks are structured, loaded, and run.

A playbook is one or more `.ern` files in the same directory. Errand reads all of them, merges their blocks, and runs the tasks you request.

## Block types

A playbook is made up of four block types:

<CardGroup cols={2}>
  <Card title="errand" icon="gear" href="/language/blocks#errand-block">
    Playbook-level settings.
  </Card>

  <Card title="variable" icon="sliders" href="/language/blocks#variable-block">
    A named input with an optional type and default.
  </Card>

  <Card title="computed" icon="calculator" href="/language/blocks#computed-block">
    A value derived from an expression at runtime.
  </Card>

  <Card title="task" icon="list-check" href="/language/blocks#task-block">
    A named group of shell commands.
  </Card>
</CardGroup>

Every block except `errand` takes a name label. Names must be unique within each block type:

```hcl theme={null}
variable "env" { ... }
computed "image_tag" { ... }
task "deploy" { ... }
```

## Evaluation order

Errand processes the playbook in three phases:

1. **Variables** are resolved from defaults and `--var` flags.
2. **Computed** blocks evaluate in dependency order, before any task runs.
3. **Tasks** run in the order their dependencies require, with optional concurrency.

## References

Blocks refer to each other with dot notation. Referencing a block creates an implicit dependency: Errand ensures the referenced block runs first.

| Reference         | Refers to                   |
| ----------------- | --------------------------- |
| `var.<name>`      | A declared `variable` block |
| `computed.<name>` | A declared `computed` block |
| `task.<name>`     | A declared `task` block     |

See [references](/language/references) for the full dependency system, including cycle detection and explicit dependencies.
