Retrieve Workflow Versions

async AsyncCogniteClient.workflows.versions.retrieve(
workflow_external_id: WorkflowVersionIdentifier | Sequence[WorkflowVersionIdentifier] | WorkflowIds,
*,
ignore_unknown_ids: bool = False,
) WorkflowVersion | WorkflowVersionList | None

Retrieve a workflow version.

Parameters:
  • workflow_external_id (WorkflowVersionIdentifier | Sequence[WorkflowVersionIdentifier] | WorkflowIds) – External id of the workflow.

  • ignore_unknown_ids (bool) – When requesting multiple, whether to ignore external IDs that are not found rather than throwing an exception.

Returns:

If a single identifier is specified: the requested workflow version, or None if it does not exist. If several ids are specified: the requested workflow versions.

Return type:

WorkflowVersion | WorkflowVersionList | None

Examples

Retrieve workflow version ‘v1’ of workflow “my_workflow”:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes import WorkflowVersionId
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.workflows.versions.retrieve(WorkflowVersionId("my_workflow", "v1"))

Retrieve multiple workflow versions and ignore unknown:

>>> res = client.workflows.versions.retrieve(
...     [WorkflowVersionId("my_workflow", "v1"), WorkflowVersionId("other", "v3.2")],
...     ignore_unknown_ids=True,
... )
>>> # A sequence of tuples is also accepted:
>>> res = client.workflows.versions.retrieve([("my_workflow", "v1"), ("other", "v3.2")])