from retab import Retab
client = Retab()
blocks = client.workflows.blocks.list("wf_abc123xyz")
for block in blocks.data:
print(f"{block.id} ({block.type}): {block.label}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const blocks = await client.workflows.blocks.list({ workflowId: "wf_abc123xyz" });
for (const block of blocks.data) {
console.log(`${block.id} (${block.type}): ${block.label}`);
}
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)
}
blocks, err := client.Workflows.Blocks.List(ctx, &retab.WorkflowBlocksListParams{
WorkflowID: "wf_abc123xyz",
})
if err != nil {
log.Fatal(err)
}
for _, block := range blocks.Data {
fmt.Printf("%s (%s): %v\n", block.ID, block.Type, block.Label)
}
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
blocks = client.workflows.blocks.list(workflow_id: 'wf_abc123xyz')
blocks.data.each do |block|
puts "#{block.id} (#{block.type}): #{block.label}"
end
use retab::resources::workflow_blocks::ListParams;
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 blocks = client
.workflows().blocks()
.list(ListParams::new("wf_abc123xyz"))
.await?;
for block in &blocks.data {
println!(
"{} ({}): {}",
block.id,
block.type_,
block.label.as_deref().unwrap_or("")
);
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->blocks()->list(
workflowId: '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.Blocks.ListAsync(new WorkflowBlocksListOptions());
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().blocks().list("wf_abc123", null, null, 10L);
System.out.println(result);
}
}
curl -X 'GET' \
'https://api.retab.com/v1/workflows/blocks?workflow_id=wf_abc123xyz' \
-H 'Authorization: Bearer <your-api-key>'
{
"data": [
{
"id": "start-1",
"workflow_id": "wf_abc123xyz",
"type": "start_document",
"label": "Invoice Input",
"position_x": 0,
"position_y": 0,
"width": 240,
"height": 120,
"config": null,
"parent_id": null,
"updated_at": "2026-04-30T17:00:00Z"
},
{
"id": "extract-1",
"workflow_id": "wf_abc123xyz",
"type": "extract",
"label": "Extract Invoice Fields",
"position_x": 320,
"position_y": 0,
"width": 240,
"height": 120,
"config": {
"model": "gpt-5",
"json_schema": {
"type": "object",
"properties": {
"invoice_number": { "type": "string" },
"total": { "type": "number" }
}
}
},
"parent_id": null,
"updated_at": "2026-05-01T14:30:00Z"
}
],
"list_metadata": {
"before": null,
"after": null
}
}
{
"detail": "Workflow not found"
}
List Blocks
List blocks for a workflow with keyset cursor pagination.
Sorted by updated_at descending with id as the tiebreaker. Pass
after (the previous response’s list_metadata.after) for the next
page, before for the previous page. They are mutually exclusive; the
400 cleanly tells the caller which to drop.
from retab import Retab
client = Retab()
blocks = client.workflows.blocks.list("wf_abc123xyz")
for block in blocks.data:
print(f"{block.id} ({block.type}): {block.label}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const blocks = await client.workflows.blocks.list({ workflowId: "wf_abc123xyz" });
for (const block of blocks.data) {
console.log(`${block.id} (${block.type}): ${block.label}`);
}
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)
}
blocks, err := client.Workflows.Blocks.List(ctx, &retab.WorkflowBlocksListParams{
WorkflowID: "wf_abc123xyz",
})
if err != nil {
log.Fatal(err)
}
for _, block := range blocks.Data {
fmt.Printf("%s (%s): %v\n", block.ID, block.Type, block.Label)
}
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
blocks = client.workflows.blocks.list(workflow_id: 'wf_abc123xyz')
blocks.data.each do |block|
puts "#{block.id} (#{block.type}): #{block.label}"
end
use retab::resources::workflow_blocks::ListParams;
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 blocks = client
.workflows().blocks()
.list(ListParams::new("wf_abc123xyz"))
.await?;
for block in &blocks.data {
println!(
"{} ({}): {}",
block.id,
block.type_,
block.label.as_deref().unwrap_or("")
);
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->blocks()->list(
workflowId: '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.Blocks.ListAsync(new WorkflowBlocksListOptions());
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().blocks().list("wf_abc123", null, null, 10L);
System.out.println(result);
}
}
curl -X 'GET' \
'https://api.retab.com/v1/workflows/blocks?workflow_id=wf_abc123xyz' \
-H 'Authorization: Bearer <your-api-key>'
{
"data": [
{
"id": "start-1",
"workflow_id": "wf_abc123xyz",
"type": "start_document",
"label": "Invoice Input",
"position_x": 0,
"position_y": 0,
"width": 240,
"height": 120,
"config": null,
"parent_id": null,
"updated_at": "2026-04-30T17:00:00Z"
},
{
"id": "extract-1",
"workflow_id": "wf_abc123xyz",
"type": "extract",
"label": "Extract Invoice Fields",
"position_x": 320,
"position_y": 0,
"width": 240,
"height": 120,
"config": {
"model": "gpt-5",
"json_schema": {
"type": "object",
"properties": {
"invoice_number": { "type": "string" },
"total": { "type": "number" }
}
}
},
"parent_id": null,
"updated_at": "2026-05-01T14:30:00Z"
}
],
"list_metadata": {
"before": null,
"after": null
}
}
{
"detail": "Workflow not found"
}
{ "data": [...], "list_metadata": { "before": null, "after": null } } pagination envelope shared with all Retab list endpoints. Cursor pagination is not yet implemented for this endpoint — list_metadata is always { before: null, after: null }.
Use this endpoint with List Edges when you need to reconstruct a workflow graph.
from retab import Retab
client = Retab()
blocks = client.workflows.blocks.list("wf_abc123xyz")
for block in blocks.data:
print(f"{block.id} ({block.type}): {block.label}")
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const blocks = await client.workflows.blocks.list({ workflowId: "wf_abc123xyz" });
for (const block of blocks.data) {
console.log(`${block.id} (${block.type}): ${block.label}`);
}
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)
}
blocks, err := client.Workflows.Blocks.List(ctx, &retab.WorkflowBlocksListParams{
WorkflowID: "wf_abc123xyz",
})
if err != nil {
log.Fatal(err)
}
for _, block := range blocks.Data {
fmt.Printf("%s (%s): %v\n", block.ID, block.Type, block.Label)
}
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
blocks = client.workflows.blocks.list(workflow_id: 'wf_abc123xyz')
blocks.data.each do |block|
puts "#{block.id} (#{block.type}): #{block.label}"
end
use retab::resources::workflow_blocks::ListParams;
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 blocks = client
.workflows().blocks()
.list(ListParams::new("wf_abc123xyz"))
.await?;
for block in &blocks.data {
println!(
"{} ({}): {}",
block.id,
block.type_,
block.label.as_deref().unwrap_or("")
);
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->blocks()->list(
workflowId: '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.Blocks.ListAsync(new WorkflowBlocksListOptions());
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().blocks().list("wf_abc123", null, null, 10L);
System.out.println(result);
}
}
curl -X 'GET' \
'https://api.retab.com/v1/workflows/blocks?workflow_id=wf_abc123xyz' \
-H 'Authorization: Bearer <your-api-key>'
{
"data": [
{
"id": "start-1",
"workflow_id": "wf_abc123xyz",
"type": "start_document",
"label": "Invoice Input",
"position_x": 0,
"position_y": 0,
"width": 240,
"height": 120,
"config": null,
"parent_id": null,
"updated_at": "2026-04-30T17:00:00Z"
},
{
"id": "extract-1",
"workflow_id": "wf_abc123xyz",
"type": "extract",
"label": "Extract Invoice Fields",
"position_x": 320,
"position_y": 0,
"width": 240,
"height": 120,
"config": {
"model": "gpt-5",
"json_schema": {
"type": "object",
"properties": {
"invoice_number": { "type": "string" },
"total": { "type": "number" }
}
}
},
"parent_id": null,
"updated_at": "2026-05-01T14:30:00Z"
}
],
"list_metadata": {
"before": null,
"after": null
}
}
{
"detail": "Workflow not found"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Block id cursor: return the page before this id (mutually exclusive with after).
Block id cursor: return the page after this id (mutually exclusive with before).
Maximum number of blocks to return per page (1-200).
1 <= x <= 200Response
Successful Response
A page of WorkflowBlock resources. data holds the items and list_metadata carries the before/after cursors; pass after to fetch the next page.