.env file in the directory where you run the Cognite Toolkit. See Authenticating with the Cognite Toolkit.
1
Create the workflow configuration
cdf deploy reads the build/ directory. That path is the default, and cdf build normally creates it from your modules. In this example you create it by hand so you can see the files the command sends to CDF.Create build/workflows/my.Workflow.yaml:my.Workflow.yaml
workflows and the suffix .Workflow.yaml tell the Cognite Toolkit which API to call. This file creates the workflow resource. A workflow that runs tasks also needs a workflow version file. The resource library lists every supported resource.2
Preview the deployment
Run a dry run before you change the CDF project. The plan lists the target project, the Cognite Toolkit version, and the files in The summary reports what the command would change. Because this is a dry run, the project is still unchanged.The dry run would create one workflow.
--verbose prints each resource identifier.build/ is optional because it is the default. The command asks you to type the CDF project name, and that name must match CDF_PROJECT in your environment. Cognite Toolkit commands that can change a project use this check. Pass the project on the command line to skip the prompt: cdf deploy build/ --cdf-project my_demo --dry-run --verbose.The output depends on your project and Cognite Toolkit version. This example uses project my_demo:Verify project
build/. One workflow finishes almost immediately.Plan and execution
Deploy results
--verbose names that workflow myWorkflow. Able to deploy: Yes means your credentials can write the workflow to CDF.3
Deploy the workflow
Run the same command without The setup and plan match the dry run. The summary reports one created workflow,
--dry-run:myWorkflow. The Cognite Toolkit created it with POST /workflows. See the Workflows API.4
Deploy the workflow again
Run the same command a second time. The summary lists
myWorkflow as unchanged. The Cognite Toolkit reads the workflow from CDF and compares it with my.Workflow.yaml. When the file matches the project, it does not send an update.5
Update the workflow
Edit Preview the change:The dry run reports one update to
my.Workflow.yaml:my.Workflow.yaml
--verbose prints the description change:Description diff
myWorkflow and Able to deploy: Yes. The CDF project is still unchanged. Run the command again without --dry-run to apply the new description.6
Delete the workflow
cdf clean deletes the resources listed in build/. Preview the deletion:myWorkflow under Would delete and Able to clean: Yes. Run the command without --dry-run to delete it. The summary then reports one deleted workflow.Next steps
cdf build creates the build/ directory from modules, including the variable substitution this example skipped. See Building configurations.
The resource library lists every file name the Cognite Toolkit can deploy.