> ## Documentation Index
> Fetch the complete documentation index at: https://uiform-codex-generated-frontend-snippets.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Diff Workflow Versions

Compare two immutable workflow graph versions.

```python Python theme={null}
from_version_id = "wfv_before"
to_version_id = "wfv_after"
print(from_version_id, to_version_id)
```

```typescript TypeScript theme={null}
const fromWorkflowVersionId = "wfv_before";
const toWorkflowVersionId = "wfv_after";
console.log(fromWorkflowVersionId, toWorkflowVersionId);
```

```go Go theme={null}
fromWorkflowVersionID := "wfv_before"
toWorkflowVersionID := "wfv_after"
_, _ = fromWorkflowVersionID, toWorkflowVersionID
```

```java Java theme={null}
String fromWorkflowVersionId = "wfv_before";
String toWorkflowVersionId = "wfv_after";
System.out.println(fromWorkflowVersionId + " " + toWorkflowVersionId);
```

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


## OpenAPI

````yaml GET /v1/workflows/versions/diff
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/versions/diff:
    get:
      tags:
        - Workflows
        - Workflow Versions
      summary: Diff Workflow Versions
      operationId: diff_workflow_versions
      parameters:
        - in: query
          name: workflow_id
          required: true
          schema:
            type: string
            description: Workflow whose versions to diff
            title: Workflow Id
          description: Workflow whose versions to diff
        - in: query
          name: from_workflow_version_id
          required: true
          schema:
            type: string
            description: Base workflow version ID
            title: From Workflow Version Id
          description: Base workflow version ID
        - in: query
          name: to_workflow_version_id
          required: true
          schema:
            type: string
            description: Target workflow version ID
            title: To Workflow Version Id
          description: Target workflow version ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowGraphVersionDiff'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowGraphVersionDiff:
      properties:
        from_workflow_version_id:
          type: string
          title: From Workflow Version Id
        to_workflow_version_id:
          type: string
          title: To Workflow Version Id
        added_block_ids:
          items:
            type: string
          type: array
          title: Added Block Ids
          default: []
        removed_block_ids:
          items:
            type: string
          type: array
          title: Removed Block Ids
          default: []
        changed_block_ids:
          items:
            type: string
          type: array
          title: Changed Block Ids
          default: []
        added_edge_ids:
          items:
            type: string
          type: array
          title: Added Edge Ids
          default: []
        removed_edge_ids:
          items:
            type: string
          type: array
          title: Removed Edge Ids
          default: []
        changed_edge_ids:
          items:
            type: string
          type: array
          title: Changed Edge Ids
          default: []
      type: object
      required:
        - from_workflow_version_id
        - to_workflow_version_id
      title: WorkflowGraphVersionDiff
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````