# AWL roles and bindings

Compose portable role contracts with venue queues and harness settings at deploy time.

A role declares the action contract a flow needs. A binding supplies a venue’s queue and harness settings. Check each composed source and binding pair before deploying it.

> Requires main
> Venue bindings require a newer main build than the public 18 September 2026 crate. See [release availability](/aion/reference/sources/).


## Binding words

- `role`: Declares a worker with its venue-varying half lifted out: the action contracts and the closed set of harness kinds stay here, and a binding supplies the queue and the launch at deploy. Arguments: form: declaration; positions: top-level.
- `binding`: Opens a `.awlb` document and names the venue; the name is what every module this binding mints is known by, so two venues of one source never collide on routing. Arguments: form: declaration; positions: binding-header.
- `bind`: Supplies one role's venue facts — its task queue and its `harness` section — and states every one of them, because a binding has no defaults. Arguments: form: declaration; positions: binding-header.
- `queue`: Names the task queue one venue serves a role on; it is the composed worker's name, and it is the venue's choice rather than the flow's. Arguments: form: header-clause; positions: bind-block.


## Source and venue forms

**Roles and bindings — syntax 1**

```text
//! One flow, any venue: the contracts stay here, the seat arrives at deploy.
workflow review_change
  input repo: String
  input diff: String
  outcome reviewed: type Verdict, route success

type Verdict { text: String, final_message: String, stop_reason: String, session_id: String }

role judge
  kind norn | acp
  action review(repo: String, prompt: String) -> Verdict
    agent, timeout 10m

step review
  review(repo: repo, prompt: diff) -> verdict
  route reviewed(verdict)
```


**Roles and bindings — syntax 2**

```text
aion deploy review_change.awl --bind venues/dean.awlb
```


**Roles and bindings — syntax 3**

```text
//! The dean box: a Norn seat, three at a time, on that box's own paths.
binding dean
  bind judge
    queue judge_dean
    harness
      kind norn
      concurrency 3
      reconnect_initial_backoff 1s
      reconnect_max_backoff 30s
      reconnect_max_attempts 100
      env_pass "PATH", "HOME", "USER"
      args "--account", "default"
      cwd from repo
```


A role admits a closed set of harness kinds. A binding supplies exactly the roles the source requires and must choose an admitted kind. Missing, extra or duplicate binds and incompatible contracts are refused with the source file that must change.

## Composition

Use the check command's repeatable bind option to validate every venue pair. Deployment composes the source and binding locally before upload. An archive cannot be bound again.

The binding names a venue-distinct workflow type. Carry the type returned by the deployment receipt when starting it. The venue reading reports which deployed venue versions lag the newest source deployment.

Read [deploy and venues](/aion/reference/cli-runs/) for the command help.
