from retab import Retab
client = Retab()
workflow = client.workflows.publish(
"wf_abc123xyz",
description="Add vendor-name normalization step",
)
print(workflow.published.version_id)
print(workflow.published.published_at)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const workflow = await client.workflows.publish("wf_abc123xyz", "Add vendor-name normalization step");
console.log(workflow.published.versionId);
console.log(workflow.published.publishedAt);
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)
}
workflow, err := client.Workflows.Publish(ctx, "wf_abc123xyz", &retab.WorkflowsPublishParams{
Body: retab.PublishWorkflowRequest{
Description: ptr("Add vendor-name normalization step"),
},
})
if err != nil {
log.Fatal(err)
}
if workflow.Published != nil {
fmt.Println(workflow.Published.VersionID)
fmt.Println(workflow.Published.PublishedAt)
}
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
workflow = client.workflows.publish(
workflow_id: 'wf_abc123xyz',
description: 'Add vendor-name normalization step',
)
puts workflow.published.version_id
puts workflow.published.published_at
use retab::models::PublishWorkflowRequest;
use retab::resources::workflows::PublishParams;
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 workflow = client
.workflows()
.publish(
"wf_abc123xyz",
PublishParams {
body: Some(PublishWorkflowRequest {
description: Some("Add vendor-name normalization step".into()),
}),
},
)
.await?;
if let Some(published) = &workflow.published {
println!("{}", published.version_id.as_deref().unwrap_or(""));
println!("{}", published.published_at.as_deref().unwrap_or(""));
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->publish(
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.PublishAsync("wf_abc123", new WorkflowsPublishOptions());
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().publish("wf_abc123");
System.out.println(result);
}
}
curl -X 'POST' \
'https://api.retab.com/v1/workflows/wf_abc123xyz/publish' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your-api-key>' \
-d '{
"description": "Add vendor-name normalization step"
}'
{
"id": "wf_abc123xyz",
"name": "Invoice Processing",
"description": "Extract invoice fields and route for review",
"published": {
"version_id": "ver_8zJfV7T9qK2mP4xN6bR1cD3eF5gH7iJ9",
"published_at": "2026-05-01T14:30:00Z"
},
"created_at": "2026-04-30T17:00:00Z",
"updated_at": "2026-05-01T14:30:00Z"
}
{
"detail": "Workflow has structural errors and cannot be published"
}
{
"detail": "Workflow not found"
}
Workflows
Publish Workflow
Publish a workflow.
This creates an immutable snapshot of the workflow configuration, making it available for workflow runs. The live entities remain unchanged so users can continue editing.
POST
/
v1
/
workflows
/
{workflow_id}
/
publish
from retab import Retab
client = Retab()
workflow = client.workflows.publish(
"wf_abc123xyz",
description="Add vendor-name normalization step",
)
print(workflow.published.version_id)
print(workflow.published.published_at)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const workflow = await client.workflows.publish("wf_abc123xyz", "Add vendor-name normalization step");
console.log(workflow.published.versionId);
console.log(workflow.published.publishedAt);
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)
}
workflow, err := client.Workflows.Publish(ctx, "wf_abc123xyz", &retab.WorkflowsPublishParams{
Body: retab.PublishWorkflowRequest{
Description: ptr("Add vendor-name normalization step"),
},
})
if err != nil {
log.Fatal(err)
}
if workflow.Published != nil {
fmt.Println(workflow.Published.VersionID)
fmt.Println(workflow.Published.PublishedAt)
}
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
workflow = client.workflows.publish(
workflow_id: 'wf_abc123xyz',
description: 'Add vendor-name normalization step',
)
puts workflow.published.version_id
puts workflow.published.published_at
use retab::models::PublishWorkflowRequest;
use retab::resources::workflows::PublishParams;
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 workflow = client
.workflows()
.publish(
"wf_abc123xyz",
PublishParams {
body: Some(PublishWorkflowRequest {
description: Some("Add vendor-name normalization step".into()),
}),
},
)
.await?;
if let Some(published) = &workflow.published {
println!("{}", published.version_id.as_deref().unwrap_or(""));
println!("{}", published.published_at.as_deref().unwrap_or(""));
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->publish(
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.PublishAsync("wf_abc123", new WorkflowsPublishOptions());
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().publish("wf_abc123");
System.out.println(result);
}
}
curl -X 'POST' \
'https://api.retab.com/v1/workflows/wf_abc123xyz/publish' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your-api-key>' \
-d '{
"description": "Add vendor-name normalization step"
}'
{
"id": "wf_abc123xyz",
"name": "Invoice Processing",
"description": "Extract invoice fields and route for review",
"published": {
"version_id": "ver_8zJfV7T9qK2mP4xN6bR1cD3eF5gH7iJ9",
"published_at": "2026-05-01T14:30:00Z"
},
"created_at": "2026-04-30T17:00:00Z",
"updated_at": "2026-05-01T14:30:00Z"
}
{
"detail": "Workflow has structural errors and cannot be published"
}
{
"detail": "Workflow not found"
}
Publish the workflow’s current draft as a new immutable version. New runs created via Run Workflow, schedules, or webhooks always execute against the latest published version — edits to the draft after publish do not affect in-flight or future runs until you publish again.
Pass an optional
description to record what changed in this version.
Publishing happens inside one environment. A test workflow publishes to
the test environment; a production workflow publishes to production.
from retab import Retab
client = Retab()
workflow = client.workflows.publish(
"wf_abc123xyz",
description="Add vendor-name normalization step",
)
print(workflow.published.version_id)
print(workflow.published.published_at)
import { Retab } from "@retab/node";
const client = new Retab({ apiKey: process.env.RETAB_API_KEY });
const workflow = await client.workflows.publish("wf_abc123xyz", "Add vendor-name normalization step");
console.log(workflow.published.versionId);
console.log(workflow.published.publishedAt);
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)
}
workflow, err := client.Workflows.Publish(ctx, "wf_abc123xyz", &retab.WorkflowsPublishParams{
Body: retab.PublishWorkflowRequest{
Description: ptr("Add vendor-name normalization step"),
},
})
if err != nil {
log.Fatal(err)
}
if workflow.Published != nil {
fmt.Println(workflow.Published.VersionID)
fmt.Println(workflow.Published.PublishedAt)
}
}
require 'retab'
client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])
workflow = client.workflows.publish(
workflow_id: 'wf_abc123xyz',
description: 'Add vendor-name normalization step',
)
puts workflow.published.version_id
puts workflow.published.published_at
use retab::models::PublishWorkflowRequest;
use retab::resources::workflows::PublishParams;
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 workflow = client
.workflows()
.publish(
"wf_abc123xyz",
PublishParams {
body: Some(PublishWorkflowRequest {
description: Some("Add vendor-name normalization step".into()),
}),
},
)
.await?;
if let Some(published) = &workflow.published {
println!("{}", published.version_id.as_deref().unwrap_or(""));
println!("{}", published.published_at.as_deref().unwrap_or(""));
}
Ok(())
}
<?php
require 'vendor/autoload.php';
use Retab\Client;
$client = new Client(apiKey: getenv('RETAB_API_KEY'));
$result = $client->workflows()->publish(
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.PublishAsync("wf_abc123", new WorkflowsPublishOptions());
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().publish("wf_abc123");
System.out.println(result);
}
}
curl -X 'POST' \
'https://api.retab.com/v1/workflows/wf_abc123xyz/publish' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <your-api-key>' \
-d '{
"description": "Add vendor-name normalization step"
}'
{
"id": "wf_abc123xyz",
"name": "Invoice Processing",
"description": "Extract invoice fields and route for review",
"published": {
"version_id": "ver_8zJfV7T9qK2mP4xN6bR1cD3eF5gH7iJ9",
"published_at": "2026-05-01T14:30:00Z"
},
"created_at": "2026-04-30T17:00:00Z",
"updated_at": "2026-05-01T14:30:00Z"
}
{
"detail": "Workflow has structural errors and cannot be published"
}
{
"detail": "Workflow not found"
}
Authorizations
Body
application/json
Response
Successful Response
A workflow and its current configuration.