Workflow Management
list
list
Lists all workflows in the project.
Return
A list of msgspec structs containing the workflow metadata with the following structure:
[Workflow(
id='flow_64e812a7e47592ef374cbbc2',
project_id='proj_cd067221d5a6e4007ccbb4afb5966535',
title='Yolov8 Workflow',
create_date=1701927649302,
update_date=1701927649302
)]
Examples
- List all workflows in the project:
from datature.nexus import Client
project = Client("5aa41e8ba........").get_project("proj_b705a........")
project.workflows.list()
- List the workflow with the name "My Awesome Workflow":
from datature.nexus import Client
project = Client("5aa41e8ba........").get_project("proj_b705a........")
workflow = next(
(flow for flow in project.workflows.list()
if flow.title == "My Awesome Workflow")
, None)
get
get
Retrieves a specific workflow using the flow ID.
Parameters
Name | Type | Description |
---|---|---|
flow_id | str | The ID of the workflow. |
Return
A msgspec struct containing the specific workflow metadata with the following structure:
Workflow(
id='flow_64e812a7e47592ef374cbbc2',
project_id='proj_cd067221d5a6e4007ccbb4afb5966535',
title='Yolov8 Workflow',
create_date=1701927649302,
update_date=1701927649302
)
Examples
from datature.nexus import Client
project = Client("5aa41e8ba........").get_project("proj_b705a........")
project.workflows.get("flow_639309be08b4488a914b8802")
update
update
Updates the metadata of a specific workflow using the flow ID.
Parameters
Name | Type | Description |
---|---|---|
flow_id | str | The ID of the workflow. |
flow | object | The new metadata of the workflow to be updated. |
Return
A msgspec struct containing the updated workflow metadata with the following structure:
Workflow(
id='flow_64e812a7e47592ef374cbbc2',
project_id='proj_cd067221d5a6e4007ccbb4afb5966535',
title='My awesome workflow',
create_date=1701927649302,
update_date=1701927649302
)
Examples
- Modify the workflow title of a specific workflow ID:
from datature.nexus import Client, ApiTypes
project = Client("5aa41e8ba........").get_project("proj_b705a........")
project.workflows.update(
"flow_639309be08b4488a914b8802",
{"title": "My awesome workflow"}
)
// or
project.workflows.update(
"flow_639309be08b4488a914b8802",
ApiTypes.FlowMetadata(title="My awesome workflow")
)
- Modify the workflow title of the workflow named "My Awesome Workflow":
from datature.nexus import Client, ApiTypes
project = Client("5aa41e8ba........").get_project("proj_b705a........")
flow_id = [
flow for flow in project.workflows.list()
if flow.title == "My Awesome Workflow"
][0]["id"]
project.workflows.update(flow_id, {"title": "New Workflow Title"})
delete
delete
Deletes a specific workflow using the flow ID.
Deleted workflows are permanently deleted - all information of the workflow, including training parameters, will be deleted and cannot be recovered. This action cannot be undone, so only delete your workflows when you are absolutely sure.
Parameters
Name | Type | Description |
---|---|---|
flow_id | str | The ID of the workflow. |
Return
A msgspec struct containing the deleted workflow ID and deletion status with the following structure:
DeleteResponse(deleted=True, id='flow_656d7912092f3395248c7666')
Examples
- Delete workflow by workflow ID:
from datature.nexus import Client
project = Client("5aa41e8ba........").get_project("proj_b705a........")
project.workflows.delete("flow_639309be08b4488a914b8802")
- Delete workflow with the title "My Awesome Workflow":
from datature.nexus import Client
project = Client("5aa41e8ba........").get_project("proj_b705a........")
flow_id = [
flow for flow in project.workflows.list()
if flow.title == "My Awesome Workflow"
][0]["id"]
project.workflows.delete(flow_id)
Updated 11 months ago