Skip to main content
POST
Update Definition
Use this API to update an existing workflow definition. Atomically increments the version, snapshots the prior content, and rejects if the stored version mismatches ifVersion. In-flight executions keep running on the version they started with.

Endpoint

POST https://api.velt.dev/v2/workflow/definitions/update

Headers

string
required
Your API key.
string
required

Body

Params

Accepts every field from Create Definition plus:
Update replaces the definition; it is not a partial patch. Send the complete name, nodes, and edges on every call. Any field you omit is not preserved from the stored definition.Read the current definition with Get Definition, change what you need, then send the whole object back with ifVersion. A read response is not accepted verbatim: strip the server-owned version, createdAt, updatedAt, status, and compiled fields first. Strip the explicit nulls too. Every optional field you never set comes back as null: description, groups, triggers, tags, custom, and organizationId / documentId inside scope. Update takes those fields as absent or as real values, never as null, so a leftover null or a leftover server-owned field fails the request with INVALID_ARGUMENT.
object
required
Every successful update increments version and snapshots the prior content. In-flight executions are immune to updates: they keep running on the pinned definitionVersion from their dispatch.Snapshots are kept for audit and recovery only. There is no endpoint to read an old version and no rollback, so keep your own copy of anything you may want to restore. See Versioning.

Example Requests

Update a definition

Only name changes here, so the request resends the unchanged nodes and edges verbatim.

Response

Success Response

Failure Response

Errors: NOT_FOUND (definition does not exist) / FAILED_PRECONDITION (ifVersion mismatch) / INVALID_ARGUMENT (schema, compileGraph, or linter failure).