Queries the details of a directed acyclic graph (DAG) based on the DAG ID. You can call the GetDag operation to query the details of the DAG for a manually triggered workflow, a manually triggered node, or a data backfill instance. However, you cannot query the details of the DAG for an auto triggered node or an auto triggered workflow.

Supported DAG types:

  • MANUAL: the DAG for a manually triggered workflow
  • SMOKE_TEST: the DAG for a smoke testing workflow
  • SUPPLY_DATA: the DAG for a data backfill instance
  • BUSINESS_PROCESS_DAG: the DAG for a one-time workflow

Supported DAG states:

  • CREATED: The DAG is created.
  • RUNNING: The DAG is running.
  • FAILURE: The DAG fails to run.
  • SUCCESS: The DAG successfully runs.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetDag

The operation that you want to perform. Set the value to GetDag.

RegionId String Yes cn-shanghai

The ID of the region where the workspace resides.

DagId Long Yes 123141452344525

The ID of the DAG. You can set this parameter to the value of the DagId parameter returned by the CreateDagComplement, CreateTest, or CreateManualDag operation.

ProjectEnv String Yes PROD

The environment type. Valid values: PROD and DEV. The value PROD indicates the production environment. The value DEV indicates the development environment.

Response parameters

Parameter Type Example Description
HttpStatusCode Integer 200

The HTTP status code returned.

RequestId String 7782a299-b291-4fee-8424-cf8058efa8e8

The ID of the request. You can use the ID to locate logs and troubleshoot issues.

ErrorMessage String The connection does not exist.

The error message returned.

ErrorCode String Invalid.Tenant.ConnectionNotExists

The error code returned.

Success Boolean true

Indicates whether the request is successful.

Data Object

The details of the DAG.

Type String MANUAL_FLOW

The type of the DAG. Valid values: MANUAL, SMOKE_TEST, SUPPLY_DATA, and BUSINESS_PROCESS_DAG.

Status String FAILURE

The status of the DAG. Valid values: CREATED, RUNNING, FAILURE, and SUCCESS.

FinishTime Long 1605052800000

The time at which the DAG finished running. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

CreateTime Long 1605052800000

The time at which the DAG was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

ProjectId Long 112345

The ID of the workspace.

DagId Long 351249682

The ID of the DAG.

Gmtdate Long 1605052800000

The time at which the DAG was scheduled to run.

StartTime Long 1605052800000

The time at which the DAG started to run.

CreateUser String 1736629400048545

The user who created the DAG.

Bizdate Long 1605052800000

The data timestamp.

Name String test_dag

The name of the DAG.

ModifyTime Long 1605052800000

The time at which the DAG was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

OpSeq Long 123

The sequence number of an operation.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetDag
&DagId=123141452344525
&ProjectEnv=PROD
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetDagResponse>
    <HttpStatusCode>200</HttpStatusCode>
    <RequestId>7782a299-b291-4fee-8424-cf8058efa8e8</RequestId>
    <ErrorMessage>The connection does not exist.</ErrorMessage>
    <ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
    <Success>true</Success>
    <Data>
        <Type>MANUAL_FLOW</Type>
        <Status>FAILURE</Status>
        <FinishTime>1605052800000</FinishTime>
        <CreateTime>1605052800000</CreateTime>
        <ProjectId>112345</ProjectId>
        <DagId>351249682</DagId>
        <Gmtdate>1605052800000</Gmtdate>
        <StartTime>1605052800000</StartTime>
        <CreateUser>1736629400048545</CreateUser>
        <Bizdate>1605052800000</Bizdate>
        <Name>test_dag</Name>
        <ModifyTime>1605052800000</ModifyTime>
        <OpSeq>123</OpSeq>
    </Data>
</GetDagResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HttpStatusCode" : 200,
  "RequestId" : "7782a299-b291-4fee-8424-cf8058efa8e8",
  "ErrorMessage" : "The connection does not exist.",
  "ErrorCode" : "Invalid.Tenant.ConnectionNotExists",
  "Success" : true,
  "Data" : {
    "Type" : "MANUAL_FLOW",
    "Status" : "FAILURE",
    "FinishTime" : 1605052800000,
    "CreateTime" : 1605052800000,
    "ProjectId" : 112345,
    "DagId" : 351249682,
    "Gmtdate" : 1605052800000,
    "StartTime" : 1605052800000,
    "CreateUser" : 1736629400048545,
    "Bizdate" : 1605052800000,
    "Name" : "test_dag",
    "ModifyTime" : 1605052800000,
    "OpSeq" : 123
  }
}

Error codes

For a list of error codes, visit the API Error Center.