Ango Hub Docs
Open Ango HubContact iMerit
  • Ango Hub Documentation
  • Video Guides
  • Changelog
  • FAQs & Troubleshooting
  • All Keyboard and Mouse Shortcuts
  • Core Concepts
    • Assets
    • Attachments
    • Batches
    • Benchmarks
    • Category Schema (Ontologies)
    • Frame Interpolation
    • Geofencing
    • Idle Time Detection & Time Tracking
    • Instructions
    • Issues
      • Issue Error Codes
    • Label Validation
    • Labeler Performance
    • Labeling
    • Labeling Queue
    • Multiple Classification
    • Notifications
    • Organizations
    • Projects
    • Requeuing
    • Reviewing
    • Review Queue
    • Skipping
    • Stage History
    • Tasks
    • Usage
    • User Roles
    • Workflow
      • Complete
      • Consensus
      • Hold
      • Label
      • Logic
      • Plugin
      • Review
      • Start
      • Webhook
  • Labeling
    • Managing Users in Projects
      • Profile Page
    • Managing the Project Ontology
    • Labeling Editor Interface
      • Audio Labeling Editor
      • Image Labeling Editor
      • Video Labeling Editor
      • DICOM Labeling Editor
      • Medical Labeling Editor
        • 3D Bounding Box
        • Fill Between Slices
        • Island Tools
        • Line (Tape Measure)
        • Smoothing
      • PDF Labeling Editor
      • Text (NER) Labeling Editor
      • LLM Chat Labeling Editor
      • Markdown Labeling Editor
      • 3D Multi-Sensor Fusion Labeling Editor
    • Labeling Classes
      • Tools
        • Bounding Box
        • Brush
        • Entity
        • Message
        • Nested Classifications
        • PCT
        • PDF Tool
        • Point
        • Polygon
        • Polyline
        • Rotated Bounding Box
        • Segmentation
        • Spline
        • Voxel Brush
      • Classification
        • Checkbox
        • Multiple Dropdown
        • Radio
        • Rank
        • Single Dropdown
        • Text
        • Tree Dropdown Tools (Single and Multiple Selection)
      • Relation
        • Single Relation
        • Group Relation
    • Magnetic Lasso
    • Performance & Compatibility Considerations
  • Data
    • Data in Ango Hub
      • Embedding Private Bucket Files in MD Assets
    • Importing Assets
      • Asset Builder
      • Bundled Assets
        • Importing Multiple Images as One Multi-Page Asset
        • Importing Multiple Single-Frame DICOM Files as One Multi-Page Asset
        • Importing multiple DICOM files to be annotated and displayed at once
        • Importing Multiple Single-Frame DICOM Files as a DICOM Series
        • Importing Multiple Markdown Files as One Multi-Page Asset
      • File Explorer
      • Supported Asset File Types & Codecs
      • Importing Cloud (Remote) Assets
      • Importing From Local Machine
      • Creating and Importing LLM Chat Assets
      • Importing Data in the 3D Multi-Sensor Fusion Labeling Tool
      • Bulk Importing Markdown/HTML Assets
      • Importing Attachments during Asset Import
      • Importing Annotations during Asset Import
      • contextData: Adding Extra Data to Assets
      • Importing Reference Images as Overlay
      • Importing Reference Medical Data During Asset Import
    • Importing and Exporting Annotations
      • Importing Annotations
        • Ango Import Format
        • Importing Brush Traces
        • Importing NRRD Annotations
      • Exporting Annotations
        • Ango Export Format
          • Asset
            • Task
              • Tools
              • Classifications
              • Relations
          • Stage History
    • Adding and Managing LLMs
    • Storages
      • Set up a storage integration with Azure
      • Set up a storage integration with AWS S3
      • Set up a storage integration with MinIO and S3-compatible custom storage services
      • Set up a storage integration with GCP (Google Cloud Platform)
      • Set up CORS
      • Validating Storage Integrations
    • Purging Data from Ango Hub
  • Plugins
    • Overview of Plugins in Ango Hub
      • Installing Plugins
      • Plugin Setting Presets
      • Monitoring Plugin Progress
    • First-Party Plugins
      • Ango Export Converter Plugins
      • Asset Converter Plugins
      • Ango to Mask Converter
      • Batch Assignment
      • ChatGPT
      • Column-Agnostic Markdown Generator
      • CSV Export for Classification
      • DALL-E
      • DALL-E (Model Plugin)
      • File Explorer Plugin
      • General Object Detector
      • General Object Segmenter
      • Markdown Generator
      • One-Click Segmentation
      • Open World Object Detection
      • Optical Character Recognition
      • TPT Export
      • YOLO | Instance Segmentation
      • YOLO | Pose Estimation
      • YOLO | Object Detection
      • YOLO | Image Classification
    • Plugin Developer Documentation
      • Export Plugins
      • Batch Model Plugins
      • Model Plugins
      • File Explorer Plugins
      • Markdown Generator Plugins
      • Plugin Logger
      • [WIP] Deploying your Plugin
      • Plugin 'Host' Information
  • SDK
    • SDK Documentation
      • Project Level SDK Functions
        • add_members_to_project
        • assign_batches
        • assign_task
        • create_attachment
        • create_batch
        • create_issue
        • create_label_set
        • create_project
        • delete_issue
        • export
        • exportV3
        • get_assets
        • get_batches
        • get_issues
        • get_metrics
        • get_project
        • get_project_performance
        • get_task
        • get_tasks
        • get_task_history
        • import_labels
        • list_projects
        • requeue_tasks
        • rerun_webhook
        • update_workflow_stages
        • upload_files
        • upload_files_cloud
        • upload_files_with_asset_builder
        • upload_chat_assets
      • Organization Level SDK Functions
        • create_storage
        • delete_organization_invites
        • delete_organization_members
        • delete_storage
        • get_organization_invites
        • get_organization_members
        • get_storages
        • invite_members_to_org
        • update_organization_members_role
    • SDK - Useful Snippets
    • SDK Changelog
  • API
    • API Documentation
  • How-To
    • Add Members
      • Add multiple users to a project
    • Annotate
      • Annotate 3D Point Cloud Files on Ango Hub
      • Perform targeted OCR on images
    • Export Data
      • Automatically send Ango Hub Webhook contents to Google Sheets, Email, Slack, and more with Zapier
      • Download a JSON of your project ontology
      • Download DICOM Segmentation Masks
      • Download your annotations in the COCO, KITTI, or YOLO format
      • Download your Segmentation Masks
      • Get your export as separate JSON files for each asset
    • Manage a Project
      • Get your API Key
      • Get your Organization ID
      • Mute your notifications
      • Open an asset provided the Asset ID
      • Pre-label assets
      • Share a filtered view of the Tasks table with others
      • Transfer project ontologies between projects
      • Transfer project workflows between projects
    • Perform Model Evaluation on Ango Hub
  • Troubleshooting
    • I get a "0 Tasks Labeled" alert when trying to pre-label tasks
    • I get a 'The data couldn't be loaded properly' error when opening certain assets
    • I get a "Unknown Classification" warning when opening a task
  • Feature Availability Status for projects of the 3D Multi-Sensor Fusion type
  • Comparison between QuickServe and Ango Hub
  • Changes from Ango Hub Legacy
  • Video V2 Breaking Changes and Transition
  • Data Access, Storage, and Security
  • Two-Factor Authentication
  • Single Sign-On (SSO) Support
  • Customer Support
  • Ango Hub Status Page
