Workflows API
Download OpenAPI DocumentChain 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.
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
Update a workflow
Get your copy of a ready-made workflow
Ready-made workflows are templates: they are never compiled, so they cannot run themselves. This returns the organization’s own copy of one, making it the first time (saved, compiled and published, owned by the caller) and reusing it after that, so repeated calls never pile up copies. Start a run on the returned workflow. For an organization workflow it returns the workflow itself. Free; runs are charged.
Permission: cosmos:create. An API key acts with the role of the member who created it.
Path Parameters
Workflow ID (id), from Create a workflow or List workflows.
Responses
201The organization’s copy of the workflow.
Workflow ID.
Your organization. Null for a ready-made workflow (isSystem: true).
Member who created it. Null for a ready-made workflow.
Name.
Description, if you set one.
True for a built-in workflow: every organization sees it and can run it, nobody can change or delete it.
published once the flow has at least one real step and saved cleanly: it can run. draft while it has only its Start and End (or nothing).
The steps and their connections, as you saved them.
Show child attributes
Every step, including exactly one logic.start and one logic.end once the flow has a real step.
Show child attributes
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.
The step type, a key from List step types, such as tv.instant_clone, logic.approval or logic.start.
Canvas position, used only to draw the flow in the Universe app.
Show child attributes
Horizontal position on the canvas, in pixels.
Vertical position on the canvas, in pixels.
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.
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.
Every connection between steps.
Show child attributes
id of the node the edge starts from.
id of the node the edge goes to.
Your id for the edge.
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.
Where the edge enters the target. For a control edge: __ctl_in. For a binding or share edge: the target's input key.
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.
Reserved. Stored with the flow but not used to route a run: branch with a Switch gate instead.
Show child attributes
Output key of the source node to test.
The value the output must equal.
What a run of this flow asks for: every step input that is neither set in config nor wired, in the order the steps run. Pass each one in input under its key when you start a run. Worked out from the current step types each time you read the flow.
Show child attributes
Key to use in input when you start a run: <nodeId>__<fieldKey> (non-alphanumeric characters of the node id become _), or share__<…> for inputs joined by a share edge.
Display name.
What kind of value it is: text, textarea, number, select, boolean, file, language (a language code), tm (a translation memory id), region (a Quality Control region id), upstreamRef (a value wired from an earlier step, or for a file, uploaded at run time), or a type of the step's own, such as voice.
Port type. A binding edge may join an output to an input only when their dataTypes match (any matches everything). See portTypes for the list.
The field's own key within its step.
id of the node that asks for it.
Label of that step, for grouping the inputs.
Whether the step needs a value: set in config, wired, or given when the flow runs.
Takes a list of values instead of one.
Help text.
The allowed values of a select field.
Show child attributes
What the Universe app shows.
The value to send.
Where the Universe app loads the allowed values from, for example cosmos_ai_models (the aiModels list in this response).
Value used when you set none.
For an upstreamRef input: the output key of an earlier step it usually reads. Informational; the wire is what counts.
What the port carries more precisely than dataType, such as docx, pptx, image or text. Two ports connect only when these overlap. Absent: unrestricted. Empty: the port carries nothing in this configuration.
The config key whose value sets this port's dataType (the LLM step's ports change with its input and output kinds).
The config key whose value sets this port's modalities.
For modalitiesFrom: config value → the modalities the port then carries. Values not listed carry themselves.
Internal name of the compiled workflow. Null until the flow is published. Informational.
Goes up by one each time a save publishes the flow. A run keeps the version it started with. Null until first published.
When it was created.
When it was last saved.
Always null: deleted workflows are not returned.
Inputs joined by share edges, which a run asks for once. Empty when the flow has none.
Show child attributes
id of the node.
Input field key within that node.
The input key the whole group is given under when the flow runs.
True for the one member that appears in inputSchema; the others read its value.
The steps in run order, by label, without Start, End and Merge.
400The graph breaks a save rule; `message` names the first problem, worded as Validate a workflow would. For example: - `Unknown node type "<key>".` - `A flow needs a Start node.` / `A flow needs an End node.` / `Connect the last step to the End node.` - `"<step>" needs its "<field>" set.` or `"<step>" needs its "<input>" wired from an upstream node.` - `Every node must be connected — remove or connect any floating nodes.` - `A Parallel gate needs a Merge where its branches rejoin.` or `A Switch gate needs at least one case.` Branching problems (a Parallel without its Merge, a step on more than one branch, a loop) are found when the flow is compiled, after the rules above pass. In that case the graph has already been stored as you sent it: a new workflow is kept as a `draft` (find it with List workflows), and an updated one keeps running the last version that compiled. Fix the graph and save again.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
401The `x-api-key` header is missing, or the key is invalid, expired or deleted.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
403Not allowed. Besides a missing `cosmos` permission: `You don't have permission to run "<step>". Ask an admin for access.` (the API key's role lacks the permission a step you added needs, listed in its `requires`), `Your organization does not have access to "<step>".` (the product is not in your plan), or a Drive file set in `config` that the role may not read.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
404No workflow with this `id` in your organization, or it was deleted (`Flow <id> not found`).
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
429Too many requests for this key. Wait the number of seconds in `Retry-After`, then retry.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
500Something failed on our side. Retry with backoff; if it persists, contact support with the `X-Request-Id`.
HTTP status code, repeated in the body.
What went wrong, for people. Validation failures list one entry per problem. Do not branch on this text.
Short name of the status.
curl '{{API_BASE_URL}}/v1/cosmos/flows/3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e/org-copy' \
--request POST \
--header 'x-api-key: YOUR_API_KEY'{
"id": "3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e",
"fk_orgId": "7f3e2d1c-0b9a-4c8d-9e7f-6a5b4c3d2e1f",
"fk_ownerId": "2b4d6f8a-1c3e-4a5b-8c7d-9e0f1a2b3c4d",
"name": "Dub to Hindi, review, export",
"description": "Dubs a video into Hindi and exports it after a review.",
"isSystem": false,
"status": "published",
"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"
}
]
},
"inputSchema": [
{
"key": "dub__tmId",
"label": "Target language",
"type": "language",
"dataType": "language",
"required": true,
"multiple": true,
"description": "The language to translate and dub into.",
"options": [
{
"label": "2",
"value": "2"
}
],
"optionsSource": "cosmos_ai_models",
"default": "auto-detect",
"refOutputKey": "deliverable",
"modalities": [
"docx"
],
"dataTypeFrom": "inputModality",
"modalitiesFrom": "inputModality",
"modalitiesMap": {
"image": []
},
"fieldKey": "tmId",
"nodeId": "dub",
"group": "Dub with Voice Clone"
}
],
"conductorWorkflowName": "cosmos_flow_3c9d7e1a-5b2f-4a6c-8d0e-1f2a3b4c5d6e",
"conductorWorkflowVersion": 3,
"createdAt": "2026-10-01T09:30:00.000Z",
"updatedAt": "2026-10-02T14:05:12.000Z",
"deletedAt": null,
"shareGroups": [
{
"nodeId": "translate-fr",
"fieldKey": "sourceLanguage",
"groupKey": "share__translate_de__sourceLanguage",
"canonical": true
}
],
"summary": "Dub with Voice Clone → Approval → Export Video"
}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
Runs
A run is one execution of a workflow with its own inputs. Start it, poll it until it finishes, then retry or cancel it if you need to. You can also rename a run, file it in a folder and choose who owns each step.
- POST/v1/cosmos/flows/{id}/run
- GET/v1/cosmos/executions
- GET/v1/cosmos/executions/{id}
- POST/v1/cosmos/executions/{id}/retry
- POST/v1/cosmos/executions/{id}/rename
- GET/v1/cosmos/executions/{id}/images.zip
- PATCH/v1/cosmos/executions/{id}/project
- POST/v1/cosmos/executions/{id}/images/save-to-drive
- POST/v1/cosmos/executions/{id}/nodes/{nodeId}/step-owners
Start a run
List runs
Get a run
Retry a run
Rename a run
Download a run’s images
Move a run to a project
Save a run’s images to Drive
Set step owners
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.