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

# Get Workflow

> Retrieves a workflow with its draft version, all nodes, and all edges.

Retrieves a workflow with its draft version, all nodes, and all edges. This gives you the complete workflow structure.

## Usage

<CodeGroup>
  ```bash cURL theme={null}
  curl https://app.splox.io/api/v1/workflows/019c3221-29d7-70e1-aa1e-dee02589289b \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={null}
  from splox import SploxClient

  client = SploxClient(api_key="YOUR_API_KEY")
  wf = client.workflows.get("019c3221-29d7-70e1-aa1e-dee02589289b")
  print(wf.workflow.id, wf.workflow_version.name)
  print(f"{len(wf.nodes)} nodes, {len(wf.edges)} edges")
  ```

  ```typescript Node.js theme={null}
  import Splox from "splox";

  const client = new Splox("YOUR_API_KEY");
  const wf = await client.workflows.get("019c3221-29d7-70e1-aa1e-dee02589289b");
  console.log(wf.workflow.id, wf.workflow_version.name);
  console.log(`${wf.nodes.length} nodes, ${wf.edges.length} edges`);
  ```

  ```go Go theme={null}
  client := splox.NewClient("YOUR_API_KEY")
  wf, err := client.Workflows.Get(ctx, "019c3221-29d7-70e1-aa1e-dee02589289b")
  fmt.Println(wf.Workflow.ID, wf.WorkflowVersion.Name)
  fmt.Printf("%d nodes, %d edges\n", len(wf.Nodes), len(wf.Edges))
  ```
</CodeGroup>

## Path Parameters

| Parameter | Type          | Description |
| --------- | ------------- | ----------- |
| `id`      | string (uuid) | Workflow ID |

## Response

```json theme={null}
{
  "workflow": {
    "id": "019c3221-29d7-70e1-aa1e-dee02589289b",
    "user_id": "0199d001-c45d-9e0f-3456-789012cdef01",
    "latest_version": {
      "id": "019c3221-29da-7d08-93fa-c48dbaa8b1db",
      "workflow_id": "019c3221-29d7-70e1-aa1e-dee02589289b",
      "version_number": 1,
      "name": "My Workflow",
      "status": "draft",
      "created_at": "2025-10-22T10:00:00Z",
      "updated_at": "2025-10-22T10:00:00Z"
    },
    "created_at": "2025-10-22T10:00:00Z",
    "updated_at": "2025-10-22T10:00:00Z"
  },
  "workflow_version": {
    "id": "019c3221-29da-7d08-93fa-c48dbaa8b1db",
    "workflow_id": "019c3221-29d7-70e1-aa1e-dee02589289b",
    "version_number": 1,
    "name": "My Workflow",
    "status": "draft",
    "created_at": "2025-10-22T10:00:00Z",
    "updated_at": "2025-10-22T10:00:00Z"
  },
  "nodes": [
    {
      "id": "019c3221-29dc-7735-a4e3-b42ebb1a0cf1",
      "workflow_version_id": "019c3221-29da-7d08-93fa-c48dbaa8b1db",
      "node_type": "start",
      "label": "Basic Agent",
      "pos_x": 100.0,
      "pos_y": 200.0,
      "data": {},
      "created_at": "2025-10-22T10:00:00Z",
      "updated_at": "2025-10-22T10:00:00Z"
    },
    {
      "id": "019c3221-29dc-7735-a4e3-b42ebb1a0cf2",
      "workflow_version_id": "019c3221-29da-7d08-93fa-c48dbaa8b1db",
      "node_type": "agent",
      "label": "Agent",
      "pos_x": 400.0,
      "pos_y": 200.0,
      "data": {},
      "created_at": "2025-10-22T10:00:00Z",
      "updated_at": "2025-10-22T10:00:00Z"
    }
  ],
  "edges": [
    {
      "id": "019c3221-29dd-1234-a4e3-b42ebb1a0cf3",
      "workflow_version_id": "019c3221-29da-7d08-93fa-c48dbaa8b1db",
      "source": "019c3221-29dc-7735-a4e3-b42ebb1a0cf1",
      "target": "019c3221-29dc-7735-a4e3-b42ebb1a0cf2",
      "edge_type": "condition",
      "created_at": "2025-10-22T10:00:00Z",
      "updated_at": "2025-10-22T10:00:00Z"
    }
  ]
}
```

### Node Types

