Skip to main content

Support for Workflows in the Cognite Python SDK and new Access Management Capabilities

  • October 18, 2023
  • 1 reply
  • 87 views

Jørgen Lund
Seasoned Practitioner
Forum|alt.badge.img

Hi! We have made the following updates available for Workflows.

Support for Workflows in the Cognite Python SDK

The Cognite Python SDK now has native support for Workflows. Documentation can be found here. We have also updated the example notebook, which you can find attached as a file below (Note: Download the file and remove the .txt postfix to open it as a Jupyter Notebook.)

New Access Management Capabilities

You can now configure access to Workflows directly in Access Management in CDF. Navigate to “Manage” > “Manage access” and for the relevant Groups add capabilities to read/write Workflows as needed (see screenshot below). This replaces the experimental ACLs which were required initially to interact with the service.

 

The capabilities can also be added to a group using the SDK directly, e.g.:

from cognite.client.data_classes import Group

capabilities = [{"workflowOrchestrationAcl": {"actions": ["READ", "WRITE"], "scope": {"all": { }}}}]
group = Group(name="Workflow Orchestration", capabilities=capabilities)
client.iam.groups.create(group)

 

1 reply

Anders  Albert
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • October 24, 2023

Two things

  1. In the example notebook, lets use the factory method for creating the client to avoid the URLs:
    from cognite.client import CogniteClient

    # Enter CDF and credential detials
    cdf_cluster = "" # "api", "greenfield", etc.
    cdf_project = "" # CDF project name
    tenant_id = "" # IdP tenant ID
    client_id = "" # IdP client ID
    client_secret = "" # IdP client secret

    client = CogniteClient.default_oauth_client_credentials(
    cdf_project, cdf_cluster, tenant_id, client_id, client_secret
    )
    2. In addition, lets include the code for how to add the correct capabilities through the SDK?