VocalDocscontracts 1.65.0

Publish the Workflow draft as a new version

POST /v1/workflows/{workflow_id}/versions

PropertyValue
Operationpublish_workflow_version
GroupWorkflows
Scopeworkflows:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited workflow.version.publish (mutation)
Released in1.59.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Publishes the draft that If-Match names as the next version once every check of a create passes again (1.59.0): it compiles the definition into the form the Session runs, records the digest, the format and engine versions and pins the default Agent's active version. With activate the new version becomes the active one, the version the next Agent version publish pins.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the workflows:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/workflows/wfl_.../versions" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
workflow_idpathWorkflowIdyesThe id of a Workflow: wfl_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: WorkflowVersionPublishRequest.

FieldTypeRequiredDescription
activatebooleannoMake the new version the active one; false when omitted.
notesstringnoWhy this version exists.

Responses

StatusContent typeShapeError codes
201application/jsonWorkflowVersion
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeworkflow_archived, idempotency_in_progress, idempotency_key_reused
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed, capability_not_available
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 201 answer

The shape is WorkflowVersion.

FieldTypeRequiredDescription
activebooleanyesTrue for the active version: the one the next Agent version publish pins.
agent_idAgentIdnoConversation scope only, and required there: the default Agent, which supplies voice, transcriber, model, Policies, Tools and destinations.
correlationWorkflowCorrelationno
descriptionstring or nullyes
engine_versionstringyesThe Zen engine version the version's decisions and expressions were checked under.
entryWorkflowNodeIdyes
format_versionintegeryesThe version of the compiled form the Session runs, 1 in this release.
graph_sha256stringyesThe SHA-256 of the canonical JSON (RFC 8785) of the definition as published, in lowercase hex.
inputsmap of WorkflowFieldnoCall variables (conversation) or start inputs (process).
limitsWorkflowLimitsyes
namestringyesKebab-case, unique per Organization.
nodesarray of WorkflowNodeyesExactly one entry node; at most 200 nodes, loop bodies included (target).
notesstring or nullyes
object"workflow_version"yes
outputsmap of WorkflowFieldnoThe typed result returned to a parent or a starting Process.
pinsWorkflowPinsyes
published_atTimestampyes
published_byActorRefyes
scopeWorkflowScopeyes
settingsmap of WorkflowSettingnoProcess scope: named thresholds and constants that evaluate nodes read.
slotsmap of WorkflowFieldnoConversation scope: the Session's typed slots.
source_revisionintegeryesThe draft revision this version was published from.
statusWorkflowVersionStatusyes
varsmap of WorkflowFieldnoProcess scope: the instance's working data.
versionintegeryesThe snapshot number, from 1.
workflow_idWorkflowIdyes