| Type     | Description                                       |
| -------- | ------------------------------------------------- |
| `start`  | Entry node — entry point for workflow execution   |
| `agent`  | AI Agent node — processes input with an LLM       |
| `tool`   | Tool node — executes an external tool or function |
| `switch` | Switch node — conditional branching               |
| `merge`  | Merge node — combines parallel branches           |
| `end`    | End node — terminates the workflow                |

### Edge Types

| Type        | Description                                     |
| ----------- | ----------------------------------------------- |
| `condition` | Conditional edge — follows based on a condition |
| `parallel`  | Parallel edge — executes branches concurrently  |
| `tool`      | Tool edge — connects agent to tool nodes        |
| `error`     | Error edge — followed when a node fails         |

## Notes

<Info>
  **Authentication required:** The authenticated user must own the workflow.
</Info>

<Info>
  The `workflow_version` at the top level is the **draft** version (for editing). The `latest_version` nested inside `workflow` is the latest by version number and may differ if a version has been published.
</Info>


## OpenAPI

````yaml GET /workflows/{id}
openapi: 3.1.0
info:
  title: Splox API
  description: >-
    Run workflows, manage chats, receive events, and monitor execution via the
    Splox API
  version: 1.0.0
  contact:
    name: Splox Support
    email: support@splox.io
    url: https://community.splox.io
servers:
  - url: https://app.splox.io/api/v1
    description: Production API
security: []
tags:
  - name: MCP
    description: Discover MCP servers, manage connections, and execute MCP tools
  - name: Workflows
    description: List, get, and inspect workflows, versions, and nodes
  - name: Workflow Requests
    description: Run workflows, monitor execution, and retrieve results
  - name: Events
    description: Receive external events via Event Hub webhooks
  - name: Chats
    description: Manage chat sessions for workflow interactions
paths:
  /workflows/{id}:
    get:
      tags:
        - Workflows
      summary: Get Workflow
      description: Retrieves a workflow with its draft version, all nodes, and all edges.
      operationId: getWorkflow
      parameters:
        - name: id
          in: path
          required: true
          description: Workflow ID
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Workflow retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowFull'
        '404':
          description: Workflow not found
      security:
        - bearerAuth: []
components:
  schemas:
    WorkflowFull:
      type: object
      description: Complete workflow with version, nodes, and edges
      properties:
        workflow:
          $ref: '#/components/schemas/Workflow'
        workflow_version:
          $ref: '#/components/schemas/WorkflowVersion'
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node'
        edges:
          type: array
          items:
            $ref: '#/components/schemas/Edge'
      required:
        - workflow
        - workflow_version
        - nodes
        - edges
    Workflow:
      type: object
      description: Represents a user's workflow
      properties:
        id:
          type: string
          format: uuid
        user_id:
          type: string
          format: uuid
        latest_version:
          $ref: '#/components/schemas/WorkflowVersion'
        is_public:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - user_id
        - created_at
        - updated_at
    WorkflowVersion:
      type: object
      description: Represents a specific version of a workflow
      properties:
        id:
          type: string
          format: uuid
        workflow_id:
          type: string
          format: uuid
        version_number:
          type: integer
        name:
          type: string
        description:
          type: string
        metadata:
          type: object
          additionalProperties: true
        status:
          type: string
          enum:
            - draft
            - published
            - archived
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - workflow_id
        - version_number
        - name
        - status
    Node:
      type: object
      description: Represents a node in a workflow
      properties:
        id:
          type: string
          format: uuid
        workflow_version_id:
          type: string
          format: uuid
        node_type:
          type: string
          enum:
            - start
            - end
            - agent
            - tool
            - switch
            - merge
            - stop
            - template
            - add_memory
            - delete_memory
            - get_memory_data
        label:
          type: string
        pos_x:
          type: number
        pos_y:
          type: number
        parent_id:
          type: string
          format: uuid
          nullable: true
        extent:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          description: Node-specific configuration data
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - workflow_version_id
        - node_type
        - label
    Edge:
      type: object
      description: Represents an edge (connection) between nodes
      properties:
        id:
          type: string
          format: uuid
        workflow_version_id:
          type: string
          format: uuid
        source:
          type: string
          format: uuid
          description: Source node ID
        target:
          type: string
          format: uuid
          description: Target node ID
        edge_type:
          type: string
          enum:
            - condition
            - parallel
            - tool
            - error
        source_handle:
          type: string
          nullable: true
        data:
          type: object
          additionalProperties: true
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - workflow_version_id
        - source
        - target
        - edge_type
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token generated from your Splox account settings. Create tokens at
        https://app.splox.io/account?tab=settings

````