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

# Wait for Actor build

> Waits for an Apify Actor build and returns its latest state.

`apify.waitForActorBuild` waits for an Apify Actor build and returns its latest state.

## Example

```ts automations/apify-wait-for-actor-build.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { apify } from "automate.ax/apify"

export default automation("Wait for Actor build", () => {
  onHttpRequest({ scope: "automation" })

  apify.waitForActorBuild({ buildId: "build-id", waitSecs: 120 })
})
```

## Inputs

`buildId` is required. `waitSecs` is an optional positive client-side limit; omit it to wait indefinitely.

## Output

Returns the latest build state. A wait limit can return a build that is still running.

Use `status` to distinguish completion from a caller-defined wait limit.