Powered by GitBook
On this page
  • update_workflow_stages(project_id, stages)
  • Parameters
  • Example
  1. SDK
  2. SDK Documentation
  3. Project Level SDK Functions

update_workflow_stages

Previousrerun_webhookNextupload_files

Last updated 3 months ago

imerit_ango.sdk.SDK.

update_workflow_stages(project_id, stages)

Update the workflow of your project.

Parameters

  • project_id: string

    • The unique identifier for the project. You can find the project ID in or retrieve it using the function.

  • stages: List[dict]

    • The workflow of the project, in JSON format.

    • Stage types and their required fields:

Start Stage
  • "id": "Start"

  • "type": "Start"

  • "name": "Start"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID>"]

  • "autoForward": true or false

Complete Stage
  • "id": "Complete"

  • "type": "Complete"

  • "name": "Complete"

  • "position": {"x": 10, "y": 20}

  • "preventRequeue": true or false

Label Stage
  • "id": "<STAGE ID>"

  • "type": "Label"

  • "name": "Label"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID>"]

  • "assignedTo": ["user_1@imerit.net", "user_2@imerit.net"]

Consensus Stage
  • "id": "<CONSENSUS STAGE ID>"

  • "type": "Consensus"

  • "name": "Consensus"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID AGREEMENT>", "<NEXT STAGE ID DISAGREEMENT>"]

Two types of stages, “Label” and “Plugin”, can be added to a consensus stage. They should adhere to the following format:

