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

> Start an automation from another automation.

`onInvocation<T>()` starts an automation with an encodable payload supplied by another automation. Name the entrypoint when the automation accepts different kinds of invocation. `T` is compile-time only; the platform does not apply a runtime payload schema.

```ts automations/process-order.automation.ts theme={null}
import { automation, onInvocation } from "automate.ax"

interface OrderInvocation {
  orderId: string
}

export default automation("Process order", () => {
  const invocation = onInvocation<OrderInvocation>("process-order")

  // Use invocation.orderId in actions.
})
```

Invoke it from another automation with the durable `invokeAutomation` action:

```ts theme={null}
invokeAutomation<OrderInvocation>({
  automation: "Process order",
  entrypoint: "process-order",
  payload: { orderId: "order_123" },
  runIn: "3d",
})
```

Pass the target automation itself or its unique name in the current project. Omit the entrypoint from both calls to use `"default"`. An automation can define each entrypoint once. Names beginning with `__$` are reserved for Automate.ax.

`runAt` accepts a `Date`, absolute date string, or epoch-millisecond number. `runIn` accepts a compact duration such as `"24h"` or a millisecond number. They are mutually exclusive; omitting both invokes immediately.
