List Workflow Versions

async AsyncCogniteClient.workflows.versions.list(
workflow_version_ids: WorkflowIdentifier | MutableSequence[WorkflowIdentifier] | None = None,
limit: int | None = 25,
) WorkflowVersionList

List workflow versions in the project.

Parameters:
  • workflow_version_ids (WorkflowIdentifier | MutableSequence[WorkflowIdentifier] | None) – Workflow version id or list of workflow version ids to filter on.

  • limit (int | None) – Maximum number of results to return. Defaults to 25. Set to -1, float(“inf”) or None

Returns:

The requested workflow versions.

Return type:

WorkflowVersionList

Examples

Get all workflow version for workflows ‘my_workflow’ and ‘my_workflow_2’:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.workflows.versions.list(["my_workflow", "my_workflow_2"])

Get all workflow versions for workflows ‘my_workflow’ and ‘my_workflow_2’ using the WorkflowVersionId class:

>>> from cognite.client.data_classes import WorkflowVersionId
>>> res = client.workflows.versions.list(
...     [WorkflowVersionId("my_workflow"), WorkflowVersionId("my_workflow_2")]
... )

Get all workflow versions for workflows ‘my_workflow’ version ‘1’ and ‘my_workflow_2’ version ‘2’ using tuples:

>>> res = client.workflows.versions.list([("my_workflow", "1"), ("my_workflow_2", "2")])