Overview
What scheduled jobs are and how to run agent prompts on a cron schedule or once at a set time. Create, list, update, and delete jobs through the Nairi REST API.
A scheduled job is a prompt that runs on a recurring cron schedule, or once at a set time, and posts its result to a Slack or Discord channel. Each job pairs a timing (a cron schedule or a one-time run_at), a timezone, a prompt, and a target channel - Nairi handles dispatch, agent assignment, and posting the response.
How it works
- Discover the platform
channel_idof your target Slack/Discord channel via Channels. - Create the job with
POST /scheduled-jobs, passing either aschedule(5-field cron) or arun_at(RFC 3339 timestamp, runs once), plustimezone(IANA name),prompt,connected_channel_id, andjob_type(slackordiscord). - At each scheduled tick, Nairi starts a conversation, assigns it to the default agent for the channel, and posts the result back. Set
is_threaded: trueto post each run inside a Slack thread. - Toggle
is_enabledto pause or resume the job without deleting it. - Fire it off-schedule with
POST /scheduled-jobs/{id}/run, and read what each tick produced withGET /scheduled-jobs/{id}/runs. Each job also reportsnext_run_atand itslast_run.
See Schedule rules for the cron format and minimum-granularity constraints.
When to use it
- Ship recurring content into Slack or Discord. Daily PR digests, weekly summaries, customer-facing newsletters - straight to the channel on a cron.
- Automate the periodic checks your team runs by hand. Error-log scans, on-call rotations, status reports - once-an-hour or once-a-day.
- Schedule a one-off for later. A release announcement on launch morning, a reminder before a deadline - set
run_atand the job runs once, then pauses itself.
Tips
- Minimum granularity is 5 minutes. Anything more frequent (
* * * * *) is rejected. - A one-time job (
run_at) fires once and then hasis_enabled: false. To run it again, send a newrun_atwithis_enabled: truein one update. connected_channel_idis the platform channel ID (SlackCxxx…, Discord numeric snowflake), not the internalcc_…record ID.- On create,
last_executed_atis set to creation time even when the job is disabled - this prevents an immediate fire the moment you flipis_enabledtotrue.
List models
List the LLM models available to your Nairi organization across all connected providers - Claude, Codex, OpenCode - with their identifiers and labels.
List
List every scheduled job in your Nairi organization with its cron schedule or one-time run_at, target agent, target channel, and current enabled state. Paginated response.