Documentation Index
Fetch the complete documentation index at: https://docs.emergence.ai/llms.txt
Use this file to discover all available pages before exploring further.
Schedules
The scheduling system enables time-based automation on CRAFT. Schedules are managed by the Utils service (port 8003) and support both recurring cron-based schedules and one-off timed executions. When a schedule triggers, it publishes a notification to a configured topic, which downstream systems (such as workflow orchestrators) can consume.Schedules use pg_cron for reliable execution. Cron jobs run inside PostgreSQL, ensuring schedule triggers survive application restarts and are executed exactly by the database scheduler.
Schedule Types
- Cron Schedule
- One-Off Schedule
Recurring schedules defined using standard cron expressions with timezone support.The cron expression above triggers at 9:00 AM Eastern Time, Monday through Friday. Internally, the expression is converted to UTC for storage and execution, then converted back to the original timezone for display.Cron expression format:
Notification Configuration
When a schedule triggers, it publishes a notification. Currently, theNOTIFICATION config type is supported:
| Field | Description |
|---|---|
topic | Topic string for the notification (consumed by workflow orchestrators) |
extra_data | Optional JSON payload included in the notification |
Schedule Lifecycle
Create Schedule
Create a schedule with a name, schedule configuration (cron or one-off), a reference ID linking to the target resource, and a notification config.Schedules can be created in an enabled or disabled state.
Enable/Disable
Enabling a schedule registers it with pg_cron. Disabling unschedules it. Both operations are idempotent.
Execution
When pg_cron fires, a schedule run record is created with a snapshot of the schedule configuration at execution time. The notification is published to the configured topic.
API Reference
All endpoints are scoped to the authenticated user’s organization. TheX-Project-ID header optionally filters schedules by project.
POST /utils/schedules
POST /utils/schedules
Creates a new schedule.Access:
can_manage_projects on the organization.Request Body
Response (201 Created)
GET /utils/schedules
GET /utils/schedules
Lists all schedules in the organization. Optionally filter by project via the
X-Project-ID header.Schedule values are returned in their original timezone for user-friendly display.GET /utils/schedules/{schedule_id}
GET /utils/schedules/{schedule_id}
Retrieves a single schedule by ID. Must belong to the authenticated user’s organization.
PUT /utils/schedules/{schedule_id}
PUT /utils/schedules/{schedule_id}
Full update of a schedule. All fields are required (this is not a partial update).
PATCH /utils/schedules/{schedule_id}/enable
PATCH /utils/schedules/{schedule_id}/enable
Enables a schedule and registers it with pg_cron. Idempotent if already enabled.
PATCH /utils/schedules/{schedule_id}/disable
PATCH /utils/schedules/{schedule_id}/disable
Disables a schedule and unschedules it from pg_cron. Idempotent if already disabled.
DELETE /utils/schedules/{schedule_id}
DELETE /utils/schedules/{schedule_id}
Permanently deletes a schedule. This action cannot be undone.
Schedule Runs
GET /utils/schedules/runs
GET /utils/schedules/runs
Lists schedule runs with pagination.Query Parameters:
page,limit— Pagination (default: page 1, 20 per page)order— Sort bycreated_at:desc(most recent first) orascschedule_id— Filter runs for a specific schedule
Response
GET /utils/schedules/runs/{run_id}
GET /utils/schedules/runs/{run_id}
Retrieves a single run with its full schedule snapshot — the exact schedule configuration at the time of execution.
DELETE /utils/schedules/runs/{run_id}
DELETE /utils/schedules/runs/{run_id}
Deletes a single schedule run record.
Timezone Handling
Timezone support is a first-class feature of the scheduling system:Storage
Storage
All cron expressions and one-off datetimes are converted to UTC before storage. The original timezone name is preserved alongside the expression.
Display
Display
API responses dynamically convert UTC values back to the original timezone. A cron expression stored as
0 11 * * * (UTC) for a schedule created with timezone America/New_York is returned as 0 6 * * * (EST) or 0 7 * * * (EDT) depending on the current DST status.Validation
Validation
Timezone values are validated against the IANA timezone database (e.g.,
America/New_York, Europe/London, Asia/Tokyo). Invalid timezone names are rejected with a descriptive error.Next Steps
Webhooks
Trigger actions via event-driven webhooks.
Data Connections
Connect schedules to data source workflows.
Agent Registry
Schedule automated agent tasks.
Projects
Understand how schedules are scoped to projects.

