v1.0.0OpenAPI 3.1.1

Workflows API

Download OpenAPI Document

Chain translation, review and dubbing steps into one automated run.

Chain steps such as dubbing, document translation, quality checks, exports and human approvals into one workflow, then run it as often as you like. New here? Read Workflows for the whole flow and the graph format.

Every request

Send your organization API key in the x-api-key header; it starts with uvk_. Create one in the Universe app under Settings → API keys. The key and organization limits count requests over a rolling minute. See Authentication and Rate limits.

The typical flow: find the step types you need with List step types, save a workflow with Create a workflow (check it first with Validate a workflow), read what a run asks for in its inputSchema, then Start a run and poll it with Get a run. When a run reaches an Approval gate, Approve a step or Reject a step.

Runs work in the background, so every call returns straight away. Saving a workflow is free. A run is charged step by step, as each step starts, at the rate of the product that does the work; Start a run lists the rates. Without enough credits it returns 402 and nothing starts. See Credits.

Every route needs a cosmos permission on the role of the member who created the API key: read to look, create, update and delete to manage workflows, execute to run them. Each step also needs the permission of its own product, listed in its requires.

Server
{{API_BASE_URL}}
Your API environment
Authentication RequiredApiKeyAuth
Your organization API key (starts with `uvk_`). Create one in the Universe app under Settings → API keys.
x-api-key:
Client Libraries
Shell

Workflows

A workflow is a saved graph of steps and the edges between them. Create, validate, update and delete your organization's workflows here; built-in workflows can be read and run but not changed.

List workflows

Get a workflow

Create a workflow

Validate a workflow

Auth Required

Check a graph against the save rules without saving it, and get every problem at once instead of only the first. An empty problems list means a save will pass these rules. Branching rules checked only when the flow is compiled (a Parallel without its Merge, a step on more than one branch, a loop) are not covered, nor are step permissions. Returns 201 because it is a POST; nothing is created.

Permission: cosmos:read. An API key acts with the role of the member who created it.

Bodyrequiredapplication/json

graphFlowGraphDtorequired

The graph to check, in the same shape as a save.

Show child attributes
nodesFlowNodeDto[]required

Every step, including exactly one logic.start and one logic.end once the flow has a real step.

Show child attributes
idstringrequired

Your id for the node, unique within the flow. Edges, inputBindings, run inputs and run steps refer to it. Letters, digits, - and _ keep run-input keys readable.

Example: dub
nodeTypeKeystringrequired

The step type, a key from List step types, such as tv.instant_clone, logic.approval or logic.start.

Example: tv.instant_clone
positionFlowNodePositionDto

Canvas position, used only to draw the flow in the Universe app.

Show child attributes
xnumberrequired

Horizontal position on the canvas, in pixels.

Example: 240
ynumberrequired

Vertical position on the canvas, in pixels.

Example: 0
configobject

Values fixed when you save the flow, keyed by field key from the step type's inputSchema (and configSchema, for the LLM step). A field set here is not asked for when the flow runs. Gates keep their settings here too: a Delay's durationSeconds, an Approval's label and instructions, a Switch's cases and defaultCase.

Example: {"sourceLanguage":"en-US","targetLanguage":"hi-IN","speakerCount":"2"}
inputBindingsobject

Inputs read from an earlier step, keyed by input field key: { "<inputKey>": { "fromNodeId", "outputKey" } }. This is what the run reads; draw a matching binding edge so the canvas shows the wire.

Example: {"parentProcessId":{"fromNodeId":"dub","outputKey":"processId"}}
edgesFlowEdgeDto[]required

Every connection between steps.

Show child attributes
sourcestringrequired

id of the node the edge starts from.

Example: dub
targetstringrequired

id of the node the edge goes to.

Example: review
idstring

Your id for the edge.

Example: e2
sourceHandlestring

Where the edge leaves the source. For a control edge: __ctl_out, or case:<caseKey> from a Switch. For a binding edge: the source's output key. For a share edge: an input key of the source.

Example: __ctl_out
targetHandlestring

Where the edge enters the target. For a control edge: __ctl_in. For a binding or share edge: the target's input key.

Example: __ctl_in
kindstring

