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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Route signals and work

> Select values, add prerequisites, and declare complementary automation paths.

Choose an operator by the path you need:

| Result                                         | Operator                                                                     |
| ---------------------------------------------- | ---------------------------------------------------------------------------- |
| Keep a value when a separate condition is true | [`gate`](/reference/runtime/signal-operators#gate)                           |
| Keep a value when its predicate matches        | [`filter`](/reference/runtime/signal-operators#filter)                       |
| Split one value into matching and other paths  | [`partition`](/reference/runtime/signal-operators#partition)                 |
| Make a value wait for other signals            | [`dependentOn`](/reference/runtime/signal-operators#dependenton)             |
| Apply prerequisites to a declaration section   | [`withPrerequisites`](/reference/runtime/signal-operators#withprerequisites) |
| Declare `if`, `else if`, and `else` sections   | [`branch`](/reference/runtime/signal-operators#branch)                       |
| Isolate durable hook numbering                 | [`scope`](/reference/runtime/signal-operators#scope)                         |
| Name and present a declaration group           | [`group`](/reference/runtime/signal-operators#group)                         |

## Route values

Use `filter` when the condition depends only on the value. Use `gate` when another signal supplies the condition. Use `partition` when both the matching and remaining paths do work.

```ts automations/route-requests.automation.ts theme={null}
import { automation, onInvocation, partition, sendEmail, t } from "automate.ax"

export default automation("Route requests", () => {
  const request = onInvocation<{ priority: string; summary: string }>()
  const [urgent, routine] = partition(
    request,
    (value) => value.priority === "urgent",
  )

  sendEmail({ subject: "Urgent request", text: t`${urgent.summary}` })
  sendEmail({ subject: "Routine request", text: t`${routine.summary}` })
})
```

Exactly one partition emits. The other closes, so actions attached to that path don't run.

## Route declaration sections

Use `branch` when an entire synchronous section changes:

```ts theme={null}
branch(
  urgent,
  () => sendEmail({ subject: "Urgent", text: "Escalate it." }),
  () => sendEmail({ subject: "Routine", text: "Queue it." }),
)
```

Don't declare triggers inside `branch` or `withPrerequisites`. Each trigger starts an independent root context. Use [`correlate`](/reference/runtime/signal-operators#correlate) to join related occurrences from separate triggers.

## Keep runs and declarations readable

Use [`markSignificant`](/reference/runtime/signal-operators#marksignificant) when an emitted signal should keep its connected run visible in Recent runs. Use `scope` to isolate durable hook numbering without changing execution. Use `group` when the same section also needs a name and initial presentation in run details.
