logo
การพัฒนา
ค้นหา
Query Workflow Result

Query Workflow Result

Use workflowRunId to query the workflow run result.

Method

POST

URL

https://api-${endpoint}.gptbots.ai/v1/workflow/query/result

Authentication

For details, refer to the authentication method in the API Overview.

Request

Example

curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/workflow/query/result' \ -H 'Authorization: Bearer ${API Key}' \ -H 'Content-Type: application/json' \ -d '{ "workflowRunId": "xxxxxxxx" }'
                      
                      curl -X POST 'https://api-${endpoint}.gptbots.ai/v1/workflow/query/result' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
    "workflowRunId": "xxxxxxxx"
}'

                    
บล็อกโค้ดนี้ในหน้าต่างลอย

Headers

Field Type Required Description
Authorization Bearer ${API Key} Y Validate calls using Authorization: Bearer ${API Key}; obtain the key on the API keys page as the API Key.
Content-Type application/json Y Data type, fixed value is application/json.

Body

Field Type Required Description
workflowRunId String Y Workflow run ID.

Response

Example

{ "workflowId": "xxxxxxxx", "workflowName": "todayNews", "workflowVersion": "1.0.1", "workflowRunId": "xxxxxxxx", "input": { "topic": "News" }, "output": { "news": [ { "summary": "Fatal crash shuts down major highway in Haleiwa. According to Emergency Medical Services, paramedics responded to the scene of the crash Wednesday morning.", "media": "Hawaii News Now", "title": "Hawaii News Now - Breaking News, Latest News, Weather & Traffic" }, { "summary": "Hawaii Crime: Man, 65, critically injured in Waikīkī assault. Jamil Hart found guilty in Mililani murder case. HPD busts illegal gambling room in Nanakuli.", "media": "KHON2", "title": "KHON2: Hawaii News, Weather, Sports, Breaking News & Live" } ] }, "workflowExecutionTime": 8347, "status": "SUCCEED", "totalCost": 0.6928, "totalTokens": 1745, "startTime": 1758765323024, "endTime": 1758765331373 }
                      
                      {
    "workflowId": "xxxxxxxx",
    "workflowName": "todayNews",
    "workflowVersion": "1.0.1",
    "workflowRunId": "xxxxxxxx",
    "input": {
        "topic": "News"
    },
    "output": {
        "news": [
            {
                "summary": "Fatal crash shuts down major highway in Haleiwa. According to Emergency Medical Services, paramedics responded to the scene of the crash Wednesday morning.",
                "media": "Hawaii News Now",
                "title": "Hawaii News Now - Breaking News, Latest News, Weather & Traffic"
            },
            {
                "summary": "Hawaii Crime: Man, 65, critically injured in Waikīkī assault. Jamil Hart found guilty in Mililani murder case. HPD busts illegal gambling room in Nanakuli.",
                "media": "KHON2",
                "title": "KHON2: Hawaii News, Weather, Sports, Breaking News & Live"
            }
        ]
    },
    "workflowExecutionTime": 8347,
    "status": "SUCCEED",
    "totalCost": 0.6928,
    "totalTokens": 1745,
    "startTime": 1758765323024,
    "endTime": 1758765331373
}

                    
บล็อกโค้ดนี้ในหน้าต่างลอย

Body

Field Type Description
workflowId String Workflow ID.
workflowName String Workflow name.
workflowVersion String Workflow version number.
workflowRunId String Workflow run ID, used to uniquely identify this execution.
input Object Input for the "start" node, identical to the input in the request.
output Object Output for the "end" node, containing the results of the workflow execution.
workflowExecutionTime Number Time spent executing the workflow, in milliseconds.
status String Workflow invocation status, possible values include:
- SUCCEED: success
- FAILED: failure
- PENDING: in queue
- RUNNING: running
totalCost Number Total cost credits for this run.
totalTokens Number Total tokens consumed for this run.
startTime Number Start timestamp, in milliseconds.
endTime Number End timestamp, in milliseconds.