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

# Get cloud task

> Get a Codex cloud task's output, diff, attempts, and pull requests.

`getCodexCloudTask` retrieves the detailed result of one remote task.

```ts automations/get-codex-task.automation.ts theme={null}
import { automation, onSchedule } from "automate.ax"
import { getCodexCloudTask } from "automate.ax/codex"

export default automation("Inspect Codex task", () => {
  onSchedule({ schedule: "*/5 * * * *" })
  const task = getCodexCloudTask({ taskId: "task_e_abc123" })

  task.status
  task.prompt
  task.attempts[0]!.messages
  task.attempts[0]!.diff
  task.pullRequests[0]!.url
})
```

The task includes its current state, environment, branch, latest-attempt diff summary, current turn ID, latest prompt, every available assistant attempt, and normalized GitHub pull requests. An attempt includes `messages`, the complete unified `diff`, its turn status, error, and attempt number. Optional second argument `{ account }` defaults to the project binding. Output remains empty while the remote turn is pending.

<Warning>
  Codex Cloud does not currently provide an official public REST API. This
  action calls undocumented ChatGPT backend endpoints that may change without
  notice.
</Warning>
