Tasks¶
TasksClient¶
Accessed via client.tasks.
pyawe.client.TasksClient
¶
Methods for the /tasks resource.
list
¶
List tasks, optionally filtered by workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_id
|
UUID | str | None
|
When supplied, returns only tasks within this workflow. |
None
|
Returns:
| Type | Description |
|---|---|
list[Task]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
list_mine
¶
Return tasks assigned to the authenticated user or their team roles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
role_ids
|
list[UUID | str] | None
|
Team role UUIDs to include alongside direct assignments. |
None
|
Returns:
| Type | Description |
|---|---|
list[TaskWithContext]
|
List of :class: |
list[TaskWithContext]
|
with workflow and job names. |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
create
¶
create(name: str, workflow_id: UUID | str, *, is_template: bool | None = None, description: str | None = None, status: Status | str | None = None, schedule_status: ScheduleStatus | str | None = None, rework_task_id: UUID | str | None = None, is_start: bool | None = None, is_end: bool | None = None, task_type: TaskType | str | None = None, effort: int | None = None, priority: str | None = None, due_time: datetime | None = None) -> Task
Create a task within a workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Task name. |
required |
workflow_id
|
UUID | str
|
UUID of the containing workflow. |
required |
is_template
|
bool | None
|
Mark as a template task. |
None
|
description
|
str | None
|
Optional description. |
None
|
status
|
Status | str | None
|
Initial status (default |
None
|
schedule_status
|
ScheduleStatus | str | None
|
Initial schedule status (default |
None
|
rework_task_id
|
UUID | str | None
|
UUID of the task this one reworks, if any. |
None
|
is_start
|
bool | None
|
Designate as the workflow start task. |
None
|
is_end
|
bool | None
|
Designate as the workflow end task. |
None
|
task_type
|
TaskType | str | None
|
|
None
|
effort
|
int | None
|
Unitless effort estimate (e.g. story points). |
None
|
priority
|
str | None
|
|
None
|
due_time
|
datetime | None
|
Optional point in time the task is due. |
None
|
Returns:
| Type | Description |
|---|---|
Task
|
The newly created :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
AweValidationError
|
On a 400 response. |
get
¶
Fetch a single task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
Task
|
class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
update
¶
update(task_id: UUID | str, *, name: str | None = None, is_template: bool | None = None, description: str | None = None, status: Status | str | None = None, schedule_status: ScheduleStatus | str | None = None, rework_task_id: UUID | str | None = None, is_start: bool | None = None, is_end: bool | None = None, task_type: TaskType | str | None = None, assigned_to: Any = _UNSET, decision_input_port: Any = _UNSET, is_locked: bool | None = None, canvas_x: float | None = None, canvas_y: float | None = None, effort: Any = _UNSET, priority: str | None = None, due_time: Any = _UNSET, branch_name: Any = _UNSET, port_namespace: Any = _UNSET) -> Task
Update a task; only supplied fields are changed.
assigned_to, decision_input_port, effort, due_time,
branch_name, and port_namespace are tri-state fields:
- Omitted (default): field is left unchanged.
None: clears the current value.- A value: sets the field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task to update. |
required |
name
|
str | None
|
New name. |
None
|
is_template
|
bool | None
|
Template flag. |
None
|
description
|
str | None
|
New description. |
None
|
status
|
Status | str | None
|
New status. Completed/cancelled tasks cannot be
transitioned. Setting to |
None
|
schedule_status
|
ScheduleStatus | str | None
|
New schedule status. |
None
|
rework_task_id
|
UUID | str | None
|
Rework back-link. |
None
|
is_start
|
bool | None
|
Start task flag. |
None
|
is_end
|
bool | None
|
End task flag. |
None
|
task_type
|
TaskType | str | None
|
Task type string. |
None
|
assigned_to
|
Any
|
User ID string, |
_UNSET
|
decision_input_port
|
Any
|
Input port name for auto-decide, |
_UNSET
|
is_locked
|
bool | None
|
Lock or unlock structural edits (requires owner/leader/admin). |
None
|
canvas_x
|
float | None
|
Canvas X position from the workflow editor. |
None
|
canvas_y
|
float | None
|
Canvas Y position from the workflow editor. |
None
|
effort
|
Any
|
Unitless effort estimate, |
_UNSET
|
priority
|
str | None
|
|
None
|
due_time
|
Any
|
Due time, |
_UNSET
|
branch_name
|
Any
|
Git branch name, |
_UNSET
|
port_namespace
|
Any
|
Checkpoint port namespace override
( |
_UNSET
|
Returns:
| Type | Description |
|---|---|
Task
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweValidationError
|
If the status transition is invalid. |
AweAuthError
|
If not authenticated. |
delete
¶
Delete a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task to delete. |
required |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
decide
¶
Resolve a decision task by choosing an outgoing branch.
Sets the task status to "Complete", records decision_outcome,
activates the chosen successor, and cancels tasks on rejected branches.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of a decision task. |
required |
branch_label
|
str
|
Label of the branch to follow. Must match an outgoing
link's |
required |
Returns:
| Type | Description |
|---|---|
Task
|
The decided :class: |
Raises:
| Type | Description |
|---|---|
AweValidationError
|
If the task is not a decision task, is already complete, or the branch label is not found. |
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
clear_rework
¶
Remove the rework back-link from a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
Task
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
request_rework
¶
Manually trigger a rework of task_id.
Spawns a fresh clone of the subgraph between the task's configured
rework_task_id and the task itself, rewires the clone chain in
place of the original, and marks the original task "Reworked".
The original target/intermediate tasks are never touched.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task that judged rework was needed (the
"source" task; must already have |
required |
Returns:
| Type | Description |
|---|---|
Task
|
The reworked (now |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweValidationError
|
If the task has no |
AweAuthError
|
If not authenticated. |
TaskLinksClient¶
Accessed via client.task_links.
pyawe.client.TaskLinksClient
¶
Methods for task link management (/task-links and /tasks/{id}/…).
create
¶
create(from_task_id: UUID | str, to_task_id: UUID | str, *, branch_label: str | None = None) -> TaskLink
Create a directed link between two tasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_task_id
|
UUID | str
|
UUID of the upstream task. |
required |
to_task_id
|
UUID | str
|
UUID of the downstream task. |
required |
branch_label
|
str | None
|
Required when the upstream task is a decision task. |
None
|
Returns:
| Type | Description |
|---|---|
TaskLink
|
The created :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
AweValidationError
|
On a 400 response. |
delete
¶
Delete the link between two tasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_task_id
|
UUID | str
|
UUID of the upstream task. |
required |
to_task_id
|
UUID | str
|
UUID of the downstream task. |
required |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the link does not exist. |
AweAuthError
|
If not authenticated. |
get_next
¶
Return the immediate successor tasks of task_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
list[Task]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
get_previous
¶
Return the immediate predecessor tasks of task_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
list[Task]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
get_outgoing
¶
Return all outgoing links from task_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskLink]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
update_bindings
¶
update_bindings(from_task_id: UUID | str, to_task_id: UUID | str, bindings: list[DataBinding]) -> TaskLink
Replace the data bindings on a task link edge.
Bindings are applied by the propagator when the upstream task completes, copying output values to the downstream task's inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_task_id
|
UUID | str
|
UUID of the upstream task. |
required |
to_task_id
|
UUID | str
|
UUID of the downstream task. |
required |
bindings
|
list[DataBinding]
|
New list of :class: |
required |
Returns:
| Type | Description |
|---|---|
TaskLink
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the link does not exist. |
AweAuthError
|
If not authenticated. |
TaskPortsClient¶
Accessed via client.task_ports.
pyawe.client.TaskPortsClient
¶
Methods for task port spec and value management (/tasks/{id}/ports, etc.).
get_workflow_ports
¶
Return all port specs for every task in a workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_id
|
UUID | str
|
UUID of the workflow. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPortSpec]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
list_specs
¶
Return all port specs (inputs and outputs) for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskPortSpec]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
create_spec
¶
create_spec(task_id: UUID | str, direction: str, name: str, value_type: str, *, required: bool | None = None, description: str | None = None, default_value: Any | None = None, sort_order: int | None = None) -> TaskPortSpec
Add a port spec to a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
direction
|
str
|
|
required |
name
|
str
|
Port name (unique within direction on the task). |
required |
value_type
|
str
|
|
required |
required
|
bool | None
|
Whether this input is required (default |
None
|
description
|
str | None
|
Human-readable description. |
None
|
default_value
|
Any | None
|
JSON default applied at instantiation for optional inputs. |
None
|
sort_order
|
int | None
|
Display order. |
None
|
Returns:
| Type | Description |
|---|---|
TaskPortSpec
|
The created :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
AweValidationError
|
On a 400 response. |
update_spec
¶
update_spec(task_id: UUID | str, port_id: UUID | str, *, name: str | None = None, value_type: str | None = None, required: bool | None = None, description: str | None = None, default_value: Any | None = None, sort_order: int | None = None) -> TaskPortSpec
Update a port spec; only supplied fields are changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
port_id
|
UUID | str
|
UUID of the port spec. |
required |
name
|
str | None
|
New port name. |
None
|
value_type
|
str | None
|
New value type. |
None
|
required
|
bool | None
|
Required flag. |
None
|
description
|
str | None
|
New description. |
None
|
default_value
|
Any | None
|
New default value. |
None
|
sort_order
|
int | None
|
New sort order. |
None
|
Returns:
| Type | Description |
|---|---|
TaskPortSpec
|
The updated :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the port spec does not exist. |
AweAuthError
|
If not authenticated. |
delete_spec
¶
Delete a port spec.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
port_id
|
UUID | str
|
UUID of the port spec. |
required |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the port spec does not exist. |
AweAuthError
|
If not authenticated. |
get_inputs
¶
Return input port specs and current values for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
TaskPortValues
|
class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
patch_inputs
¶
Partially update the input values of a task.
Only the keys present in values are written; others are left unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
values
|
dict[str, Any]
|
Mapping of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Updated |
TaskPortValues
|
class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
get_outputs
¶
Return output port specs and current values for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
TaskPortValues
|
class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
patch_outputs
¶
Partially update the output values of a task (runner use).
Only the keys present in values are written; others are left unchanged. Typically called by the automated runner after a task completes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
values
|
dict[str, Any]
|
Mapping of |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Updated |
Task
|
class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
TaskScriptsClient¶
Accessed via client.task_scripts.
pyawe.client.TaskScriptsClient
¶
Methods for automated task script management (/tasks/{id}/script).
get
¶
Fetch the script attached to a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
TaskScript
|
class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If no script is attached. |
AweAuthError
|
If not authenticated. |
upsert
¶
upsert(task_id: UUID | str, *, script_type: str | None = None, endpoint: str | None = None, script_body: str | None = None, timeout_secs: int | None = None, retry_limit: int | None = None, execution_profile_id: UUID | str | None = None, connection_id: UUID | str | None = None) -> TaskScript
Create or fully replace the script on a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
script_type
|
str | None
|
|
None
|
endpoint
|
str | None
|
Webhook URL; required when |
None
|
script_body
|
str | None
|
Script source; required for |
None
|
timeout_secs
|
int | None
|
Execution timeout in seconds. |
None
|
retry_limit
|
int | None
|
Maximum number of retry attempts. |
None
|
execution_profile_id
|
UUID | str | None
|
Execution profile for Kubernetes dispatch
( |
None
|
connection_id
|
UUID | str | None
|
Connection profile to resolve auth from at run
time. Required (must reference an |
None
|
Returns:
| Type | Description |
|---|---|
TaskScript
|
The upserted :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
delete
¶
Remove the script from a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If no script is attached. |
AweAuthError
|
If not authenticated. |
TaskRunsClient¶
Accessed via client.task_runs.
pyawe.client.TaskRunsClient
¶
Methods for automated task execution history (/tasks/{id}/runs).
list
¶
Return all execution run records for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskRun]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
create
¶
create(task_id: UUID | str, outcome: str, started_at: datetime, completed_at: datetime, *, run_id: UUID | str | None = None, runner_id: str | None = None, input_json: Any | None = None, output_json: Any | None = None, error_message: str | None = None, branch_name: str | None = None) -> TaskRun
Record a completed execution run.
This endpoint is called by the runner after executing an automated task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
outcome
|
str
|
|
required |
started_at
|
datetime
|
When execution began. |
required |
completed_at
|
datetime
|
When execution ended (or timed out). |
required |
run_id
|
UUID | str | None
|
Optional client-supplied UUID for idempotent recording. |
None
|
runner_id
|
str | None
|
Identifier of the runner that executed the task. |
None
|
input_json
|
Any | None
|
Snapshot of the dispatch payload. |
None
|
output_json
|
Any | None
|
Structured output produced by the task. |
None
|
error_message
|
str | None
|
Error details when |
None
|
branch_name
|
str | None
|
Git branch extracted from the run's output ( |
None
|
Returns:
| Type | Description |
|---|---|
TaskRun
|
The recorded :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
get
¶
Fetch a single execution run record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
run_id
|
UUID | str
|
UUID of the run. |
required |
Returns:
| Type | Description |
|---|---|
TaskRun
|
class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the run does not exist. |
AweAuthError
|
If not authenticated. |
TaskTeamRolesClient¶
Accessed via client.task_team_roles.
pyawe.client.TaskTeamRolesClient
¶
Methods for task team-role assignment (/tasks/{id}/team-roles).
list
¶
Return all team-role assignments for a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
Returns:
| Type | Description |
|---|---|
list[TaskTeamRole]
|
List of :class: |
Raises:
| Type | Description |
|---|---|
AweAuthError
|
If not authenticated. |
assign
¶
Assign a team role to a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
team_role_id
|
UUID | str
|
UUID of the team role. |
required |
Returns:
| Type | Description |
|---|---|
TaskTeamRole
|
The created :class: |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the task does not exist. |
AweAuthError
|
If not authenticated. |
remove
¶
Remove a team-role assignment from a task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id
|
UUID | str
|
UUID of the task. |
required |
team_role_id
|
UUID | str
|
UUID of the team role assignment to remove. |
required |
Raises:
| Type | Description |
|---|---|
AweNotFoundError
|
If the assignment does not exist. |
AweAuthError
|
If not authenticated. |