Skip to content

Routines

This guide covers how to use Routine Hub to schedule and trigger recurring agent tasks.

Use standard cron expressions to schedule recurring tasks. Times are in UTC by default.

Terminal window
# Run every day at 8am UTC
curl -X POST https://endpoint.acenta.ai/core/api/v1/routines \
-H "Authorization: Bearer $ACENTA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "daily-digest",
"trigger_type": "cron",
"cron_expression": "0 8 * * *",
"timezone": "UTC",
"target_agent": "digest-agent",
"payload": {"report_type": "daily"}
}'

Common cron patterns:

ExpressionMeaning
0 8 * * *Daily at 8am
0 * * * *Every hour
*/15 * * * *Every 15 minutes
0 9 * * 1Every Monday at 9am
0 0 1 * *First of every month at midnight

Create a webhook routine to let external systems trigger agent work:

Terminal window
curl -X POST https://endpoint.acenta.ai/core/api/v1/routines \
-H "Authorization: Bearer $ACENTA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "process-new-document",
"trigger_type": "webhook",
"target_agent": "document-agent"
}'

The response contains a webhook_url. Any POST to that URL triggers the routine. The request body is forwarded as the payload to the target agent.

Disable a routine temporarily without deleting it:

Terminal window
curl -X PATCH https://endpoint.acenta.ai/core/api/v1/routines/{id} \
-H "Authorization: Bearer $ACENTA_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'

Re-enable when ready:

Terminal window
curl -X PATCH https://endpoint.acenta.ai/core/api/v1/routines/{id} \
-H "Authorization: Bearer $ACENTA_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'

Check execution history to verify routines are running correctly:

Terminal window
curl https://endpoint.acenta.ai/core/api/v1/routines/{id}/executions \
-H "Authorization: Bearer $ACENTA_KEY"

Failed executions include error details for debugging.

Trigger a routine manually for testing or one-off runs:

Terminal window
curl -X POST https://endpoint.acenta.ai/core/api/v1/routines/{id}/trigger \
-H "Authorization: Bearer $ACENTA_KEY"