control: run order and branching (Start → step → gate → … → End). binding: data from an output to an input (mirror it in the target's inputBindings). share: two inputs of the same type that take one value, asked for once when the flow runs. Left out, the edge is a binding.

Enum values:bindingsharecontrol
Default: bindingExample: control
conditionFlowEdgeConditionDto

Reserved. Stored with the flow but not used to route a run: branch with a Switch gate instead.

Show child attributes
outputKeystringrequired

Output key of the source node to test.

Example: verdict
equalsstring | number | booleanrequired

The value the output must equal.

Example: APPROVED

Responses

201The problems found, if any.
application/json
problemsstring[]required

Every problem a save would refuse, each as the message the save would give. Empty when none was found.

Example: ["Connect the last step to the End node.","\"Export Video\" needs its \"Parent run\" wired from an upstream node."]
400Invalid request: a field failed validation, or a parameter is malformed (for example, an ID that is not a UUID).
application/json
statusCodeintegerrequired

HTTP status code, repeated in the body.

Example: 404
messagestring | string[]required

What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.

Example: Booking not found
errorstring

Short name of the status.

Example: Not Found
401The `x-api-key` header is missing, or the key is invalid, expired or deleted.
application/json
statusCodeintegerrequired

HTTP status code, repeated in the body.

Example: 404
messagestring | string[]required

What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.

Example: Booking not found
errorstring

Short name of the status.

Example: Not Found
403Not allowed: the API key's role lacks the permission (`PermissionDenied`), the product is not enabled for your organization, or it has been turned off.
application/json
statusCodeintegerrequired

HTTP status code, repeated in the body.

Example: 404
messagestring | string[]required

What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.

Example: Booking not found
errorstring

Short name of the status.

Example: Not Found
429Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.
application/json
statusCodeintegerrequired

HTTP status code, repeated in the body.

Example: 404
messagestring | string[]required

What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.

Example: Booking not found
errorstring

Short name of the status.

Example: Not Found
500Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.
application/json
statusCodeintegerrequired

HTTP status code, repeated in the body.

Example: 404
messagestring | string[]required

What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.

Example: Booking not found
errorstring

Short name of the status.

Example: Not Found
POST/v1/cosmos/flows/validate
curl '{{API_BASE_URL}}/v1/cosmos/flows/validate' \
  --request POST \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "graph": {
    "nodes": [
      {
        "id": "start",
        "nodeTypeKey": "logic.start",
        "position": {
          "x": 0,
          "y": 0
        }
      },
      {
        "id": "dub",
        "nodeTypeKey": "tv.instant_clone",
        "position": {
          "x": 240,
          "y": 0
        },
        "config": {
          "sourceLanguage": "en-US",
          "targetLanguage": "hi-IN",
          "speakerCount": "2"
        }
      },
      {
        "id": "review",
        "nodeTypeKey": "logic.approval",
        "position": {
          "x": 480,
          "y": 0
        },
        "config": {
          "label": "Review the Hindi dub",
          "instructions": "Check names and numbers in the editor."
        }
      },
      {
        "id": "export",
        "nodeTypeKey": "tv.export",
        "position": {
          "x": 720,
          "y": 0
        },
        "config": {
          "targetLanguage": "hi-IN",
          "withSubtitles": true
        },
        "inputBindings": {
          "parentProcessId": {
            "fromNodeId": "dub",
            "outputKey": "processId"
          }
        }
      },
      {
        "id": "end",
        "nodeTypeKey": "logic.end",
        "position": {
          "x": 960,
          "y": 0
        }
      }
    ],
    "edges": [
      {
        "id": "e1",
        "source": "start",
        "target": "dub",
        "sourceHandle": "__ctl_out",
        "targetHandle": "__ctl_in",
        "kind": "control"
      },
      {
        "id": "e2",
        "source": "dub",
        "target": "review",
        "sourceHandle": "__ctl_out",
        "targetHandle": "__ctl_in",
        "kind": "control"
      },
      {
        "id": "e3",
        "source": "review",
        "target": "export",
        "sourceHandle": "__ctl_out",
        "targetHandle": "__ctl_in",
        "kind": "control"
      },
      {
        "id": "e4",
        "source": "export",
        "target": "end",
        "sourceHandle": "__ctl_out",
        "targetHandle": "__ctl_in",
        "kind": "control"
      },
      {
        "id": "e5",
        "source": "dub",
        "target": "export",
        "sourceHandle": "processId",
        "targetHandle": "parentProcessId",
        "kind": "binding"
      }
    ]
  }
}'
{
  "problems": [
    "Connect the last step to the End node.",
    "\"Export Video\" needs its \"Parent run\" wired from an upstream node."
  ]
}

Update a workflow

Get your copy of a ready-made workflow

Step types

The building blocks of a workflow: product steps such as dubbing, translation and quality checks, and the logic.* gates that wait, branch, run in parallel and ask for approval. Read them first to learn each step's field keys.

List step types

Approvals

An Approval gate pauses a run until someone decides. While it waits, the run's status is awaiting_action: approve the step to continue, or reject it to stop the run.

Approve a step

Reject a step

Models

AiModelDto
AiModelRateDto
ExecutionListCountsDto
ExecutionListItemDto
ExecutionListMetaDto
ExecutionNodeControlDto
ExecutionNodeDto
ExecutionProgressDto
ExecutionResponseDto
ExecutionStartedByDto
ExecutionStatusResponseDto
FlowEdgeConditionDto
FlowEdgeDto
FlowGraphDto
FlowInputBindingDto
FlowNodeDto
FlowNodePositionDto
FlowResponseDto
InsufficientCreditsErrorDto
ListExecutionsResponseDto
MovedProjectDto
MoveExecutionProjectBodyDto
MoveExecutionProjectResponseDto
NodeFieldDto
NodeFieldOptionDto
NodeFlagsDto
NodeNavigationDto
NodeRequirementDto
NodeTypeDto
NodeTypesResponseDto
PortTypeDto
RejectGateBodyDto
RenameExecutionDto
RenameExecutionResponseDto
RunInputFieldDto
SaveFlowDto
SaveRunImagesDto
SetStepOwnersDto
SharedInputDto
StartExecutionDto
StepGalaxyDto
StepOwnerDto
StepOwnersResponseDto
ValidateFlowDto
ValidateFlowResponseDto