Workflows
albert.collections.workflows.WorkflowCollection
Bases: BaseCollection
WorkflowCollection is a collection class for managing Workflow entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
create |
Create or return matching workflows for the provided list of workflows. |
get_by_id |
Retrieve a Workflow by its ID. |
get_by_ids |
Returns a list of Workflow entities by their IDs. |
get_all |
Get all workflows. Unlikely to be used in production. |
Attributes:
Name | Type | Description |
---|---|---|
base_path |
|
Source code in src/albert/collections/workflows.py
create
Create or return matching workflows for the provided list of workflows. This endpoint automatically tries to find an existing workflow with the same parameter setpoints, and will either return the existing workflow or create a new one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workflows
|
list[Workflow]
|
A list of Workflow entities to find or create. |
required |
Returns:
Type | Description |
---|---|
list[Workflow]
|
A list of created or found Workflow entities. |
Source code in src/albert/collections/workflows.py
get_by_id
get_by_id(*, id: WorkflowId) -> Workflow
Retrieve a Workflow by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the Workflow to retrieve. |
required |
Returns:
Type | Description |
---|---|
Workflow
|
The Workflow object. |
Source code in src/albert/collections/workflows.py
get_by_ids
get_by_ids(*, ids: list[WorkflowId]) -> list[Workflow]
Returns a list of Workflow entities by their IDs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ids
|
list[str]
|
The list of Workflow IDs to retrieve. |
required |
Returns:
Type | Description |
---|---|
list[Workflow]
|
The list of Workflow entities matching the provided IDs. |
Source code in src/albert/collections/workflows.py
get_all
Get all workflows. Unlikely to be used in production.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
max_items
|
int
|
Maximum number of items to return in total. If None, fetches all available items. |
None
|
Yields:
Type | Description |
---|---|
Iterator[Workflow]
|
An iterator of Workflow entities. |