Skip to main content
GET
/
v1
/
workflows
/
{workflow_id}
/
spec
from retab import Retab

client = Retab()

exported = client.workflows.spec.get("wf_abc123")

print(exported.yaml_definition)
import { Retab } from "@retab/node";

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

const exported = await client.workflows.spec.get("wf_abc123");

console.log(exported.yamlDefinition);
package main

import (
	"context"
	"fmt"
	"log"

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

func ptr[T any](v T) *T { return &v }

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

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

	exported, err := client.Workflows.Spec.Get(ctx, "wf_abc123")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(exported.YamlDefinition)
}
require 'retab'

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

exported = client.workflows.spec.get(workflow_id: 'wf_abc123')

puts exported.yaml_definition
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 exported = client.workflows().spec().get("wf_abc123").await?;

    println!("{}", exported.yaml_definition);
    Ok(())
}
<?php
require 'vendor/autoload.php';

use Retab\Client;

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

$result = $client->workflows()->spec()->get('wf_abc123');
print_r($result);
using Retab;
using RetabClient = Retab.Retab;

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

var result = await client.Workflows.Spec.GetAsync("wf_abc123");
Console.WriteLine(result);
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().spec().get("wf_abc123");
    System.out.println(result);
  }
}
curl -X 'GET' \
  'https://api.retab.com/v1/workflows/wf_abc123/spec' \
  -H 'Authorization: Bearer <your-api-key>'
{
  "workflow_id": "wf_abc123",
  "yaml_definition": "apiVersion: workflows.retab.com/v1alpha2\nkind: Workflow\nmetadata:\n  id: wf_abc123\n  name: Invoice Workflow\nspec:\n  blocks:\n    start_document-node:\n      type: start_document\n      label: Input Document\n  edges: []\n"
}
Export the current draft workflow as canonical declarative YAML. Exports use apiVersion: workflows.retab.com/v1alpha2 and include raw explicit handles on every non-synthetic edge.
from retab import Retab

client = Retab()

exported = client.workflows.spec.get("wf_abc123")

print(exported.yaml_definition)
import { Retab } from "@retab/node";

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

const exported = await client.workflows.spec.get("wf_abc123");

console.log(exported.yamlDefinition);
package main

import (
	"context"
	"fmt"
	"log"

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

func ptr[T any](v T) *T { return &v }

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

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

	exported, err := client.Workflows.Spec.Get(ctx, "wf_abc123")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(exported.YamlDefinition)
}
require 'retab'

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

exported = client.workflows.spec.get(workflow_id: 'wf_abc123')

puts exported.yaml_definition
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 exported = client.workflows().spec().get("wf_abc123").await?;

    println!("{}", exported.yaml_definition);
    Ok(())
}
<?php
require 'vendor/autoload.php';

use Retab\Client;

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

$result = $client->workflows()->spec()->get('wf_abc123');
print_r($result);
using Retab;
using RetabClient = Retab.Retab;

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

var result = await client.Workflows.Spec.GetAsync("wf_abc123");
Console.WriteLine(result);
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().spec().get("wf_abc123");
    System.out.println(result);
  }
}
curl -X 'GET' \
  'https://api.retab.com/v1/workflows/wf_abc123/spec' \
  -H 'Authorization: Bearer <your-api-key>'
{
  "workflow_id": "wf_abc123",
  "yaml_definition": "apiVersion: workflows.retab.com/v1alpha2\nkind: Workflow\nmetadata:\n  id: wf_abc123\n  name: Invoice Workflow\nspec:\n  blocks:\n    start_document-node:\n      type: start_document\n      label: Input Document\n  edges: []\n"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workflow_id
string
required

Response

Successful Response

A workflow exported as its YAML definition.

workflow_id
string
required
yaml_definition
string
required