Skip to main content

Client

Fundamentals

Workflows are connected to the Project class and are generated automatically during project creation. Workflows help organize and control the flow of labeling tasks through different stages. Key concepts:
  • Workflows are composed of nodes and edges.
  • Each node can have only one input connection, except when both Initial labeling task and Rework (All Rejected) nodes serve as inputs to a single downstream node.
  • No changes are pushed to the platform until you call update_config().
  • All nodes must be connected for the workflow to be valid.

Access a workflow

Clone a workflow from a different project

Reset a workflow

Use reset_to_initial_nodes() to only have the InitialLabeling and InitialRework nodes and start from scratch. The method will return an object InitialNodes with two attributes labeling and rework. You can also pass parameters to configure the initial nodes.

Commit changes

To push changes made to a workflow, you must use update_config(). In case of validation issue, it will throw a ValueError exception.

Nodes

Add a node

Types of nodes are listed in the enum NodeType: Initial nodes:
  • NodeType.InitialLabeling - Entry point for new labeling tasks
  • NodeType.InitialRework - Entry point for tasks that need to be reworked
Step nodes:
  • NodeType.Review - Review completed labels
  • NodeType.Logic - Apply filters to route tasks conditionally
  • NodeType.CustomRework - Custom rework step with configurable settings
Terminal nodes:
  • NodeType.Done - Marks tasks as completed
  • NodeType.Rework - Sends tasks back to the rework queue
  • NodeType.CustomRework can be used as a terminal node or be connected to another node.
NodeType.CustomRework can be used as a terminal node or be connected to another node.

Delete a node

This automatically removes connected edges. Initial nodes can’t be deleted.

Edges

Add an edge

Edges connect the output of a source node to the input of a target node. All nodes must be connected in the workflow. Types of outputs are listed in the enum NodeOutput:
  • NodeOutput.If (default value, can be omitted)
  • NodeOutput.Else
  • NodeOutput.Approved
  • NodeOutput.Rejected

Outputs per node

Node attributes

The following attributes can be configured for each node type: Common attributes:
  • max_contributions_per_user: Positive integer representing the maximum number of labels per task queue (empty for no limit)
  • instructions: Custom instructions for labelers working on this node
  • group_assignment: List of user group IDs assigned to this node
  • individual_assignment: Individual assignment strategy (you can use the IndividualAssignment enum)

Filters

Logic node

The Logic node contains filters that determine how tasks flow through the workflow. The match_filters attribute controls how multiple filters are evaluated:
  • MatchFilters.Any: Match any of the filters (OR logic)
  • MatchFilters.All: Match all of the filters (AND logic)

Add and remove filters

Manage filters on Logic nodes

Available filters

Each filter type can be used at most once per Logic node. The enum FilterField provides available filters for search or deletion:
  • FilterField.Annotation
  • FilterField.Batch
  • FilterField.ConsensusAverage
  • FilterField.Dataset
  • FilterField.FeatureConsensusAverage
  • FilterField.IssueCategory
  • FilterField.LabelingTime
  • FilterField.LabeledAt
  • FilterField.LabeledBy
  • FilterField.Metadata
  • FilterField.ModelPrediction
  • FilterField.NlSearch
  • FilterField.ReviewTime
  • FilterField.Sample

annotation

Filter by the presence of specific annotations. schema_node_ids is a list of schema node IDs that correspond to tools or classifications defined in the project’s ontology schema. Operators: None (direct list filter)

batch

Filter by batch membership. **Operators: **
  • is_one_of
  • is_not_one_of

consensus_average

Filter by overall consensus score. Operators: None (range filter with min/max)

dataset

Filter by dataset membership. Operators: None (direct list filter)

feature_consensus_average

Filter by consensus score for specific features. annotations is a list of schema node IDs that correspond to tools or classifications defined in the project’s ontology schema. Operators: None (range filter with min/max and annotation list)

issue_category

Filter by issue categories flagged during review. Operators:
  • is_one_of

labeling_time

Filter by how long it took to create the label. The value represents a number of seconds. Operators:
  • greater_than
  • less_than
  • greater_than_or_equal
  • less_than_or_equal
  • between

labeled_at

Filter by when the label was created. Operators:
  • between

labeled_by

Filter by the user who created the label. Operators:
  • is_one_of

metadata

Filter by data row metadata values. Each condition m_condition) takes a metadata schema ID key) and list of strings as parameters value). Operators:
  • contains
  • starts_with
  • ends_with
  • does_not_contain
  • is_any
  • is_not_any

model_prediction

Filter by model predictions. Model predictions use a list of conditions named mp_condition. Each condition takes a list of model IDs, followed by an integer for the minimum score min_score) and an integer for the optional maxim score max_score). is_none takes precedence over other operators. Operators:
  • is_one_of
  • is_not_one_of
  • is_none

natural_language

Filter using semantic search. The content (or prompt) follows this format: "Find this / more of this / not this / bias_value" where bias_value is a decimal between 0 and 1. Operators: None (semantic search with score range)

review_time

Filter by how long it took to review the label. Operators:
  • greater_than
  • less_than
  • greater_than_or_equal
  • less_than_or_equal
  • between

sample

Filter by percentage sampling. The percentage is entered as an integer. Operators: None (percentage value)

Example: Create a minimal workflow

The following example will create a basic workflow with three nodes:
  • Initial labeling task
  • Rework (all rejected)
  • Done

Example: Showcase complete workflow

The following example shows all the nodes and filters.