enterprise_ai.scheduler
Source: sdks/python/src/enterprise_ai/scheduler/__init__.py. Back to the Python SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class SchedulesClient
/v1/schedules.
Resource
SchedulesClient.create
create(agent_id: str, cron: str, input: object = None, timezone: str = 'UTC', **extra: Any) -> Any
Create a schedule. Schedules runs of an agent from a cron expression evaluated in a time zone; the first next_run_at is computed (422 invalid_cron). When Temporal is configured the schedule is created there (503 scheduler_unavailable on failure). Needs tenant_admin, developer or application_owner. 404 agent_not_found. Audited as schedule.create.
Route: /v1/schedules (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
agent_id | str | yes | Agent to run (UUID or name). | |
cron | str | yes | Cron expression (1 to 200 characters), evaluated in timezone. | |
input | object | None | no | Input given to every run started by the schedule. |
timezone | str | 'UTC' | no | IANA time zone, for example Europe/Paris. Default UTC. |
**extra | Any | no | Extra fields merged into the request body. |
Returns: Any. Decoded JSON answer of the operation "Create a schedule".
Raises: ValueError, the typed errors of the transport (Errors).
SchedulesClient.delete
delete(schedule_id: str) -> Any
Delete a schedule. Deletes the schedule; no new run is started by it. Needs tenant_admin, developer or application_owner. When the schedule is held by Temporal, it is deleted there too (503 scheduler_unavailable if Temporal cannot be reached). 404 schedule_not_found. Audited as schedule.delete.
Route: /v1/schedules/{schedule_id} (DELETE).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
schedule_id | str | yes | Identifier (UUID) of the schedule. |
Returns: Any. Decoded JSON answer of the operation "Delete a schedule".
Raises: the typed errors of the transport (Errors).
SchedulesClient.list
list(**page: Any) -> Any
List the schedules. Cron schedules of the tenant, oldest first, optionally for one agent. One page only.
Route: /v1/schedules (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
**page | Any | no | Pagination options passed to the listing: limit (maximum number of items per page) and cursor (the next_cursor of the previous page). Iterating the returned page follows every cursor. |
Returns: Any. Decoded JSON answer of the operation "List the schedules".
Raises: the typed errors of the transport (Errors).
SchedulesClient.update
update(schedule_id: str, **changes: Any) -> Any
Update a schedule. Changes the cron expression, time zone, input or enabled flag. The next run time is computed again (422 invalid_cron for a bad expression or time zone) and the Temporal schedule is updated when Temporal holds it (503 scheduler_unavailable). Needs tenant_admin, developer or application_owner. Audited as schedule.update.
Route: /v1/schedules/{schedule_id} (PATCH).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
schedule_id | str | yes | Identifier (UUID) of the schedule. | |
**changes | Any | no | Fields of the schedule to change, sent as the PATCH body. |
Returns: Any. Decoded JSON answer of the operation "Update a schedule".
Raises: the typed errors of the transport (Errors).
Class TriggersClient
/v1/triggers and /v1/events/publish (NATS subjects).
Resource
TriggersClient.create
create(agent_id: str, subject: str, **extra: Any) -> Any
Create a trigger. Starts a run of the agent for every published event whose subject matches (NATS wildcards * and > allowed) and whose payload passes the filter. Needs tenant_admin, developer or application_owner. 422 invalid_subject or invalid_filter; 404 agent_not_found. Audited as trigger.create.
Route: /v1/triggers (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
agent_id | str | yes | Agent to run (UUID or name). | |
subject | str | yes | NATS subject to match (1 to 255 characters, wildcards * and > allowed). | |
**extra | Any | no | Extra fields merged into the request body. |
Returns: Any. Decoded JSON answer of the operation "Create a trigger".
Raises: the typed errors of the transport (Errors).
TriggersClient.delete
delete(trigger_id: str) -> Any
Delete a trigger. Deletes the event trigger; matching events no longer start runs. Needs tenant_admin, developer or application_owner. 404 trigger_not_found. Audited as trigger.delete.
Route: /v1/triggers/{trigger_id} (DELETE).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
trigger_id | str | yes | Identifier (UUID) of the trigger. |
Returns: Any. Decoded JSON answer of the operation "Delete a trigger".
Raises: the typed errors of the transport (Errors).
TriggersClient.list
list(**page: Any) -> Any
List the triggers. Event triggers of the tenant, oldest first: agent, subject and filter. One page only.
Route: /v1/triggers (GET).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
**page | Any | no | Pagination options passed to the listing: limit (maximum number of items per page) and cursor (the next_cursor of the previous page). Iterating the returned page follows every cursor. |
Returns: Any. Decoded JSON answer of the operation "List the triggers".
Raises: the typed errors of the transport (Errors).
TriggersClient.publish
publish(subject: str, payload: dict[str, Any], headers: dict[str, str] | None = None) -> Any
Publish an event. Publishes an event (202): on NATS JetStream when configured, else in the platform outbox. The current W3C trace context is added to the headers. Every trigger whose subject and filter match starts a run of its agent (idempotent per event and trigger); the answer lists them in triggered, with skipped and an error code when a run could not start. Needs tenant_admin, developer or agent. 422 invalid_subject. Audited as event.publish.
Route: /v1/events/publish (POST).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
subject | str | yes | Subject of the event (1 to 255 characters, valid NATS subject without wildcards), for example orders.created. | |
payload | dict[str, Any] | yes | Content of the event, any JSON value. Trigger filters read it. | |
headers | dict[str, str] | None | None | no | Headers of the event, string values. The trace context is added. |
Returns: Any. Decoded JSON answer of the operation "Publish an event".
Raises: the typed errors of the transport (Errors).
Functions
validate_cron
validate_cron(expression: str) -> bool
Check a 5 field cron expression (numbers, *, ranges, lists and steps).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
expression | str | yes | Cron expression: minute, hour, day of month, month, day of week (0 to 7). |
Returns: bool. True when every field is valid and in range, else False.