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

client = Retab()

updated = client.workflows.spec.apply_to_workflow(
    "wf_abc123",
    yaml_definition,
)

print(updated.workflow_id)
print(updated.summary.has_changes)
{
  "workflow_id": "wf_abc123",
  "created": false,
  "block_count": 1,
  "edge_count": 0,
  "diagnostics": {
    "issues": []
  },
  "format_version": "workflows-plan/v1",
  "summary": {
    "add": 0,
    "change": 1,
    "destroy": 0,
    "replace": 0,
    "noop": 0,
    "total": 1,
    "has_changes": true
  },
  "resource_changes": [],
  "rendered_plan": "Updated workflow draft."
}
Apply a declarative workflow YAML spec to an existing workflow draft. The workflow_id in the URL is the update target. If the YAML includes metadata.id, Retab treats it as source context and does not use it to choose a different workflow.
from retab import Retab

client = Retab()

updated = client.workflows.spec.apply_to_workflow(
    "wf_abc123",
    yaml_definition,
)

print(updated.workflow_id)
print(updated.summary.has_changes)
{
  "workflow_id": "wf_abc123",
  "created": false,
  "block_count": 1,
  "edge_count": 0,
  "diagnostics": {
    "issues": []
  },
  "format_version": "workflows-plan/v1",
  "summary": {
    "add": 0,
    "change": 1,
    "destroy": 0,
    "replace": 0,
    "noop": 0,
    "total": 1,
    "has_changes": true
  },
  "resource_changes": [],
  "rendered_plan": "Updated workflow draft."
}

Authorizations

Api-Key
string
header
required

Path Parameters

workflow_id
string
required

Body

application/json

Body carrying a workflow's full YAML definition for validate, plan, apply, or export.

yaml_definition
string
required

Workflow YAML definition

Response

Successful Response

The outcome of applying a workflow YAML definition: whether the workflow was created, the changes made, and a rendered_plan.

workflow_id
string
required
action
enum<string>
required
Available options:
create,
update,
noop
created
boolean
required
block_count
integer
required
edge_count
integer
required
diagnostics
Diagnostics · object
required
format_version
string
default:workflows-plan/v1
summary
DeclarativePlanSummary · object
resource_changes
DeclarativePlanResourceChange · object[]
rendered_plan
string
default:No changes. Workflow spec is up to date.