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

client = Retab()

result = client.workflows.spec.apply(yaml_definition)

print(result.workflow_id)
print(result.created)
print(result.summary.has_changes)
{
  "workflow_id": "wf_abc123",
  "created": true,
  "block_count": 2,
  "edge_count": 1,
  "diagnostics": {
    "issues": []
  },
  "format_version": "workflows-plan/v1",
  "summary": {
    "add": 0,
    "change": 0,
    "destroy": 0,
    "replace": 0,
    "noop": 1,
    "total": 0,
    "has_changes": false
  },
  "resource_changes": [],
  "rendered_plan": "No changes. Infrastructure is up-to-date."
}
Create a new workflow from a declarative workflow YAML spec. apply() creates a new workflow resource and writes the canonical draft graph represented by the YAML spec. It does not publish. Call the workflow publish method separately when the draft is ready to become the live version. If the YAML includes metadata.id, Retab treats it as source context, not as the target workflow id. To modify an existing workflow, use Apply Workflow Spec to Existing Workflow.
from retab import Retab

client = Retab()

result = client.workflows.spec.apply(yaml_definition)

print(result.workflow_id)
print(result.created)
print(result.summary.has_changes)
{
  "workflow_id": "wf_abc123",
  "created": true,
  "block_count": 2,
  "edge_count": 1,
  "diagnostics": {
    "issues": []
  },
  "format_version": "workflows-plan/v1",
  "summary": {
    "add": 0,
    "change": 0,
    "destroy": 0,
    "replace": 0,
    "noop": 1,
    "total": 0,
    "has_changes": false
  },
  "resource_changes": [],
  "rendered_plan": "No changes. Infrastructure is up-to-date."
}

Authorizations

Api-Key
string
header
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.