Schedules

Run agents on a recurring basis using cron expressions. Automate daily summaries, periodic data checks, automated reports, and scheduled notifications.

Create a Schedule

Create a scheduled task by specifying an agent, a cron expression, and the message to send on each run.

REST API

bash
curl -X POST https://api.agentbackend.ai/v1/schedules \
  -H "Authorization: Bearer ak_..." \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agent_...",
    "name": "Daily news summary",
    "cron_expression": "0 9 * * *",
    "message": "Summarize today'\''s top tech news"
  }'

Python SDK

python
ab.schedules.create(
    agent_id="agent_id",
    name="Daily summary",
    cron_expression="0 9 * * *",
    message="Summarize today's news",
)

JavaScript SDK

javascript
await ab.schedules.create({
  agentId: 'agent_id',
  name: 'Daily summary',
  cronExpression: '0 9 * * *',
  message: "Summarize today's news",
});

Cron Expressions

Cron expressions define when a schedule fires. The format is minute hour day-of-month month day-of-week. All times are in UTC.

ExpressionDescription
0 9 * * *Every day at 09:00 UTC
*/30 * * * *Every 30 minutes
0 0 * * 1Every Monday at midnight
0 */6 * * *Every 6 hours
0 9 1 * *First day of month at 09:00

Delivery

Schedule output can be delivered externally via two methods:

  • Webhook — POST the agent's response to a URL of your choice.
  • Channel — Send the output through a linked Telegram or Slack bot.
Note: Delivery is a Pro feature. Free tier runs the schedule but does not deliver output externally.

Managing Schedules

Use these endpoints to list, update, pause, resume, and delete scheduled tasks.

MethodEndpointDescription
GET/v1/schedulesList tasks
GET/v1/schedules/:idGet task details
PUT/v1/schedules/:idUpdate task
DELETE/v1/schedules/:idDelete task
PATCH/v1/schedules/:id/pausePause
PATCH/v1/schedules/:id/resumeResume
GET/v1/schedules/:id/runsRun history

Tier Limits

TierTasksIntervalDelivery
Free3 tasksMinimum 1 hour intervalNo delivery
Pro25 tasksMinimum 1 minute intervalWebhook + channel delivery
Enterprise1000 tasksCustom limitsFull delivery options