Skip to main content
POST
/
workflows
/
{workflowExternalId}
/
versions
/
{version}
/
run
Python SDK
from cognite.client.data_classes import WorkflowTask, FunctionTaskParameters
task = WorkflowTask(
    external_id="my_workflow-task1",
    parameters=FunctionTaskParameters(
        external_id="cdf_deployed_function:my_function",
        data={"workflow_data": "${workflow.input}"}))

res = client.workflows.executions.run("foo", "1")

res = client.workflows.executions.run("foo", "1", input={"a": 1, "b": 2})

import os
from cognite.client.data_classes import ClientCredentials
credentials = ClientCredentials("my-client-id", os.environ["MY_CLIENT_SECRET"])
res = client.workflows.executions.run("foo", "1", client_credentials=credentials)
{
  "id": "059edaa4-a17a-4102-910e-2c3591500cce",
  "workflowExternalId": "<string>",
  "status": "RUNNING",
  "engineExecutionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdTime": 1730204346000,
  "metadata": {},
  "version": "<string>",
  "startTime": 1730204346000,
  "endTime": 1730204346000,
  "reasonForIncompletion": "<string>"
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Path Parameters

workflowExternalId
string
required

Identifier for a workflow. Must be unique for the project. No trailing or leading whitespace and no null characters allowed.

Maximum string length: 255
version
string
required

Identifier for a version. Must be unique for the workflow. No trailing or leading whitespace and no null characters allowed.

Maximum string length: 255

Body

application/json
authentication
object
required
input
object

Input data to the workflow. The content of the input data can be used as input to the workflow tasks using references. The input data should be in JSON format, and is limited to 100KB in size.

Example:
{ "key1": "value1", "key2": "value2" }
metadata
object

Custom, application-specific metadata. String key -> String value. Keys have a maximum length of 32 characters, values a maximum of 255, and there can be a maximum of 10 key-value pairs.

Response

202 - application/json

Information about the workflow execution

id
string<uuid>
required

UUIDv4 identifier for a workflow execution.

Required string length: 36
Example:

"059edaa4-a17a-4102-910e-2c3591500cce"

workflowExternalId
string
required

Identifier for a workflow. Must be unique for the project. No trailing or leading whitespace and no null characters allowed.

Maximum string length: 255
status
enum<string>
required
Available options:
RUNNING,
COMPLETED,
FAILED,
TIMED_OUT,
TERMINATED
engineExecutionId
string<uuid>
required

Additional UUIDv4 identifier for an execution. Useful for Cognite support to diagnose issues.

Required string length: 36
createdTime
integer<int64>
required

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

metadata
object
required

Custom, application-specific metadata. String key -> String value. Keys have a maximum length of 32 characters, values a maximum of 255, and there can be a maximum of 10 key-value pairs.

version
string

Identifier for a version. Must be unique for the workflow. No trailing or leading whitespace and no null characters allowed.

Maximum string length: 255
startTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

endTime
integer<int64>

The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.

Required range: x >= 0
Example:

1730204346000

reasonForIncompletion
string

Human-readable reason for terminal failure of a workflow task.

Last modified on April 23, 2026