Scheduled Tasks
Run agents on a recurring schedule using cron expressions.
Required scope: agents-all
Create a Scheduled Task
curl -X POST https://api.bluenexus.ai/api/v1/agents/AGENT_ID/scheduled-tasks \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily Standup Summary",
"prompt": "Summarize yesterday'\''s Slack activity in #engineering and #product, then post a summary to #standup",
"cronExpression": "0 9 * * 1-5",
"timezone": "America/New_York",
"enabled": true
}'
Response:
{
"id": "task-abc123",
"agentId": "agent-xyz",
"name": "Daily Standup Summary",
"prompt": "Summarize yesterday's Slack activity...",
"cronExpression": "0 9 * * 1-5",
"timezone": "America/New_York",
"enabled": true,
"createdAt": "2026-04-13T10:00:00Z"
}
Cron Expression Format
Standard 5-field cron:
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sun=0)
│ │ │ │ │
* * * * *
Examples:
0 9 * * 1-5— Weekdays at 9:00 AM0 */2 * * *— Every 2 hours30 8 1 * *— 8:30 AM on the 1st of each month0 17 * * 5— Fridays at 5:00 PM
Managing Tasks
# List tasks
curl https://api.bluenexus.ai/api/v1/agents/AGENT_ID/scheduled-tasks \
-H "Authorization: Bearer ACCESS_TOKEN"
# Get a task
curl https://api.bluenexus.ai/api/v1/agents/AGENT_ID/scheduled-tasks/TASK_ID \
-H "Authorization: Bearer ACCESS_TOKEN"
# Update a task
curl -X PUT https://api.bluenexus.ai/api/v1/agents/AGENT_ID/scheduled-tasks/TASK_ID \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
# Delete a task
curl -X DELETE https://api.bluenexus.ai/api/v1/agents/AGENT_ID/scheduled-tasks/TASK_ID \
-H "Authorization: Bearer ACCESS_TOKEN"
Execution
- Tasks execute automatically at the scheduled time
- Each execution is logged in the agent's activity log
- Failed executions are retried up to 3 times
- Execution logs are retained for 7 days
Next Steps
- Creating Agents — Set up the agent first
- Guardrails — Safety constraints for agent execution