Skip to main content
GET
/
workflows
/
{workflow_id_or_name}
Get Agent
curl --request GET \
  --url https://api.promptlayer.com/workflows/{workflow_id_or_name} \
  --header 'X-API-KEY: <x-api-key>'
{
  "success": true,
  "workflow_id": 123,
  "workflow_name": "<string>",
  "version": 123,
  "workflow_version_id": 123,
  "nodes": [
    {
      "id": "<string>",
      "name": "<string>",
      "node_type": "<string>",
      "is_output_node": true,
      "configuration": {},
      "dependencies": [
        "<string>"
      ],
      "workflow_version_id": 123
    }
  ],
  "edges": [
    {
      "id": "<string>",
      "source_node_name": "<string>",
      "target_node_name": "<string>",
      "is_and": true,
      "conditionals": [
        {}
      ]
    }
  ],
  "commit_message": "<string>",
  "required_input_variables": {},
  "release_labels": [
    "<string>"
  ],
  "created_at": "<string>"
}
Retrieve an agent (workflow) by ID or name, including full node configuration, edges, and version details. By default, the latest version is returned. Optionally specify version (version number) or label (release label like “prod”) to retrieve a specific version. These parameters are mutually exclusive. The response includes the complete node definitions with their configuration and dependencies, making it suitable for inspecting or replicating an agent’s setup. Please note that this feature was previously called “Workflows” and is now called “Agents”. Some references to “Workflows” remain in our SDK and will be updated before the feature exits beta.

Examples

Get the Latest Version

import requests

response = requests.get(
    "https://api.promptlayer.com/workflows/my-agent",
    headers={"X-API-KEY": "your-api-key"},
)

Get a Specific Version by Number

response = requests.get(
    "https://api.promptlayer.com/workflows/my-agent",
    headers={"X-API-KEY": "your-api-key"},
    params={"version": 3},
)

Get the Production Version by Label

response = requests.get(
    "https://api.promptlayer.com/workflows/my-agent",
    headers={"X-API-KEY": "your-api-key"},
    params={"label": "prod"},
)

Headers

X-API-KEY
string
required

Your API key for authentication.

Path Parameters

workflow_id_or_name
string
required

The agent ID or name.

Query Parameters

version
integer

Specific version number to retrieve. Mutually exclusive with label.

label
string

Release label name to retrieve (e.g. 'prod', 'staging'). Mutually exclusive with version.

Response

Agent retrieved successfully

success
boolean
required
Example:

true

workflow_id
integer
required

Unique identifier for the agent

workflow_name
string
required

Name of the agent

version
integer
required

Version number

workflow_version_id
integer
required

Unique identifier for this version

nodes
object[]
required

Full node definitions including configuration and dependencies

edges
object[]
required

Connections between nodes with optional conditionals

commit_message
string | null

Commit message for this version

required_input_variables
object

Input variable names mapped to their types

release_labels
string[]

Release labels attached to this version

created_at
string | null

ISO 8601 timestamp of when this version was created