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

# Get Workflow Version

Fetch one immutable workflow graph version.

```python Python theme={null}
from retab import Retab

client = Retab()

version = client.workflows.get_version(
    workflow_version_id="wfv_abc123",
    workflow_id="wf_abc123",
)
print(version)
```

```typescript TypeScript theme={null}
import { Retab } from "@retab/node";

const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

const version = await client.workflows.get_version("wfv_abc123", {
  workflowId: "wf_abc123",
});
console.log(version);
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"
	"log"

	retab "github.com/retab-dev/retab/clients/go"
)

func main() {
	ctx := context.Background()

	client, err := retab.NewClient("")
	if err != nil {
		log.Fatal(err)
	}

	version, err := client.Workflows.GetVersion(ctx, "wfv_abc123", &retab.WorkflowsGetVersionParams{
		WorkflowID: "wf_abc123",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(*version)
}
```

```ruby Ruby theme={null}
require 'retab'

client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

version = client.workflows.get_version(
  workflow_version_id: 'wfv_abc123',
  workflow_id: 'wf_abc123',
)
puts version
```

```rust Rust theme={null}
use retab::Retab;
use retab::resources::workflows::GetVersionParams;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Retab::new(std::env::var("RETAB_API_KEY")?);

    let version = client
        .workflows()
        .get_version("wfv_abc123", GetVersionParams::new("wf_abc123"))
        .await?;
    println!("{:?}", version);
    Ok(())
}
```

```php PHP theme={null}
<?php
require 'vendor/autoload.php';

use Retab\Client;

$client = new Client(apiKey: getenv('RETAB_API_KEY'));

$version = $client->workflows()->getVersion(
    workflowVersionId: 'wfv_abc123',
    workflowId: 'wf_abc123',
);
print_r($version);
```

```csharp C# theme={null}
using Retab;
using RetabClient = Retab.Retab;

var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
var client = new RetabClient(apiKey);

var version = await client.Workflows.GetVersionAsync("wfv_abc123", new WorkflowsGetVersionOptions
{
    WorkflowId = "wf_abc123",
});
Console.WriteLine(version);
```

```java Java theme={null}
import com.retab.RetabClient;

public final class Example {
  public static void main(String[] args) throws Exception {
    RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

    var version = client.workflows().getVersion("wfv_abc123", "wf_abc123");
    System.out.println(version);
  }
}
```

```bash cURL theme={null}
curl "https://api.retab.com/v1/workflows/versions/wfv_abc123?workflow_id=wf_abc123" \
  -H "Authorization: Bearer $RETAB_API_KEY"
```


## OpenAPI

````yaml GET /v1/workflows/versions/{workflow_version_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/versions/{workflow_version_id}:
    get:
      tags:
        - Workflows
        - Workflow Versions
      summary: Get Workflow Version
      operationId: get_workflow_version
      parameters:
        - in: path
          name: workflow_version_id
          required: true
          schema:
            type: string
            title: Workflow Version Id
        - in: query
          name: workflow_id
          required: true
          schema:
            type: string
            description: >-
              Workflow that owns the version. Workflow version ids are
              content-addressed by executable spec, so workflow_id disambiguates
              identical specs reused across workflows.
            title: Workflow Id
          description: >-
            Workflow that owns the version. Workflow version ids are
            content-addressed by executable spec, so workflow_id disambiguates
            identical specs reused across workflows.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraphVersion'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowGraphVersion:
      properties:
        id:
          type: string
          title: Id
          description: Public content-addressed workflow version ID
        workflow_id:
          type: string
          title: Workflow Id
        blocks:
          items:
            $ref: '#/components/schemas/WorkflowConfigBlock'
          type: array
          title: Blocks
          default: []
        edges:
          items:
            $ref: '#/components/schemas/WorkflowConfigEdge'
          type: array
          title: Edges
          default: []
        block_version_ids:
          items:
            type: string
          type: array
          title: Block Version Ids
          default: []
        edge_version_ids:
          items:
            type: string
          type: array
          title: Edge Version Ids
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - created_at
        - id
        - workflow_id
      title: WorkflowGraphVersion
      description: Public workflow version resource without tenant fields.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    WorkflowConfigBlock:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          enum:
            - start_document
            - start_json
            - note
            - parse
            - edit
            - extract
            - split
            - classifier
            - conditional
            - api_call
            - function
            - while_loop
            - for_each
            - merge_dicts
            - while_loop_sentinel_start
            - while_loop_sentinel_end
            - for_each_sentinel_start
            - for_each_sentinel_end
          title: Type
        position:
          $ref: '#/components/schemas/WorkflowBlockPosition'
        label:
          type: string
          title: Label
        config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config
          description: Block-specific configuration
        resolved_schemas:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Resolved Schemas
          description: >-
            Derived schema transport sidecar for UI/runtime consumers. Not
            authored config.
        width:
          anyOf:
            - type: number
            - type: 'null'
          title: Width
          description: Block width for resizable blocks
        height:
          anyOf:
            - type: number
            - type: 'null'
          title: Height
          description: Block height for resizable blocks
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
          description: ID of parent container block (while_loop, for_each)
      type: object
      required:
        - label
        - position
        - type
      title: WorkflowConfigBlock
    WorkflowConfigEdge:
      properties:
        id:
          type: string
          title: Id
        source:
          type: string
          title: Source
          description: ID of the source block
        target:
          type: string
          title: Target
          description: ID of the target block
        source_handle:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Handle
        target_handle:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Handle
        animated:
          type: boolean
          title: Animated
          default: true
      type: object
      required:
        - source
        - target
      title: WorkflowConfigEdge
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          default: null
        ctx:
          type: object
          title: Context
          default: {}
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    WorkflowBlockPosition:
      properties:
        x:
          type: number
          title: X
        'y':
          type: number
          title: 'Y'
      type: object
      required:
        - x
        - 'y'
      title: WorkflowBlockPosition
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.