Label Stage:

  • "id": "<STAGE ID>"

  • "type": "Label"

  • "name": "Consensus_1"

  • "position": {"x": 0, "y": 0}

  • "next": ["<CONSENSUS STAGE ID>"]

  • "assignedTo": ["user_1@imerit.net", "user_2@imerit.net"]

  • "consensusId": "<CONSENSUS STAGE ID>"

Plugin Stage:

  • "id": "<STAGE ID>"

  • "type": "Plugin"

  • "name": "Consensus_2"

  • "position": {"x": 0, "y": 0}

  • "next": ["<CONSENSUS STAGE ID>"]

  • "pluginId": "<PLUGIN ID>"

  • "consensusId": "<CONSENSUS STAGE ID>"

Review Stage
  • "id": "<STAGE ID>"

  • "type": "Review"

  • "name": "Review"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID ACCEPTED>", "<NEXT STAGE ID REJECTED>"]

  • "assignedTo": ["user_1@imerit.net", "user_2@imerit.net"]

  • "readOnly": true or false

Hold Stage
  • "id": "<STAGE ID>"

  • "type": "Hold"

  • "name": "Hold"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID>"]

Logic Stage
  • "id": "<STAGE ID>"

  • "type": "Logic"

  • "name": "Logic"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID IF CONDITION>", ..., "<NEXT STAGE ID ELSE CONDITION>"]

  • "logic": {"conditions": [...]}

  • A single condition should follow:

Logic Type: Annotation Type

  • {"type": "AnnotationType", "value": {"tools": [{"schemaId": "<Schema ID>", "filter": ["exists"]}]}, "index": 0}

Logic Type: Assignee

  • {"type": "Annotator", "value": ["user@imerit.net"], "index": 0}

Logic Type: Random Sample

  • {"type": "RandomSample", "value": 0.100", "index": 0 ]}

Logic Type: Task Duration

  • {"type": "Duration", "value": [Start Time, End Time], "index": 0}

Logic Type: Batch

  • {"type": "Batch", "value": ["<SELECTED BATCH ID>"], "index": 0}

Plugin Stage
  • "id": "<STAGE ID>"

  • "type": "Plugin"

  • "name": "Plugin"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID>"]

  • "pluginId": "<PLUGIN ID>"

Webhook Stage
  • "id": "<STAGE ID>"

  • "type": "Webhook"

  • "name": "Webhook"

  • "position": {"x": 10, "y": 20}

  • "next": ["<NEXT STAGE ID>"]

  • "webhook": {"secret": "<SECRET>", "url": "<URL>"}

Note: To get an idea of what you can pass as input in Stages, you may create a workflow in a project, then run:

ango_sdk.get_project(<PROJECT ID>).get("data").get("project").get("stages")

As the returned JSON, you'll get the JSON representation of the project's workflow, which you can use as a skeleton to create your own workflow JSONs.

Returns:

  • output: dict

Example

Create a workflow from scratch

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

start_stage = {"id": "Start",
               "type": "Start",
               "name": "Start",
               "next": ["Label"],
               "autoForward": False,
               "position": {"x": 0, "y": 0}}

label_stage = {"id": "Label",
               "type": "Label",
               "name": "Label",
               "next": ["Review"],
               "assignedTo": [],
               "position": {"x": 400, "y": 0}}

review_stage = {"id": "Review",
                "type": "Review",
                "name": "Review",
                "next": ["Complete", "Label"],
                "assignedTo": [],
                "position": {"x": 800, "y": 0}}

complete_stage = {"id": "Complete",
                  "type": "Complete",
                  "name": "Complete",
                  "next": [],
                  "position": {"x": 1200, "y": 0},
                  "preventRequeue": False}

stages = [start_stage, label_stage, review_stage, complete_stage]

sdk_response = ango_sdk.update_workflow_stages(project_id=project_id, stages=stages)

Disable the "Auto Forward on Upload" option on the Start stage

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

stages = ango_sdk.get_project(project_id=project_id).get("data").get("project").get("stages")

new_stages = []
for stage in stages:
    new_stage = stage.copy()
    if stage["id"] == "Start":
        new_stage["autoForward"] = False
    new_stages.append(new_stage)

sdk_response = ango_sdk.update_workflow_stages(project_id=project_id, stages=new_stages)

Prevent requeueing to Complete stage

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

stages = ango_sdk.get_project(project_id=project_id).get("data").get("project").get("stages")

new_stages = []
for stage in stages:
    new_stage = stage.copy()
    if stage["id"] == "Complete":
        new_stage["preventRequeue"] = True
    new_stages.append(new_stage)

sdk_response = ango_sdk.update_workflow_stages(project_id=project_id, stages=new_stages)

See also

get_project
list_projects
the user interface