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

# On HTTP request

> Start an automation when its Automate.ax HTTP endpoint receives a request.

`onHttpRequest` subscribes an automation to HTTP requests. Use automation scope
for a route owned by one automation, or project scope when the project should
receive the route.

## Example

```ts automations/http-webhook.automation.ts theme={null}
import { automation, log, onHttpRequest } from "automate.ax"

export default automation("Receive a webhook", () => {
  const request = onHttpRequest({ scope: "automation" })
  log({ value: request.body })
})
```

## Options

| Option            | Type                        | Required | Default | Description                                                                         |
| ----------------- | --------------------------- | -------- | ------- | ----------------------------------------------------------------------------------- |
| `scope`           | `"project" \| "automation"` | Yes      | —       | Scope at which HTTP requests are received.                                          |
| `waitForResponse` | `boolean`                   | No       | `false` | Wait for `respondToHttpRequest` instead of immediately acknowledging accepted work. |

Trigger configuration is static and cannot use signals.

## Trigger data

Returns `Signal<HttpRequestEvent>`:

| Property  | Type                                              | Description                 |
| --------- | ------------------------------------------------- | --------------------------- |
| `method`  | `"GET" \| "POST" \| "PUT" \| "PATCH" \| "DELETE"` | Request method.             |
| `url`     | `string`                                          | Complete request URL.       |
| `path`    | `string`                                          | Request path.               |
| `query`   | `Record<string, string>`                          | Parsed query parameters.    |
| `headers` | `Record<string, string>`                          | Normalized request headers. |
| `body`    | `Encodable`                                       | Parsed request body.        |

With `waitForResponse: true`, ingress waits up to ten seconds for
`respondToHttpRequest` in this automation context. Without a response it returns
`504`; execution can continue after the caller times out.
