Skip to main content

Scheduled Syncs

RAG-DocBot includes a built-in cron-based scheduler that can automatically trigger connector and integration syncs on a defined schedule. Scheduled syncs require a Pro plan or higher. Manual sync via the API or UI is available on all plans.


How It Works

The scheduler evaluates configured schedules on every cron tick and queues a background sync job for any connector or integration whose next-run time has passed. The scheduler logs the effective license tier on every fire.


Creating a Schedule

Use the POST /api/schedules endpoint to create a schedule:

curl -s -X POST http://localhost:8000/api/schedules \
-H "Authorization: Bearer <ADMIN_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"source_type": "connector",
"source_id": "<CONNECTOR_ID>",
"cron": "0 2 * * *",
"enabled": true
}'

This example schedules the connector to sync daily at 02:00 UTC.

FieldDescription
source_typeconnector or integration
source_idID of the connector or integration to sync
cronStandard 5-field cron expression (minute hour day-of-month month day-of-week)
enabledSet false to pause the schedule without deleting it

Listing Schedules

curl -s http://localhost:8000/api/schedules \
-H "Authorization: Bearer <ADMIN_ACCESS_TOKEN>"

Each schedule in the response includes last_run and next_run timestamps so you can verify timing at a glance.


Updating a Schedule

curl -s -X PUT http://localhost:8000/api/schedules/<SCHEDULE_ID> \
-H "Authorization: Bearer <ADMIN_ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"cron": "0 4 * * 1", "enabled": true}'

Pausing or Deleting a Schedule

To pause: set enabled to false via PUT /api/schedules/{id}.

To remove permanently:

curl -s -X DELETE http://localhost:8000/api/schedules/<SCHEDULE_ID> \
-H "Authorization: Bearer <ADMIN_ACCESS_TOKEN>"

Cron Expression Examples

ExpressionMeaning
0 2 * * *Daily at 02:00 UTC
0 */6 * * *Every 6 hours
0 8 * * 1Every Monday at 08:00 UTC
*/30 * * * *Every 30 minutes

info

Manual sync (via POST /api/connectors/{id}/scan or POST /api/integrations/{id}/sync) is always available regardless of plan tier. Scheduled syncs are a Pro+ feature.