Dynamic references
Dynamic references are expressions used to dynamically inject data into task parameters during workflow executions. Define references to create parametric workflows by passing data from workflow inputs or between tasks.Reference picker in the editor
For Transformation, Function, and Agent tasks, the Data workflows editor provides a reference picker to assemble${...} expressions without typing them in full. Browse suggested segments and add custom segments for nested properties or array indices when values come from runtime data (for example under ${workflow.input} from trigger payloads).
Reference syntax
References must follow the format${prefix.jsonPath}, where:
- prefix specifies the data source (workflow input or a task’s output or input).
- jsonPath uses JSONPath-style notation to access nested properties.
Reference prefixes
Known and custom path segments
When you extend a reference beyond its prefix (for example${workflow.input.items[0].name}), segments are:
- Known: Paths the editor can suggest from static configuration or typical output shapes.
- Custom: Extra segments you supply so the expression matches your JSON at run time (property names, array indices, nested keys), following JSONPath for nested data.
JSONPath for nested data
Use dot notation to access nested properties and bracket notation to access array elements with zero-based indices. This is an example of workflow input data:${workflow.input.data.user.email}→"user@example.com"${workflow.input.data.user.preferences.timezone}→"UTC"${workflow.input.data.items}→["item1", "item2"]${workflow.input.data.items[0]}→"item1"${workflow.input.data.matrix[0][2]}→"c"${workflow.input.data.matrix[1][0]}→"d"
Make workflows parametric
Use references to create reusable workflows that behave differently based on input data:Not all task parameters support dynamic references. See the API documentation for specific parameter support.
Task statuses
During workflow execution, each task progresses through different statuses that indicate its current state:Task types
CDF Transformations tasks
Orchestrate CDF Transformation tasks, such as running SQL transformations to process and aggregate data, schedule data ingestions and clean pipelines, or coordinate multiple transformations with dependencies.1
Set type to transformation
Set type to
transformation.2
Configure parameters
Under parameters, set
externalId as the external ID of the CDF Transformation to be triggered.3
Optional. Set concurrency policy
The optional parameter
concurrencyPolicy determines the behavior of a task if the triggered transformation is already running. The following options are available:Cognite Functions tasks
Orchestrate Cognite Functions tasks, such as integrating with external APIs and systems for complex calculations, custom data processing logic, or data validation and quality checks.1
Set type to function
Set type to
function.2
Configure external ID
Under parameters, set the
externalId as the external ID of the function to be triggered.3
Provide input data
Use data to provide input to the function. Use a JSON string that will be passed as the data argument to the function when it’s triggered during the workflow execution.
isAsyncComplete parameter:
When isAsyncComplete is set to false (default), the workflow will trigger the function. The status of the workflow task will reflect the status of the execution of the function. For instance, the task’s status will be marked as COMPLETED in the workflow when the function has run and completed successfully.
When isAsyncComplete is set to true, the workflow will trigger the function. The status of the workflow task will remain IN_PROGRESS until the workflow receives an explicit callback to the update task status endpoint to change the status to one of COMPLETED, FAILED, or FAILED_WITH_TERMINAL_ERROR.
You must define the required logic in the Cognite Function to trigger the third-party process and the logic in the third-party process to update the task status in the data workflow.
Your Function receives the task ID in its input data under the key
cogniteOrchestrationTaskId. Use this ID to update the task status in your callback.
Cognite simulation tasks
Orchestrate Cognite simulation tasks, such as engineering simulations for process optimization, predictive maintenance simulations to assess equipment health, what-if scenario analysis, or to integrate simulation results into data pipelines.1
Set type to simulation
Set type to
simulation.2
Configure routine external ID
Under parameters, set the
routineExternalId as the external ID of the simulator routine to be triggered.3
Optional. Override inputs
Use the optional
inputs parameter to override inputs in the routine. It accepts a list of input overrides that will be passed to the routine when it’s triggered during workflow execution.4
Optional. Specify run time
Use the optional
runTime parameter to specify when the simulation should run.CDF request task
Orchestrate a CDF task, such as reading data from CDF APIs to use in subsequent tasks, or to create or update CDF resources dynamically.1
Set type to cdf
Set type to
cdf. The task type makes authenticated requests to the Cognite APIs using the credentials provided when the workflow is run.2
Configure HTTP request parameters
Under parameters, fill in the details of the HTTP request to be made:
resourcePath: define the endpoint to be called and is prefixed by{cluster}.cognitedata.com/api/v1/project/{project}based on the CDF cluster and project. For example, to filter time series, theresourcePathwould be/timeseries/list.queryParameters: enter any additional parameters that should be part of the CDF query.method: give the requestmethod-POST,GET,PUTandDELETE.requestTimeoutInMillis: is set in milliseconds. There should be a response after triggering a request to the URL. No response from the URL within the timeout interval indicates that the task fails with the statusTIMED_OUT.- Specifying the
bodyof the request is optional.
If you use a
GET method, you don’t need the body parameter.JSON mapping tasks
Orchestrate JSON mapping tasks between steps using Kuiper expressions, so you can preprocess or enrich data for downstream tasks such as entity matching. An external worker evaluates a Kuiper expression and returns transformed JSON. For available transforms, see Built-in functions.1
Set type to jsonMapping
Set type to
jsonMapping.2
Configure parameters
Under parameters, set jsonMapping with the following fields.
If the expression must contain a literal dollar sign (
$), escape it as $$ so it is not parsed as a placeholder.Dynamic tasks
Use dynamic tasks when a set of workflow tasks and their execution order are determined at runtime. For instance, dynamic tasks can be used to process variable numbers of data sources, create workflows based on runtime conditions, handle different processing paths based on data content, or create fan-out patterns where the number of parallel tasks depends on input data. The task takes thetasks parameter, which must be an array of valid task definitions.
The array of tasks must be determined during the runtime of the workflow and can’t be included statically in the workflow definition. Instead, use a reference, meaning a dynamic value that will be evaluated when the workflow is run. The dynamic value can either refer to a part of the input to the execution or the output of another task in the workflow.
-
The first task of the workflow is a Cognite Function, which generates and outputs an array of task definitions. The Python code run in the Function returns a dictionary that includes a
taskskey. -
The second task is a Dynamic task, which references and runs the set of tasks defined by the preceding step:
"tasks": "${first-task.output.response.tasks}".
A dynamic task can’t start a subworkflow or another dynamic task.
Subworkflow task
Use subworkflow tasks to run a collection of tasks as a workflow within a workflow. This streamlines your workflows by grouping tasks with shared dependencies into a subworkflow or enhances the composability and reusability of your workflows by incorporating subworkflows through references. For instance, you can use subworkflow tasks to group related tasks for better organization, create reusable task blocks within the same workflow, logically separate workflow phases, or isolate error handling for specific task groups. Define these tasks directly in the current workflow definition or reference the tasks to another workflow.Inline subworkflow (List of tasks)
Use thetasks parameter and provide an array of valid task definitions to include a list of tasks directly in the workflow definition:
External workflow reference
Use external workflows to reuse existing workflows across multiple parent workflows, create modular workflow architectures, version and maintain complex workflow components separately, and build workflows from tested, proven components Use theworkflowExternalId and version parameters to reference another workflow and to specify the workflow version to be embedded as a subworkflow:
Workflows referenced in subworkflow tasks can only nest one level deep. They can’t contain subworkflows or dynamic tasks.