Use a workflow
The Workflow object can execute workflow pipelines and manage their related tasks and triggers.
Persist and refresh
export
Run
Use run() to execute a workflow. Its keyword arguments are passed to the run builder, including inputs, parameters, and runtime-specific options.
run
Run workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
Action to execute. |
required |
wait
|
bool
|
Flag to wait for execution to finish. |
False
|
log_info
|
bool
|
Flag to log information while waiting. |
True
|
extensions
|
list[dict] | None
|
List of extensions to apply. |
None
|
**kwargs
|
dict
|
Keyword arguments passed to Run builder. |
{}
|
Returns:
| Type | Description |
|---|---|
Run
|
Run instance. |
Manage tasks
The Workflow object exposes methods to create, retrieve, list, update, and delete its tasks.
new_task
Create and persist a task for an executable action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
Action implemented by the task. |
required |
**kwargs
|
dict
|
Task construction parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
Task
|
Created task. |
Raises:
| Type | Description |
|---|---|
EntityError
|
If a task already exists for the action or the action is not supported. |
get_task
list_task
List tasks associated with the executable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
str
|
Free-text query. |
None
|
name
|
str
|
Task name filter. |
None
|
kind
|
str
|
Task kind filter. |
None
|
user
|
str
|
Task owner filter. |
None
|
state
|
str
|
Task state filter. |
None
|
created
|
str
|
Creation date filter. |
None
|
updated
|
str
|
Update date filter. |
None
|
Returns:
| Type | Description |
|---|---|
list[Task]
|
Tasks matching the filters. |
import_tasks
update_task
Update the task associated with an executable action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
Action implemented by the task. |
required |
**kwargs
|
dict
|
Updated task construction parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
Task
|
Updated task. |
Raises:
| Type | Description |
|---|---|
EntityError
|
If no task exists for the action or the action is not supported. |
set_task
Create or replace the task associated with an executable action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
Action implemented by the task. |
required |
**kwargs
|
dict
|
Task construction parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
Task
|
Created or replaced task. |
Raises:
| Type | Description |
|---|---|
EntityError
|
If the action is not supported. |
delete_task
Manage triggers
The Workflow object exposes methods to create, retrieve, and list its triggers.
trigger
Create and persist a trigger for an executable action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
str
|
Executable action invoked by the trigger. |
required |
kind
|
str
|
Trigger kind. |
required |
name
|
str
|
Trigger name. |
required |
template
|
dict
|
Run template associated with the trigger. |
None
|
**kwargs
|
dict
|
Trigger construction parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
Trigger
|
Created trigger. |
Raises:
| Type | Description |
|---|---|
EntityError
|
If the template is invalid or the action is not supported. |
get_trigger
list_triggers
List triggers associated with the executable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
str
|
Free-text query. |
None
|
name
|
str
|
Trigger name filter. |
None
|
kind
|
str
|
Trigger kind filter. |
None
|
user
|
str
|
Trigger owner filter. |
None
|
created
|
str
|
Creation date filter. |
None
|
updated
|
str
|
Update date filter. |
None
|
versions
|
str
|
Version selection filter. |
None
|
task
|
str
|
Task reference filter. |
None
|
Returns:
| Type | Description |
|---|---|
list[Trigger]
|
Triggers matching the filters. |
Kind-specific methods
Methods specific to a workflow kind are documented in the reference documentation for the corresponding runtime.