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 objects by their IDs. |
list |
List all workflows. Unlikly 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 objects to find or create. |
required |
Returns:
Type | Description |
---|---|
list[Workflow]
|
A list of created or found Workflow objects. |
Source code in src/albert/collections/workflows.py
get_by_id
get_by_ids
Returns a list of Workflow objects 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 objects matching the provided IDs. |
Source code in src/albert/collections/workflows.py
list
List all workflows. Unlikly to be used in production.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int
|
The number of workflows to return, by default 50. |
50
|
Yields:
Type | Description |
---|---|
Iterator[Workflow]
|
An iterator of Workflow objects. |