Get Run
curl --request GET \
--url https://api.godiligent.ai/flow-runs/{runId} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.godiligent.ai/flow-runs/{runId}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.godiligent.ai/flow-runs/{runId}', 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://api.godiligent.ai/flow-runs/{runId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.godiligent.ai/flow-runs/{runId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.godiligent.ai/flow-runs/{runId}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.godiligent.ai/flow-runs/{runId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "<string>",
"flow_id": "<string>",
"flow_version_id": "<string>",
"status": "QUEUED",
"triggered_at": "2023-11-07T05:31:56Z",
"trigger_type": "manual",
"triggered_by": "<string>",
"input": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"skip_reason": "<string>",
"report": "<string>",
"output_ref": "<string>",
"log_ref": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"step": "<string>",
"transient": true
},
"meta": {},
"records": [
{}
],
"run_mode": "rehearsal",
"act_intents": [
{
"tool": "<string>",
"input": "<unknown>",
"mock_source": "<string>"
}
],
"degraded": true,
"failed_sources": [
{
"namespace": "<string>",
"count": 123
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{}
]
}{
"code": "RUN_NOT_FOUND",
"message": "Run not found: 8f14e45f-ceea-4c6b-a1b2-3c4d5e6f7890"
}Flows
Get Run
Poll a Flow run for its status and result
GET
/
flow-runs
/
{runId}
Get Run
curl --request GET \
--url https://api.godiligent.ai/flow-runs/{runId} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.godiligent.ai/flow-runs/{runId}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.godiligent.ai/flow-runs/{runId}', 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://api.godiligent.ai/flow-runs/{runId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.godiligent.ai/flow-runs/{runId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.godiligent.ai/flow-runs/{runId}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.godiligent.ai/flow-runs/{runId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "<string>",
"flow_id": "<string>",
"flow_version_id": "<string>",
"status": "QUEUED",
"triggered_at": "2023-11-07T05:31:56Z",
"trigger_type": "manual",
"triggered_by": "<string>",
"input": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"skip_reason": "<string>",
"report": "<string>",
"output_ref": "<string>",
"log_ref": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"step": "<string>",
"transient": true
},
"meta": {},
"records": [
{}
],
"run_mode": "rehearsal",
"act_intents": [
{
"tool": "<string>",
"input": "<unknown>",
"mock_source": "<string>"
}
],
"degraded": true,
"failed_sources": [
{
"namespace": "<string>",
"count": 123
}
]
}{
"code": "<string>",
"message": "<string>",
"details": [
{}
]
}{
"code": "RUN_NOT_FOUND",
"message": "Run not found: 8f14e45f-ceea-4c6b-a1b2-3c4d5e6f7890"
}Behavior
- Poll this endpoint with the
idreturned by Run untilstatusreaches a terminal value (COMPLETED,FAILED,CANCELLED, orSKIPPED), or register a webhook forflow_run_completedandflow_run_failed. The webhook includes the terminal run object; structured output is read separately with Get Run Output. reportis the full analyst-facing result as Markdown text when the Flow produces one. A completed structured-only Flow may omit it.output_refis set once structured output has been captured for the run. Its presence (not its value) is the signal that Get Run Output can be called to read the structured output.erroris only set whenstatusisFAILED.degradedistruewhen one or more tool calls failed even though the Flow finished.failed_sourcesgroups those failures by tool namespace and count.- Fields that are not available are omitted rather than returned as
null. - Returns
404ifrunIddoes not exist, or belongs to a different customer.
Response
OK
⌘I