automations
Classes
AutomationsClient
AutomationsClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Automations endpoints.
- Code Reference client Classes OpenWebUI Attributes automations
Source code in src/owui_client/client_base.py
Functions
get_automation_items
get_automation_items(
query: Optional[str] = None,
status: Optional[str] = None,
page: Optional[int] = 1,
) -> AutomationListResponse
Get a paginated, searchable list of automations.
Returns automations owned by the authenticated user. Each item includes the latest run record. Supports filtering by name/prompt text and active/paused status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
Optional[str]
|
Optional search string to filter by name or prompt content. |
None
|
status
|
Optional[str]
|
Optional status filter: 'active' or 'paused'. |
None
|
page
|
Optional[int]
|
Page number (1-indexed). Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
AutomationListResponse
|
|
Source code in src/owui_client/routers/automations.py
create_new_automation
create_new_automation(
form_data: AutomationForm,
) -> Optional[AutomationResponse]
Create a new automation.
Validates the RRULE schedule and enforces user automation limits. The automation is scheduled for its next run immediately upon creation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
AutomationForm
|
The automation definition including name, data (prompt, model_id, rrule), optional meta, and is_active flag. |
required |
Returns:
| Type | Description |
|---|---|
Optional[AutomationResponse]
|
Optional[AutomationResponse]: The created automation with enriched run data. |
Source code in src/owui_client/routers/automations.py
get_automation_by_id
get_automation_by_id(
id: str,
) -> Optional[AutomationResponse]
Get a single automation by ID with enriched run data.
Returns the automation details including the latest run record and computed next run timestamps.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The automation ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[AutomationResponse]
|
Optional[AutomationResponse]: The automation with run history. |
Source code in src/owui_client/routers/automations.py
update_automation_by_id
update_automation_by_id(
id: str, form_data: AutomationForm
) -> Optional[AutomationResponse]
Update an automation by ID.
Re-validates the RRULE and re-enforces rate limits. The schedule is recalculated based on the new RRULE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The automation ID. |
required |
form_data
|
AutomationForm
|
The updated automation definition. |
required |
Returns:
| Type | Description |
|---|---|
Optional[AutomationResponse]
|
Optional[AutomationResponse]: The updated automation with enriched run data. |
Source code in src/owui_client/routers/automations.py
toggle_automation_by_id
toggle_automation_by_id(
id: str,
) -> Optional[AutomationResponse]
Toggle an automation's active state.
Flips the is_active flag. Paused automations are excluded from
scheduling. When reactivated, the next run is recalculated from the
RRULE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The automation ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[AutomationResponse]
|
Optional[AutomationResponse]: The toggled automation with enriched run data. |
Source code in src/owui_client/routers/automations.py
run_automation_by_id
run_automation_by_id(
id: str,
) -> Optional[AutomationResponse]
Trigger an immediate execution of an automation.
The automation runs asynchronously in the background. This endpoint returns the current automation state immediately, not the run result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The automation ID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[AutomationResponse]
|
Optional[AutomationResponse]: The automation state at trigger time. |
Source code in src/owui_client/routers/automations.py
delete_automation_by_id
Delete an automation and all its run history by ID.
Permanently removes the automation and all associated run records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The automation ID. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if deletion succeeded. |
Source code in src/owui_client/routers/automations.py
get_automation_runs
get_automation_runs(
id: str, skip: int = 0, limit: int = 50
) -> List[AutomationRunModel]
Get run history for an automation.
Returns execution records ordered by creation time descending (most recent first).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The automation ID. |
required |
skip
|
int
|
Number of records to skip. Defaults to 0. |
0
|
limit
|
int
|
Maximum number of records to return. Defaults to 50. |
50
|
Returns:
| Type | Description |
|---|---|
List[AutomationRunModel]
|
List[AutomationRunModel]: List of run records. |