> ## 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.

# Triggers

> Subscribe an automation to events and use their typed data.

A trigger declares an event that can start an automation. Trigger functions
return a signal containing the event data.

```ts theme={null}
import { automation } from "automate.ax"
import { markAsRead, onNewEmail } from "automate.ax/gmail"

export default automation("Read incoming Gmail messages", () => {
  const email = onNewEmail()

  markAsRead({ messageIds: email.messageId })
})
```

Deploying this program configures the Gmail event source. When a qualifying
message arrives, Automate.ax creates an execution context and materializes the
`email` signal with the parsed message.

## Configuration and event data

Arguments passed to the trigger configure the subscription. The returned signal
contains data from one matching event:

```ts theme={null}
const request = onHttpRequest({
  scope: "automation",
  waitForResponse: true,
})

log({ value: request.path })
```

The [Triggers reference](/reference/triggers) documents each trigger's
configuration, event shape, filtering, and delivery behavior.

## Trigger configuration is static

Event infrastructure is configured during deployment, before runtime values
exist. Configuration that selects an event source—such as the account watched
by `onNewEmail`—must therefore be static. A signal cannot choose the trigger's
account at runtime.

Action account inputs are different: an action may select an account from a
signal because that selection is resolved when the action executes. See
[Integration accounts](/concepts/integration-accounts).

## Delivery and idempotency

Automate.ax owns provider subscriptions, renewal, ingestion, and durable event
delivery. Provider notifications can be delivered more than once, so event
sources normalize and deduplicate them using provider identities where the
integration supports it.

An event accepted by the active deployment keeps its own execution context.
Actions in that context consume only its trigger and action outputs.

## HTTP responses

HTTP triggers normally acknowledge accepted work immediately. With
`waitForResponse: true`, ingress waits up to ten seconds for
`respondToHttpRequest` in the same automation context. A missing response
returns `504`; execution can continue after the caller times out.
