
## Overview
<p align="justify">
This endpoint allows users to retrieve detailed information about a specific workflow within a project by providing both the `project_id` and `workflow_id`. It returns metadata including workflow status, progress, timing details, associated tasks, and cost. Authentication via a bearer token is required.

- Method: `GET`

- URL: `/v0/workflows/{workflow_id}`

- Operation: Get detailed information of a workflow

- Authentication Required: Yes
</p>

## Authorization
<p align="justify">
You need the **api key** which you can get from the **API** tab in **Workspace Settings**. The api key is required in almost all the commands

```json
Authorization: <YOUR_API_KEY>
```
</p>

## Path Parameters
<p align="justify">
The `workflow_id` identifies the exact workflow whose information is to be retrieved.

| Field         | Type   | Required | Description                                                  |
|--------------|--------|----------|--------------------------------------------------------------|
| `workflow_id`  | `string` | Yes      | Unique identifier of the workflow                            |
</p>

## Query Parameters
<p align="justify">
The `project_id` identifies the exact project from which the workflow is to be retrieved.

| Field         | Type   | Required | Description                                                  |
|--------------|--------|----------|--------------------------------------------------------------|
| `workflow_id`  | `string` | Yes      | Unique identifier of the workflow                            |
</p>

## Response

<p align="justify">
A **200 OK** response returns full metadata for a workflow, including execution timestamps, creator, duration, cost, and progress. It also includes task and validation error details, if applicable. This response is useful for monitoring, debugging, or auditing purposes in workflow pipelines.

| Name              | Type       | Description                                                       |
|-------------------|------------|-------------------------------------------------------------------|
| `id`                | `string`     | Unique identifier of the workflow                                |
| `estimated_cost`    | `integer`    | Estimated or actual cost of job execution                        |
| `name`              | `string`     | Display name of the workflow given by user                       |
| `created_by`        | `string`     | ID of the user who created the workflow                          |
| `created_at`        | `string`     | Timestamp when the workflow was originally created               |
| `updated_at`        | `string`     | Timestamp of the last update to the workflow                     |
| `val_errors`        | `object[]`   | List of validation errors encountered                            |
| `project_id`        | `string`     | Unique identifier of the project                                 |


Here is a sample **200** response: 
```json 200
{
  "id": "<string>",
  "estimated_cost": 123,
  "name": "<string>",
  "created_by": "<string>",
  "description": "<string>",
  "spec": [
    123
  ],
  "created_at": "<string>",
  "updated_at": "<string>",
  "val_errors": [
    {
      "from": "<string>",
      "to": "<string>",
      "err": "<string>",
      "reason": "<string>",
      "component_name": "<string>"
    }
  ],
  "project_id": "<string>"
}
```

A **400 Bad Request** response occurs if parameters are malformed or missing. A **403 Forbidden** indicates the user does not have access to the requested project or workflow. The response includes structured error details such as code, message, and optional context for resolving access issues.

```json 400 403
{
  "error": {
    "code": "<string>",
    "details": "<any>",
    "message": "<string>"
  }
}
```
</p>

## How to use the endpoint
<p align="justify">
- **Construct your Request:**  
    Gather the workflow_id and project_id of the workflow you want to inspect.

- **Send the Request:**  
    Make a GET request to `https://api.pixxel.space/v0/workflows/{workflow_id}`. Include your bearer token in the Authorization header.

- **Examine the Response:**  
    On success, parse the workflow metadata to understand execution cost, creation and updation timestamps, and any issues. Handle errors with appropriate fallback and retry mechanisms.
</p>