Filter workflow executions
Required capabilities:
workflowOrchestrationACL:READ
List workflow executions matching a given filter.
POST
/
workflows
/
executions
/
list
Python SDK
res = client.workflows.executions.list(("my_workflow", "1"))
from cognite.client.utils import timestamp_to_ms
res = client.workflows.executions.list(
created_time_start=timestamp_to_ms("1d-ago"))
curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"workflowFilters": [
{
"externalId": "<string>",
"version": "<string>"
}
],
"createdTimeStart": 1,
"createdTimeEnd": 1,
"status": []
},
"limit": 100,
"cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {
workflowFilters: [{externalId: '<string>', version: '<string>'}],
createdTimeStart: 1,
createdTimeEnd: 1,
status: []
},
limit: 100,
cursor: '4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo'
})
};
fetch('https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'workflowFilters' => [
[
'externalId' => '<string>',
'version' => '<string>'
]
],
'createdTimeStart' => 1,
'createdTimeEnd' => 1,
'status' => [
]
],
'limit' => 100,
'cursor' => '4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list"
payload := strings.NewReader("{\n \"filter\": {\n \"workflowFilters\": [\n {\n \"externalId\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"createdTimeStart\": 1,\n \"createdTimeEnd\": 1,\n \"status\": []\n },\n \"limit\": 100,\n \"cursor\": \"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"workflowFilters\": [\n {\n \"externalId\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"createdTimeStart\": 1,\n \"createdTimeEnd\": 1,\n \"status\": []\n },\n \"limit\": 100,\n \"cursor\": \"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"workflowFilters\": [\n {\n \"externalId\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"createdTimeStart\": 1,\n \"createdTimeEnd\": 1,\n \"status\": []\n },\n \"limit\": 100,\n \"cursor\": \"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo\"\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"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>"
}
],
"nextCursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}Authorizations
oidc-tokenoauth2-client-credentialsoauth2-open-industrial-dataoauth2-auth-code
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.
Scopes
Body
application/json
Response
200 - application/json
Filtered list of workflow executions
⌘I
Python SDK
res = client.workflows.executions.list(("my_workflow", "1"))
from cognite.client.utils import timestamp_to_ms
res = client.workflows.executions.list(
created_time_start=timestamp_to_ms("1d-ago"))
curl --request POST \
--url https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filter": {
"workflowFilters": [
{
"externalId": "<string>",
"version": "<string>"
}
],
"createdTimeStart": 1,
"createdTimeEnd": 1,
"status": []
},
"limit": 100,
"cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {
workflowFilters: [{externalId: '<string>', version: '<string>'}],
createdTimeStart: 1,
createdTimeEnd: 1,
status: []
},
limit: 100,
cursor: '4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo'
})
};
fetch('https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'workflowFilters' => [
[
'externalId' => '<string>',
'version' => '<string>'
]
],
'createdTimeStart' => 1,
'createdTimeEnd' => 1,
'status' => [
]
],
'limit' => 100,
'cursor' => '4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list"
payload := strings.NewReader("{\n \"filter\": {\n \"workflowFilters\": [\n {\n \"externalId\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"createdTimeStart\": 1,\n \"createdTimeEnd\": 1,\n \"status\": []\n },\n \"limit\": 100,\n \"cursor\": \"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"workflowFilters\": [\n {\n \"externalId\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"createdTimeStart\": 1,\n \"createdTimeEnd\": 1,\n \"status\": []\n },\n \"limit\": 100,\n \"cursor\": \"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{cluster}.cognitedata.com/api/v1/projects/{project}/workflows/executions/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"workflowFilters\": [\n {\n \"externalId\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"createdTimeStart\": 1,\n \"createdTimeEnd\": 1,\n \"status\": []\n },\n \"limit\": 100,\n \"cursor\": \"4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo\"\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"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>"
}
],
"nextCursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo"
}