Create an agent automation
create_agent_automation
Creates an agent automation on a site, once the person has agreed to its preview.
An agent automation is a standing instruction the agent carries out on a schedule. Each run reads the one site with read-only tools and emails its report to the person who created it. It cannot change the site, publish it or email anyone else. See Agents.
Call it first with confirm set to false. That returns a preview of the instruction, the schedule, the next runs and what the agent can read, and it creates nothing. Show the preview to the person, and call again with confirm set to true only after they agree.
A site holds at most 3 agent automations, and runs cannot be closer together than 5 minutes. It is refused while the site is locked, and while Modulify has switched off an agent automation on the site.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
name |
string | Yes | What to call the automation, up to 64 characters. |
instruction |
string | Yes | What the agent should do on each run, written as a plain request, up to 2,000 characters. It is sent with the site's name, the time of the run and the schedule's timezone. |
schedule |
object | Yes | When it runs. The same shape as the schedule of create_site_cron: a Kind of hourly, daily, weekly, monthly or cron, the fields that kind uses, and an optional Timezone. Without one it runs in UTC. |
confirm |
boolean | No | false by default, which returns the preview. true creates the automation. |