Workflows#

Workflows are a powerful tool to design and build your projects - letting you control how an annotation task moves through different stages of the project, as well as determining how different stages are structured and interact with one another.

Please note that we are rolling this feature out into open availability in Beta mode. While it’s already powerful and flexible, many features are still in development and will be added progressively.

1. Creating a Workflow project#

At the moment Workflow projects have to be created using the Encord web-app. Please see our tutorial on how to create Workflow projects to learn how this is done.

2. Attributes for Workflow projects#

Please note that the attributes outlined below can only be used when working with Workflow projects.

Our SDK currently had two attributes specific to working with Workflow projects:

  • The workflows_reopen() attribute returns a label row to the first annotation stage for re-labeling. No data is lost during the call.

  • The workflow_graph_node() attribute returns the location of a task within the workflow in the form of a ‘uuid’ and a ‘title’. The ‘title’ corresponds to the name of the current stage in the workflow.

3. Working with Workflow projects#

The example below returns all label rows in a project to the first annotation stage.

from encord import EncordUserClient, Project

user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
    "<your_private_key>"
)
project: Project = user_client.get_project("<workflows_project_hash>")

for label_row in project.list_label_rows_v2():
    label.workflow_reopen()

The example below shows how both attributes can be used to revert tasks in “<review_stage_2>” back ot the first annotation stage of a workflow:

from encord import EncordUserClient, Project

user_client: EncordUserClient = EncordUserClient.create_with_ssh_private_key(
    "<your_private_key>"
)
project: Project = user_client.get_project("<workflows_project_hash>")

for label_row in project.list_label_rows_v2():
    if label_rows.workflow_graph_node.title == "<review_stage_2>":
        label.workflow_reopen()