Skip to main content
GET
/
v1
/
workspaces
/
{workspace_id}
/
workflows
/
{workflow_id}
/
runs
/
{run_id}
Get workflow run
curl --request GET \
  --url https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_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://api.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$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.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id}"

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

req.Header.Add("Authorization", "Bearer <token>")

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.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/workflows/{workflow_id}/runs/{run_id}")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "poll_interval_seconds": 123,
  "steps": [],
  "estimated_price_creative_units": 123,
  "completed_at": "2023-11-07T05:31:56Z",
  "actual_price_creative_units": 123,
  "outputs": [
    {
      "object_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "url": "<string>",
      "content_type": "<string>",
      "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "preview_url": "<string>",
      "width": 123,
      "height": 123,
      "duration_seconds": 123,
      "file_size_bytes": 123
    }
  ],
  "error": "<string>",
  "error_code": "<string>"
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Authorizations

Authorization
string
header
required

Personal Access Token or OAuth2 JWT. Create a PAT at app.layer.ai → Settings → Personal Access Tokens.

Path Parameters

workspace_id
string<uuid>
required
workflow_id
string<uuid>
required
run_id
string<uuid>
required

Response

Successful Response

run_id
string<uuid>
required

Unique identifier for this workflow run.

status
enum<string>
required

Current status: pending, running, success, failure, or cancelled.

Available options:
pending,
running,
success,
failure,
cancelled
poll_interval_seconds
integer | null

Suggested polling interval in seconds. Present while PENDING or RUNNING.

steps
GetWorkflowRunStep · object[]

Status of each step composing the workflow run.

estimated_price_creative_units
number | null

Estimated Creative Units price. Present when available.

completed_at
string<date-time> | null

Completion timestamp. Present only on SUCCESS.

actual_price_creative_units
number | null

Actual Creative Units price charged. Present only on SUCCESS.

outputs
WorkflowRunAsset · object[] | null

Generated assets. Present only on SUCCESS.

error
string | null

Error message. Present only on FAILURE.

error_code
string | null

Machine-readable error code. Present only on FAILURE.