codex.startCloudTask submits a coding task directly to a configured Codex cloud environment. Automate.ax dispatches the request; the Codex agent runs in OpenAI’s cloud container.
automations/start-codex-task.automation.ts
environmentId is the stable environment identifier returned by codex.listCloudEnvironments. branch is required so the headless dispatcher never guesses a ref from its own checkout. Set attempts from 1 to 4; it defaults to 1. mode defaults to code; use ask when you only want an answer and no repository changes. Optional second argument { account } defaults to the project binding.
The result contains the new task ID and its ChatGPT URL. Submission is asynchronous. Use codex.runCloudTask when downstream work should wait for completion, codex.waitForCloudTask when you already have a task ID or signal, or codex.getCloudTask for one immediate status check.