> ## 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 Edge

> Get a single edge by ID.

Get a single edge by ID.

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

  client = Retab()

  edge = client.workflows.edges.get(
      "edge-1",
  )

  print(f"{edge.source_block}/{edge.source_handle} -> {edge.target_block}/{edge.target_handle}")
  ```

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

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

  const edge = await client.workflows.edges.get("edge-1");

  console.log(
    `${edge.sourceBlock}/${edge.sourceHandle} -> ${edge.targetBlock}/${edge.targetHandle}`,
  );
  ```

  ```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)
  	}

  	edge, err := client.Workflows.Edges.Get(ctx, "edge-1", nil)
  	if err != nil {
  		log.Fatal(err)
  	}

  	fmt.Printf("%s/%v -> %s/%v\n", edge.SourceBlock, edge.SourceHandle, edge.TargetBlock, edge.TargetHandle)
  }
  ```

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

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

  edge = client.workflows.edges.get(edge_id: 'edge-1')

  puts "#{edge.source_block}/#{edge.source_handle} -> #{edge.target_block}/#{edge.target_handle}"
  ```

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

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

      let edge = client
          .workflows()
          .edges()
          .get("edge-1", Default::default())
          .await?;

      println!(
          "{}/{} -> {}/{}",
          edge.source_block,
          edge.source_handle.as_deref().unwrap_or(""),
          edge.target_block,
          edge.target_handle.as_deref().unwrap_or(""),
      );
      Ok(())
  }
  ```

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

  use Retab\Client;

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

  $result = $client->workflows()->edges()->get(
      edgeId: 'edge_start_extract',
  );
  print_r($result);
  ```

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

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

  var result = await client.Workflows.Edges.GetAsync("edge_start_extract");
  Console.WriteLine(result);
  ```

  ```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 result = client.workflows().edges().get("edge_abc123");
      System.out.println(result);
    }
  }
  ```

  ```curl cURL theme={null}
  curl -X 'GET' \
    'https://api.retab.com/v1/workflows/edges/edge-1' \
    -H 'Authorization: Bearer <your-api-key>'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "edge-1",
    "workflow_id": "wf_abc123xyz",
    "source_block": "start-1",
    "target_block": "extract-1",
    "source_handle": "output-file-0",
    "target_handle": "input-file-0",
    "updated_at": "2026-04-30T17:00:00Z"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Edge not found"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/workflows/edges/{edge_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/edges/{edge_id}:
    get:
      tags:
        - Workflows
        - Workflow Edges
      summary: Get Edge
      description: Get a single edge by ID.
      operationId: get_edge
      parameters:
        - in: path
          name: edge_id
          required: true
          schema:
            type: string
            title: Edge Id
        - in: query
          name: workflow_id
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Workflow Id
          required: false
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowEdge'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowEdge:
      properties:
        id:
          type: string
          title: Id
        workflow_id:
          type: string
          title: Workflow Id
          description: Foreign key to workflow
        source_block:
          type: string
          title: Source Block
          description: ID of the source block
        target_block:
          type: string
          title: Target Block
          description: ID of the target block
        source_handle:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Handle
          description: Output handle on source block
        target_handle:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Handle
          description: Input handle on target block
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - source_block
        - target_block
        - updated_at
        - workflow_id
      title: WorkflowEdge
      description: Public live workflow edge object.
    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

````