Skip to main content
GET
/
api
/
v1
/
workflows
/
{workflow_id}
/
runs
/
{execution_id}
Get Execution Status
curl --request GET \
  --url https://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}
import requests

url = "https://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}', 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://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://modelslab.com/api/v1/workflows/{workflow_id}/runs/{execution_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body

Path Parameters

workflow_id
string
required
The workflow UUID
execution_id
integer
required
The execution ID

Response (Pending/Running)

{
  "status": "success",
  "execution": {
    "id": 12345,
    "workflow_id": "uuid-string",
    "status": "running",
    "started_at": "2024-01-15T10:30:00Z",
    "completed_at": null,
    "execution_time": null
  },
  "steps": [
    {
      "name": "Text to Image",
      "status": "completed",
      "started_at": "2024-01-15T10:30:00Z",
      "completed_at": "2024-01-15T10:30:05Z"
    },
    {
      "name": "Image Upscaler",
      "status": "running",
      "started_at": "2024-01-15T10:30:05Z",
      "completed_at": null
    }
  ]
}

Response (Completed)

{
  "status": "success",
  "execution": {
    "id": 12345,
    "workflow_id": "uuid-string",
    "status": "completed",
    "started_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:30:15Z",
    "execution_time": 15.234
  },
  "output": {
    "output": ["https://cdn.modelslab.com/generated/image1.png"],
    "proxy_links": ["https://cdn.modelslab.com/proxy/image1.png"],
    "status": "success"
  },
  "steps": [
    {
      "name": "Text to Image",
      "status": "completed",
      "started_at": "2024-01-15T10:30:00Z",
      "completed_at": "2024-01-15T10:30:05Z"
    },
    {
      "name": "Image Upscaler",
      "status": "completed",
      "started_at": "2024-01-15T10:30:05Z",
      "completed_at": "2024-01-15T10:30:15Z"
    }
  ]
}

Response (Failed)

{
  "status": "success",
  "execution": {
    "id": 12345,
    "workflow_id": "uuid-string",
    "status": "failed",
    "started_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:30:05Z",
    "execution_time": 5.123
  },
  "error": "Image generation failed: Invalid prompt",
  "steps": [
    {
      "name": "Text to Image",
      "status": "failed",
      "started_at": "2024-01-15T10:30:00Z",
      "completed_at": "2024-01-15T10:30:05Z"
    }
  ]
}

Execution Statuses

StatusDescription
pendingExecution is queued
runningExecution is in progress
completedExecution finished successfully
failedExecution encountered an error
cancelledExecution was cancelled by the user