> ## Documentation Index
> Fetch the complete documentation index at: https://developer.opus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Workflow Details

> Retrieve the complete schema and input requirements for a workflow

Before you can execute a job, you must know what inputs it expects. This endpoint returns the workflow object, including its name, description, blueprint, and the `jobPayloadSchema` that defines all of the workflow's inputs.

By default, the response describes the latest active version of the workflow. To inspect a specific historical version, pass either the `version` number or the `workflowVersionId` UUID as a query parameter.

## Path Parameters

<ParamField path="workflowId" type="string" required>
  The unique identifier of the workflow to retrieve details for
</ParamField>

## Query Parameters

<ParamField query="version" type="number">
  Workflow version number to retrieve. Omit to use the latest active version.
</ParamField>

<ParamField query="workflowVersionId" type="string">
  Specific workflow version UUID. Takes precedence over `version` when both are supplied.
</ParamField>

## Headers

<ParamField header="x-service-key" type="string" required>
  Your API authentication key
</ParamField>

## Response

The `jobPayloadSchema` object defines all workflow inputs, their unique variable names (e.g., `workflow_input_we4tej0ly`), and their data types.

<ResponseField name="jobPayloadSchema" type="object">
  An object containing all workflow input definitions

  <Expandable title="Input Field Properties">
    <ResponseField name="id" type="string">
      Unique identifier for the input field
    </ResponseField>

    <ResponseField name="variable_name" type="string">
      The variable name to use when executing the job
    </ResponseField>

    <ResponseField name="display_name" type="string">
      Human-readable name for the input
    </ResponseField>

    <ResponseField name="type" type="string">
      Data type: `str`, `float`, `bool`, `date`, `file`, `array`, `array_files`, or `object`
    </ResponseField>

    <ResponseField name="is_nullable" type="boolean">
      Whether the input can be null
    </ResponseField>

    <ResponseField name="tags" type="array">
      Additional metadata, such as allowed file types for file inputs
    </ResponseField>
  </Expandable>
</ResponseField>

## Supported Data Types

| Type          | Description        | Example Value                  |
| ------------- | ------------------ | ------------------------------ |
| `str`         | Text string        | `"Hello World"`                |
| `float`       | Numeric value      | `45.8`                         |
| `bool`        | Boolean            | `true` or `false`              |
| `date`        | Date string        | `"2025-11-09"`                 |
| `file`        | Single file URL    | `"https://files.opus.com/..."` |
| `array`       | List of values     | `["item1", "item2"]`           |
| `array_files` | Multiple file URLs | `["url1", "url2"]`             |
| `object`      | Nested object      | `{"key": "value"}`             |

<RequestExample>
  ```bash cURL theme={null}
  # Latest active version
  curl --request GET \
    --url https://operator.opus.com/workflow/{YOUR_WORKFLOW_ID} \
    --header 'x-service-key: {YOUR_SERVICE_KEY}'

  # Pinned to a specific version number
  curl --request GET \
    --url 'https://operator.opus.com/workflow/{YOUR_WORKFLOW_ID}?version=3' \
    --header 'x-service-key: {YOUR_SERVICE_KEY}'

  # Pinned to a specific version UUID
  curl --request GET \
    --url 'https://operator.opus.com/workflow/{YOUR_WORKFLOW_ID}?workflowVersionId={WORKFLOW_VERSION_ID}' \
    --header 'x-service-key: {YOUR_SERVICE_KEY}'
  ```

  ```python Python theme={null}
  import requests

  url = "https://operator.opus.com/workflow/{YOUR_WORKFLOW_ID}"
  headers = {"x-service-key": "{YOUR_SERVICE_KEY}"}

  # Latest active version
  response = requests.get(url, headers=headers)

  # Or pin to a specific version
  # response = requests.get(url, headers=headers, params={"version": 3})
  # response = requests.get(url, headers=headers, params={"workflowVersionId": "{WORKFLOW_VERSION_ID}"})

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  // Latest active version
  const response = await fetch(
    "https://operator.opus.com/workflow/{YOUR_WORKFLOW_ID}",
    {
      method: "GET",
      headers: {
        "x-service-key": "{YOUR_SERVICE_KEY}",
      },
    }
  );

  // Or pin to a specific version
  // const url = new URL("https://operator.opus.com/workflow/{YOUR_WORKFLOW_ID}");
  // url.searchParams.set("version", "3");
  // const response = await fetch(url, { headers: { "x-service-key": "{YOUR_SERVICE_KEY}" } });

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Response theme={null}
  {
    "jobPayloadSchema": {
      "{VARIABLE_NAME_1}": {
        "id": "{INPUT_ID}",
        "variable_name": "{VARIABLE_NAME_1}",
        "display_name": "{DISPLAY_NAME}",
        "type": "str",
        "is_nullable": false
      },
      "{VARIABLE_NAME_2}": {
        "id": "{INPUT_ID}",
        "variable_name": "{VARIABLE_NAME_2}",
        "display_name": "{DISPLAY_NAME}",
        "type": "file",
        "is_nullable": false,
        "tags": [
          {
            "variable_name": "allowed_file_types",
            "value": ["JPEG", "PNG", "JPG", "PDF", "DOCX", "CSV", "XLSX"]
          }
        ]
      }
    }
  }
  ```
</ResponseExample>
