curl --request POST \
--url https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dagId": "my_dag",
"runId": "scheduled__2026-05-13T00:00:00+00:00",
"skipCacheRead": true,
"taskId": "my_task",
"tryNumbers": [
1,
2
]
}
'import requests
url = "https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs"
payload = {
"dagId": "my_dag",
"runId": "scheduled__2026-05-13T00:00:00+00:00",
"skipCacheRead": True,
"taskId": "my_task",
"tryNumbers": [1, 2]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dagId: 'my_dag',
runId: 'scheduled__2026-05-13T00:00:00+00:00',
skipCacheRead: true,
taskId: 'my_task',
tryNumbers: [1, 2]
})
};
fetch('https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs', 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.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs",
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([
'dagId' => 'my_dag',
'runId' => 'scheduled__2026-05-13T00:00:00+00:00',
'skipCacheRead' => true,
'taskId' => 'my_task',
'tryNumbers' => [
1,
2
]
]),
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://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs"
payload := strings.NewReader("{\n \"dagId\": \"my_dag\",\n \"runId\": \"scheduled__2026-05-13T00:00:00+00:00\",\n \"skipCacheRead\": true,\n \"taskId\": \"my_task\",\n \"tryNumbers\": [\n 1,\n 2\n ]\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://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dagId\": \"my_dag\",\n \"runId\": \"scheduled__2026-05-13T00:00:00+00:00\",\n \"skipCacheRead\": true,\n \"taskId\": \"my_task\",\n \"tryNumbers\": [\n 1,\n 2\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs")
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 \"dagId\": \"my_dag\",\n \"runId\": \"scheduled__2026-05-13T00:00:00+00:00\",\n \"skipCacheRead\": true,\n \"taskId\": \"my_task\",\n \"tryNumbers\": [\n 1,\n 2\n ]\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2026-05-14T12:34:56Z",
"runId": "7f3b6f5d-2c4e-4f2b-9c1d-1a2b3c4d5e6f",
"status": "pending"
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Start a DAG-failure diagnosis run
Starts an asynchronous AI-powered diagnosis run for a failed DAG run (or specific task within it) and returns a run ID. Use the run ID to poll status and stream events.
curl --request POST \
--url https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dagId": "my_dag",
"runId": "scheduled__2026-05-13T00:00:00+00:00",
"skipCacheRead": true,
"taskId": "my_task",
"tryNumbers": [
1,
2
]
}
'import requests
url = "https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs"
payload = {
"dagId": "my_dag",
"runId": "scheduled__2026-05-13T00:00:00+00:00",
"skipCacheRead": True,
"taskId": "my_task",
"tryNumbers": [1, 2]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dagId: 'my_dag',
runId: 'scheduled__2026-05-13T00:00:00+00:00',
skipCacheRead: true,
taskId: 'my_task',
tryNumbers: [1, 2]
})
};
fetch('https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs', 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.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs",
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([
'dagId' => 'my_dag',
'runId' => 'scheduled__2026-05-13T00:00:00+00:00',
'skipCacheRead' => true,
'taskId' => 'my_task',
'tryNumbers' => [
1,
2
]
]),
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://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs"
payload := strings.NewReader("{\n \"dagId\": \"my_dag\",\n \"runId\": \"scheduled__2026-05-13T00:00:00+00:00\",\n \"skipCacheRead\": true,\n \"taskId\": \"my_task\",\n \"tryNumbers\": [\n 1,\n 2\n ]\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://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dagId\": \"my_dag\",\n \"runId\": \"scheduled__2026-05-13T00:00:00+00:00\",\n \"skipCacheRead\": true,\n \"taskId\": \"my_task\",\n \"tryNumbers\": [\n 1,\n 2\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/labs/v1/organizations/{organizationId}/observability/deployments/{deploymentId}/dag-failure-diagnosis/runs")
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 \"dagId\": \"my_dag\",\n \"runId\": \"scheduled__2026-05-13T00:00:00+00:00\",\n \"skipCacheRead\": true,\n \"taskId\": \"my_task\",\n \"tryNumbers\": [\n 1,\n 2\n ]\n}"
response = http.request(request)
puts response.read_body{
"createdAt": "2026-05-14T12:34:56Z",
"runId": "7f3b6f5d-2c4e-4f2b-9c1d-1a2b3c4d5e6f",
"status": "pending"
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the Organization to which the Deployment belongs.
The Deployment's ID.
Query Parameters
Skip DB session dedup + Redis cache and force a fresh diagnosis run
Body
The request body for starting a DAG-failure diagnosis run.
The ID of the DAG that failed.
"my_dag"
The ID of the DAG run that failed.
"scheduled__2026-05-13T00:00:00+00:00"
If true, bypass any previously cached diagnosis for this DAG/run/task and force a fresh run.
The ID of the task that failed. Optional; if omitted, the agent diagnoses the run as a whole.
"my_task"
The specific task try numbers to diagnose. Optional.
[1, 2]
Response
OK
The RFC3339 timestamp when the run was created.
"2026-05-14T12:34:56Z"
The unique identifier of the diagnosis run. Use this to poll status and stream events.
"7f3b6f5d-2c4e-4f2b-9c1d-1a2b3c4d5e6f"
The current status of the diagnosis run.
pending, running, completed, failed, timed_out "pending"
Was this page helpful?