Schedule tasks
Schedule an agent to fire automatically on a cron expression: every Monday at 09:00, every hour, or any standard 5-field schedule.
In the UI
In the UI
-
Open Triggers under your project in the sidebar.
-
Click New trigger and choose Cron.
-
Pick the agent to run, type the prompt it should receive each fire, and set the schedule (5-field cron).
-
Optionally set a timezone (defaults to UTC).
-
Click Create. The trigger is enabled immediately.
Programmatically
Create a cron trigger
ren cron-triggers create prj_abc123 \ --project-agent-id pagt_abc123 \ --input-message "Summarize this week's activity" \ --schedule "0 9 * * MON" \ --timezone "America/New_York"List triggers in a project
ren cron-triggers list prj_abc123Update a trigger (change schedule, prompt, or toggle enabled)
ren cron-triggers update prj_abc123 ctrg_abc123 \ --schedule "0 */2 * * *" \ --is-enabled falseArchive a trigger (stops the schedule permanently)
ren cron-triggers archive prj_abc123 ctrg_abc123Create a cron trigger
curl -X POST https://api.useren.ai/api/projects/prj_abc123/cron-triggers \ -H "Authorization: Bearer $REN_PAT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "projectAgentId": "pagt_abc123", "inputMessage": "Summarize this week'\''s activity", "schedule": "0 9 * * MON", "timezone": "America/New_York" }'List triggers
curl "https://api.useren.ai/api/projects/prj_abc123/cron-triggers" \ -H "Authorization: Bearer $REN_PAT_TOKEN"Update a trigger
curl -X PATCH "https://api.useren.ai/api/projects/prj_abc123/cron-triggers/ctrg_abc123" \ -H "Authorization: Bearer $REN_PAT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schedule": "0 */2 * * *", "isEnabled": false }'Archive a trigger
curl -X POST "https://api.useren.ai/api/projects/prj_abc123/cron-triggers/ctrg_abc123/archive" \ -H "Authorization: Bearer $REN_PAT_TOKEN"import { createRenClient, pat } from "@renai-labs/sdk"
const client = createRenClient({baseUrl: "https://api.useren.ai",auth: pat(process.env.REN_PAT_TOKEN!),})
// Create a cron triggerconst { data: trigger, error } = await client.cronTrigger.create({path: { projectId: "prj_abc123" },body: {projectAgentId: "pagt_abc123",inputMessage: "Summarize this week's activity",schedule: "0 9 \* \* MON",timezone: "America/New_York",},})if (error) throw errorconsole.log(trigger.id) // "ctrg_abc123"
// List triggersawait client.cronTrigger.list({ path: { projectId: "prj_abc123" } })
// Update a triggerawait client.cronTrigger.update({path: { projectId: "prj_abc123", triggerId: trigger.id },body: { schedule: "0 \*/2 \* \* \*", isEnabled: false },})
// Archive a triggerawait client.cronTrigger.archive({path: { projectId: "prj_abc123", triggerId: trigger.id },})The schedule uses standard 5-field cron syntax: minute hour day-of-month month day-of-week. Archiving a trigger stops it permanently.