mirror of
https://github.com/simstudioai/sim.git
synced 2026-08-31 01:11:53 +08:00
32a15fde2f
* improvement(access-control): wire tool and model permissions into copilot editing Permission groups already supported a per-tool denylist (deniedTools) and model restrictions, but only the canvas honored them. The copilot edit path gated on block type alone, so Sim could build workflows using tools and models the user was not allowed to run — the executor refused them at run time instead. Enforce both at authoring time, and stop advertising what the viewer cannot use. * fix(access-control): use the path alias for the permission-groups type import * fix(access-control): close two denied-tool leaks in copilot discovery The VFS stamped every integration schema from the shared static map before the per-viewer loop re-authored the permitted subset, so a denied operation's schema stayed published. Skip the shared copy for integration paths; the viewer loop is the only projection that knows the denylist. Block metadata resolved denied operations from the catalog's `operation.toolId`, which the projection fills only from `tools.config.tool` — a block whose operation ids are its tool ids left it undefined and read as fully permitted. Resolve through the shared operation gate instead. * fix(access-control): key the copilot schema cache on permission policy The deferred integration-tool schemas now depend on the viewer's permission group, but the cache key encoded only identity and block visibility, so an admin's change to deniedTools took effect only when the entry expired. Resolve the config before the key and add a gate signature alongside the existing visibility signature, mirroring how block visibility already keys the same cache. The read moves out of the cached section rather than being added: what the entry caches is a user-tool schema per exposed integration tool, which dominates it.
9957 lines
360 KiB
JSON
9957 lines
360 KiB
JSON
{
|
||
"openapi": "3.1.0",
|
||
"info": {
|
||
"title": "Sim API v2 — Workflows",
|
||
"description": "Version 2 of the Sim REST API for workflow management, deployment versions, execution, run lifecycle, folders, and portable import and export.",
|
||
"version": "2.0.0",
|
||
"contact": {
|
||
"name": "Sim Support",
|
||
"email": "help@sim.ai",
|
||
"url": "https://www.sim.ai"
|
||
},
|
||
"license": {
|
||
"name": "Apache 2.0",
|
||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
|
||
}
|
||
},
|
||
"servers": [
|
||
{
|
||
"url": "https://www.sim.ai",
|
||
"description": "Production"
|
||
}
|
||
],
|
||
"tags": [
|
||
{
|
||
"name": "Workflows",
|
||
"description": "Manage and execute workflow definitions, folders, deployment versions, and portable imports and exports."
|
||
},
|
||
{
|
||
"name": "Workflow Runs",
|
||
"description": "Inspect, resume, and cancel workflow runs."
|
||
}
|
||
],
|
||
"security": [
|
||
{
|
||
"apiKey": []
|
||
}
|
||
],
|
||
"paths": {
|
||
"/api/v2/workflows": {
|
||
"get": {
|
||
"operationId": "listWorkflows",
|
||
"summary": "List Workflows",
|
||
"description": "List workflows in a workspace with lifecycle scope, folder and deployment filters, search, sorting, and opaque cursor pagination. `scope` defaults to `active`; pass `archived` to list workflows a `DELETE` archived. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workspaceId",
|
||
"in": "query",
|
||
"required": true,
|
||
"description": "Workspace whose workflows should be listed.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace whose workflows should be listed."
|
||
}
|
||
},
|
||
{
|
||
"name": "scope",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Which lifecycle set to list: `active` (default) for live workflows, `archived` for workflows a `DELETE` archived. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too.",
|
||
"schema": {
|
||
"default": "active",
|
||
"description": "Which lifecycle set to list: `active` (default) for live workflows, `archived` for workflows a `DELETE` archived. `folderPath` resolves against active folders only, so pairing it with `scope=archived` returns an empty page when the containing folder was archived too.",
|
||
"type": "string",
|
||
"enum": ["active", "archived"]
|
||
}
|
||
},
|
||
{
|
||
"name": "folderPath",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Restrict results to workflows in this folder path. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error.",
|
||
"schema": {
|
||
"description": "Restrict results to workflows in this folder path. A path that names no folder narrows the result to nothing, so the response is an empty page rather than an error.",
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
}
|
||
},
|
||
{
|
||
"name": "deployedOnly",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Return only workflows with an active deployment when true.",
|
||
"schema": {
|
||
"description": "Return only workflows with an active deployment when true.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
{
|
||
"name": "limit",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Maximum workflows to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"schema": {
|
||
"default": 50,
|
||
"description": "Maximum workflows to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 100
|
||
}
|
||
},
|
||
{
|
||
"name": "cursor",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"schema": {
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
},
|
||
{
|
||
"name": "search",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Case-insensitive substring match against the resource name.",
|
||
"schema": {
|
||
"description": "Case-insensitive substring match against the resource name.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 200
|
||
}
|
||
},
|
||
{
|
||
"name": "sortBy",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order.",
|
||
"schema": {
|
||
"default": "position",
|
||
"description": "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order.",
|
||
"type": "string",
|
||
"enum": ["position", "name", "createdAt", "updatedAt", "runCount"]
|
||
}
|
||
},
|
||
{
|
||
"name": "sortOrder",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Sort direction.",
|
||
"schema": {
|
||
"default": "asc",
|
||
"description": "Sort direction.",
|
||
"type": "string",
|
||
"enum": ["asc", "desc"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "A page of workflows.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"operationId": "createWorkflowV2",
|
||
"summary": "Create Workflow",
|
||
"description": "Create a workflow in a workspace root or canonical workflow folder. The response carries the blocks the platform seeded the workflow with, so the start block's id is available without a second request — attach edges to it directly. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Name, description, workspace, and optional folder for a new workflow.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/CreateWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"201": {
|
||
"description": "The created workflow.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/CreateWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/state": {
|
||
"get": {
|
||
"operationId": "getWorkflowState",
|
||
"summary": "Get Workflow State",
|
||
"description": "Get the editable draft graph of a workflow: blocks, edges, the loop and parallel containers derived from them, and variables. This is the pollable read — it records no audit event, and `HEAD` mirrors `GET`. The payload is **unsanitized**: it carries workspace-scoped `credentialId`, `knowledgeBaseId`, and `tableId` values verbatim, so it is not portable to another workspace. Use `GET /workflows/{workflowId}/export` for a portable, sanitized copy — and note that export is not a read-modify-write source, because sanitizing it drops every credential binding. Unknown members are stripped, so what this returns is exactly the set of keys `PUT /workflows/{workflowId}/state` accepts.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow draft graph.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowStateResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"operationId": "replaceWorkflowState",
|
||
"summary": "Replace Workflow State",
|
||
"description": "Replace a workflow’s editable draft graph wholesale. `loops` and `parallels` are accepted but ignored — both are recomputed from `blocks`. Omitting `variables` leaves the stored variables untouched.\n\nLast write wins: concurrent writers are serialized by a row lock, so each lands a complete self-consistent graph and the later one replaces the earlier entirely. There is no partially-written state and no conflict detection.\n\nThis does not change what the deployed endpoint serves. Deployments are immutable versioned snapshots, and no schedule or webhook registration is touched. The only visible consequence is that `needsRedeployment` becomes true; `POST /workflows/{workflowId}/deploy` publishes the draft.\n\n`lint` is advisory and never blocks the write. `lint.fieldIssues` is the most actionable part for a headless builder — it names blocks missing a required field, which fail at run time — and `lint.unresolvedReferences` names credential, resource, tool, and skill values that do not resolve. A workspace API key is rejected with `403`; use a personal API key.\n\nSet `?dryRun=true` to validate and lint without persisting: nothing is written, no audit entry is recorded, and collaborators are not notified. The response carries the same shape and the same validation and `lint` findings the committed write would, with `dryRun: true` — but `needsRedeployment` describes the state before the write, and warnings raised by persistence itself are necessarily absent.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
},
|
||
{
|
||
"name": "dryRun",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Validate and lint without persisting. The response is identical to the committed write of the same body, so a caller can inspect `lint` and then re-send the request for real. Nothing is written, no audit entry is recorded, and collaborators are not notified.",
|
||
"schema": {
|
||
"description": "Validate and lint without persisting. The response is identical to the committed write of the same body, so a caller can inspect `lint` and then re-send the request for real. Nothing is written, no audit entry is recorded, and collaborators are not notified.",
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "A complete replacement draft graph for a workflow.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ReplaceWorkflowStateRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The draft graph was replaced.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ReplaceWorkflowStateResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/operations": {
|
||
"post": {
|
||
"operationId": "applyWorkflowOperations",
|
||
"summary": "Apply Workflow Operations",
|
||
"description": "Apply a batch of semantic edits — add, edit, delete, and subflow membership changes — to a workflow graph, plus an optional set of block enable/disable changes.\n\nBest-effort per operation, atomic per write. The engine applies what it can to an in-memory graph and reports the rest in `skipped`, each with a machine-readable `type`; exactly one write of the fully-resolved graph then happens, so there is never a partially-applied graph. `deferred` is **not** a failure list: a forward-referencing edge is wired automatically once its target block exists, in this batch or a later one, so re-issuing a deferred edge is wrong.\n\nSet `atomic` to fail closed: any genuine skipped item, or any block input that would be dropped rather than persisted, then aborts before the write and answers `409` with `error.details.code: \"OPERATIONS_NOT_APPLIED\"`, the same `skipped` array, and a `droppedInputs` array, having persisted nothing.\n\nA `block_id` you supply on an `add` or `insert_into_subflow` is only a label unless it is already a UUID: the engine mints one and returns the pairing in `mintedBlockIds`. References between operations in the same batch are remapped for you, so `triage` can be wired up in the same call it is created in — but a later request must use the minted id. Send your own UUIDs when you want an id you chose to survive across requests.\n\nOperation `params` is an open object because the accepted inputs come from the block registry, not from this contract — see the per-operation schemas for the envelope: `inputs` keyed by sub-block id, with `retry`, `triggerMode` and `advancedMode` beside it rather than inside it, and `connections` keyed by source handle. `GET /blocks/{blockId}` publishes the inputs a given block type accepts.\n\n`lint` is advisory and never blocks the write. `lint.fieldIssues` is the most actionable part for a headless builder — it names blocks missing a required field, which fail at run time — and `lint.unresolvedReferences` names credential, resource, tool, and skill values that do not resolve. Those values stay persisted; only `inputValidationErrors` lists inputs that were actually dropped.\n\nAs with `PUT /workflows/{workflowId}/state`, this changes only the draft; deploy to publish it. A workspace API key is rejected with `403`; use a personal API key.\n\nSet `?dryRun=true` to validate and lint without persisting: nothing is written, no audit entry is recorded, and collaborators are not notified. The response carries the same shape and the same validation and `lint` findings the committed write would, with `dryRun: true` — but `needsRedeployment` describes the state before the write, and warnings raised by persistence itself are necessarily absent.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
},
|
||
{
|
||
"name": "dryRun",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Validate and lint without persisting. The response is identical to the committed write of the same body, so a caller can inspect `lint` and then re-send the request for real. Nothing is written, no audit entry is recorded, and collaborators are not notified.",
|
||
"schema": {
|
||
"description": "Validate and lint without persisting. The response is identical to the committed write of the same body, so a caller can inspect `lint` and then re-send the request for real. Nothing is written, no audit entry is recorded, and collaborators are not notified.",
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "A batch of semantic edits against a workflow graph.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ApplyWorkflowOperationsRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The batch was applied.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ApplyWorkflowOperationsResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/variables": {
|
||
"patch": {
|
||
"operationId": "applyWorkflowVariables",
|
||
"summary": "Update Workflow Variables",
|
||
"description": "Add, edit, and delete a workflow’s variables. Operations are matched by variable `name` and applied in order; a batch that changes nothing answers `200` with `changed: false`. Values are coerced to the declared `type`, and a value that cannot be coerced is stored as supplied. Read the current set from `variables` on `GET /workflows/{workflowId}`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Additions, edits, and deletions against a workflow’s variables.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ApplyWorkflowVariablesRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The variable set after the batch.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ApplyWorkflowVariablesResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/duplicate": {
|
||
"post": {
|
||
"operationId": "duplicateWorkflow",
|
||
"summary": "Duplicate Workflow",
|
||
"description": "Copy a workflow, including its blocks, edges, subflows, and variables, into the same workspace. Omitting `name` reuses the source name; a collision inside the destination folder is deduplicated rather than refused. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Optional name and destination folder for the copy.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DuplicateWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"201": {
|
||
"description": "The created copy.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DuplicateWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/restore": {
|
||
"post": {
|
||
"operationId": "restoreWorkflow",
|
||
"summary": "Restore Workflow",
|
||
"description": "Bring an archived workflow back, along with the schedules, webhooks, MCP tools, and chats that were archived with it. A workflow that is not archived answers `409`. A workflow whose folder was archived is restored to the workspace root. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The restored workflow.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RestoreWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/move": {
|
||
"post": {
|
||
"operationId": "moveWorkflows",
|
||
"summary": "Move Workflows",
|
||
"description": "Relocate up to 100 workflows into one folder. Explicitly best-effort: each workflow moves in its own transaction, and one that is absent from the workspace, archived, or locked lands in `failed` while the rest still move. Duplicate ids are collapsed. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Workflows to relocate and the folder to relocate them into.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/MoveWorkflowsRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Which workflows moved and which did not.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/MoveWorkflowsResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}": {
|
||
"get": {
|
||
"operationId": "getWorkflow",
|
||
"summary": "Get Workflow",
|
||
"description": "Get a workflow with its variables and deployed API-trigger inputs. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The requested workflow.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowDetailResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"patch": {
|
||
"operationId": "updateWorkflowV2",
|
||
"summary": "Update Workflow",
|
||
"description": "Rename, describe, or move a workflow to a canonical folder path. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Fields to update on an existing workflow.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UpdateWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The updated workflow.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UpdateWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"operationId": "deleteWorkflowV2",
|
||
"summary": "Delete Workflow",
|
||
"description": "Archive a workflow. Despite the verb, this is not an erasure: the workflow, and the schedules, webhooks, MCP tools, and chats attached to it, are stamped archived and stop running, and `POST /workflows/{workflowId}/restore` brings all of them back. An archived workflow disappears from the default list and is reachable with `scope=archived`. The `deleted` field is retained for shipped clients; `archived` states what actually happened.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow was archived.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DeleteWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/versions": {
|
||
"get": {
|
||
"operationId": "listWorkflowVersionsV2",
|
||
"summary": "List Workflow Versions",
|
||
"description": "List immutable deployment versions of a workflow, newest first.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
},
|
||
{
|
||
"name": "limit",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Maximum deployment versions to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"schema": {
|
||
"default": 50,
|
||
"description": "Maximum deployment versions to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 100
|
||
}
|
||
},
|
||
{
|
||
"name": "cursor",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"schema": {
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "A page of deployment versions.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowVersionListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/versions/{version}": {
|
||
"get": {
|
||
"operationId": "getWorkflowVersionV2",
|
||
"summary": "Get Workflow Version",
|
||
"description": "Get an immutable deployment version and its pinned workflow graph snapshot.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "version",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Numeric deployment version.",
|
||
"schema": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 2147483647,
|
||
"description": "Numeric deployment version.",
|
||
"examples": [3]
|
||
}
|
||
},
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The requested deployment version.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowVersionDetailResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"patch": {
|
||
"operationId": "updateWorkflowVersionV2",
|
||
"summary": "Update Workflow Version",
|
||
"description": "Relabel a deployment version. Merge-patch shaped: an omitted key is unchanged and `description: null` clears the release note. Metadata only — the pinned graph is immutable, and this never changes which version is live. Promote a version with `POST /workflows/{workflowId}/versions/{version}/activate`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "version",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Numeric deployment version.",
|
||
"schema": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 2147483647,
|
||
"description": "Numeric deployment version.",
|
||
"examples": [3]
|
||
}
|
||
},
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Merge-patch body for the mutable metadata of a deployment version.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UpdateWorkflowVersionRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The updated version metadata.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UpdateWorkflowVersionResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/versions/{version}/activate": {
|
||
"post": {
|
||
"operationId": "activateWorkflowVersion",
|
||
"summary": "Activate Workflow Version",
|
||
"description": "Promote an existing deployment version to live. Activation is asynchronous; inspect `isDeployed` and `latestDeploymentAttempt` for current state. Unlike `rollback`, the target is named by the path and the workflow need not already be deployed. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "version",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Numeric deployment version.",
|
||
"schema": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 2147483647,
|
||
"description": "Numeric deployment version.",
|
||
"examples": [3]
|
||
}
|
||
},
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": false,
|
||
"description": "No body. The version to promote is named by the request path.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ActivateWorkflowVersionRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The accepted activation attempt.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ActivateWorkflowVersionResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/versions/{version}/revert": {
|
||
"post": {
|
||
"operationId": "revertWorkflowVersion",
|
||
"summary": "Revert Workflow To Version",
|
||
"description": "Overwrite the editable draft with the graph pinned by a deployment version, discarding every unsaved edit. This is the most destructive operation in the deployment family and it does **not** change what is live — to move production, use `activate` or `rollback`, both of which leave the draft alone. Pass `active` as the version to discard draft edits and return to the live graph. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "version",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Numeric deployment version, or `active` for the currently live version.",
|
||
"schema": {
|
||
"anyOf": [
|
||
{
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 2147483647
|
||
},
|
||
{
|
||
"type": "string",
|
||
"const": "active"
|
||
}
|
||
],
|
||
"description": "Numeric deployment version, or `active` for the currently live version.",
|
||
"examples": [3, "active"]
|
||
}
|
||
},
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": false,
|
||
"description": "No body. The version to load into the draft is named by the request path.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RevertWorkflowVersionRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The draft after it was overwritten.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RevertWorkflowVersionResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/deployment": {
|
||
"get": {
|
||
"operationId": "getWorkflowDeployment",
|
||
"summary": "Get Workflow Deployment",
|
||
"description": "Read the current deployment state of a workflow: whether a version is live, when it went live, the most recent deployment attempt with its readiness and failure payload, and whether the editable draft has since diverged from the live version. This is the only operation that publishes `needsRedeployment` and `isPublicApi`.\n\n`isPublicApi` is the security-relevant one: while it is `true` the deployed workflow executes without an API key, so anyone holding the execution URL can run it — and consume the workspace’s billed usage — anonymously. It is set through `PATCH /workflows/{workflowId}/deployment`, and this read is the only way to audit whether it is on.\n\nNot to be confused with `/workflows/{workflowId}/deployments/chat`, which is the hosted chat the workflow is published as. This path governs whether the workflow is executable at all; that one governs one surface it is served on. A workflow can be deployed with no chat, and removing its chat leaves it deployed and executable.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The current deployment state.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowDeploymentResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"patch": {
|
||
"operationId": "updateWorkflowPublicApi",
|
||
"summary": "Update Workflow Public API Access",
|
||
"description": "Enable or disable unauthenticated public execution of the deployed workflow. While enabled, anyone holding the execution URL can run the workflow without an API key. An organization that forbids public sharing refuses this with `403` and `PUBLIC_SHARING_NOT_ALLOWED`. Not to be confused with `/workflows/{workflowId}/deployments/chat`, which is the hosted chat the workflow is published as. This path governs whether the workflow is executable at all; that one governs one surface it is served on. A workflow can be deployed with no chat, and removing its chat leaves it deployed and executable. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Enable or disable unauthenticated public execution of the deployed workflow.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UpdateWorkflowPublicApiRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The updated public API setting.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UpdateWorkflowPublicApiResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/deploy": {
|
||
"post": {
|
||
"operationId": "deployWorkflow",
|
||
"summary": "Deploy Workflow",
|
||
"description": "Create and asynchronously activate a deployment version. Not idempotent: every call mints a new version, so a retry after a timeout creates a second one. A deployment that would conflict with an existing webhook path is a `409`. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": false,
|
||
"description": "Optional metadata for the new deployment version.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DeployWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The accepted deployment attempt.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DeployWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"operationId": "undeployWorkflow",
|
||
"summary": "Undeploy Workflow",
|
||
"description": "Deactivate the currently serving workflow version. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow was undeployed.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/UndeployWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/rollback": {
|
||
"post": {
|
||
"operationId": "rollbackWorkflow",
|
||
"summary": "Rollback Workflow",
|
||
"description": "Asynchronously reactivate a previous deployment version, selecting the preceding active version when no version is supplied. Use this to step back from the currently live version; to make a specific version live by naming it in the path — including when the workflow is not currently deployed — use `POST /workflows/{workflowId}/versions/{version}/activate`. Neither touches the draft. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": false,
|
||
"description": "Optional deployment version to reactivate.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RollbackWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The accepted rollback attempt.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RollbackWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/export": {
|
||
"get": {
|
||
"operationId": "exportWorkflow",
|
||
"summary": "Export Workflow",
|
||
"description": "Export a portable, secret-sanitized workflow. Workspace-scoped bindings must be selected again after import. Exporting records an audit event, so it is not a safe read. A `HEAD` skips the effect but is authorized exactly as the `GET` is, so it answers `400`, `401`, `403`, or `404` wherever the `GET` would and an empty `200` otherwise. Skipping the effect means skipping the read that produces the payload, so that `200` carries none of the response headers documented below — it answers whether the `GET` would be allowed, not what the `GET` would return. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow export payload.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ExportWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/import": {
|
||
"post": {
|
||
"operationId": "importWorkflow",
|
||
"summary": "Import Workflow",
|
||
"description": "Create a workflow from a portable export object, bare state, or JSON string. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Portable workflow data and destination metadata for an import.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ImportWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"201": {
|
||
"description": "The imported workflow.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ImportWorkflowResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/chat-deployments": {
|
||
"get": {
|
||
"operationId": "listChatDeployments",
|
||
"summary": "List Chat Deployments",
|
||
"description": "List the workflows a workspace has published as hosted chats. Each entry carries the public `url` a visitor uses — there is no chat subdomain, the identifier is a path segment.\n\nThis is the only chat path not addressed under a workflow, and deliberately so: every chat is a singleton of the workflow it publishes, but \"what does this workspace serve\" is a question no per-workflow path can answer. Filter by `workflowId` to resolve one workflow's chat without holding its id.\n\nEntries are deliberately narrower than the singleton read: `allowedEmails`, `hasPassword`, and `customizations` are available only from `GET /api/v2/workflows/{workflowId}/deployments/chat`, which requires workspace `admin`. That is what keeps this list callable at workspace `read` and by a workspace API key. A stored password is never returned by either.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workspaceId",
|
||
"in": "query",
|
||
"required": true,
|
||
"description": "Workspace whose chat deployments to list.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace whose chat deployments to list."
|
||
}
|
||
},
|
||
{
|
||
"name": "workflowId",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Restrict to deployments of one workflow.",
|
||
"schema": {
|
||
"description": "Restrict to deployments of one workflow.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
},
|
||
{
|
||
"name": "isActive",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Restrict to active or inactive deployments.",
|
||
"schema": {
|
||
"description": "Restrict to active or inactive deployments.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
{
|
||
"name": "sortBy",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Field used to sort the result.",
|
||
"schema": {
|
||
"default": "createdAt",
|
||
"description": "Field used to sort the result.",
|
||
"type": "string",
|
||
"enum": ["identifier", "createdAt", "updatedAt"]
|
||
}
|
||
},
|
||
{
|
||
"name": "sortOrder",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Sort direction.",
|
||
"schema": {
|
||
"default": "desc",
|
||
"description": "Sort direction.",
|
||
"type": "string",
|
||
"enum": ["asc", "desc"]
|
||
}
|
||
},
|
||
{
|
||
"name": "limit",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Maximum chat deployments to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"schema": {
|
||
"default": 50,
|
||
"description": "Maximum chat deployments to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 100
|
||
}
|
||
},
|
||
{
|
||
"name": "cursor",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"schema": {
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "A page of chat deployments.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ChatDeploymentListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/deployments/chat": {
|
||
"get": {
|
||
"operationId": "getWorkflowChatDeployment",
|
||
"summary": "Get Workflow Chat Deployment",
|
||
"description": "Read the hosted chat a workflow is published as. Answers `404` when the workflow publishes no chat. Not to be confused with `/workflows/{workflowId}/deployment` (singular), which is the workflow's own API deployment — its live version and whether the draft has drifted. That path governs whether the workflow is executable at all; this one governs the hosted chat it is served on. The chat is a singleton of its workflow, so it has no id of its own in any path and no separate create verb: `PUT` is create-or-replace and is the only write. The stored password is never returned — `hasPassword` reports only whether one is set. This carries the visitor gate — `authType`, `hasPassword`, and the `allowedEmails` allow-list — so it requires workspace `admin`, unlike the workspace-wide list. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow's chat deployment.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/GetWorkflowChatDeploymentResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"operationId": "replaceWorkflowChatDeployment",
|
||
"summary": "Create or Replace Workflow Chat Deployment",
|
||
"description": "Publish a workflow as a hosted chat, or replace the chat it already publishes. Not to be confused with `/workflows/{workflowId}/deployment` (singular), which is the workflow's own API deployment — its live version and whether the draft has drifted. That path governs whether the workflow is executable at all; this one governs the hosted chat it is served on. The chat is a singleton of its workflow, so it has no id of its own in any path and no separate create verb: `PUT` is create-or-replace and is the only write.\n\n**Replace, not merge.** The chat ends up as exactly what the body describes: an omitted optional field takes its platform default rather than whatever the previous chat carried, so sending the same body twice leaves the same result. `password` is therefore required whenever `authType` is `\"password\"` and rejected otherwise — it is write-only and never readable back, so carrying one over implicitly is the one place a replace would quietly stop meaning replace. `allowedEmails` follows the same rule: required and non-empty for `\"email\"` and `\"sso\"`, rejected for the modes that admit no allow-list. `customizations` is the one documented exception: it merges per field, so an omitted `imageUrl` keeps the stored one rather than clearing it, and customization keys this surface does not declare do not survive the write. That behaviour is shared with the in-app editor and the Copilot deploy tool, which both send partial objects.\n\nThis also deploys the workflow, because a chat serves the live version: a draft that has drifted is republished as part of the call. Two conditions answer `409` — an `identifier` another live chat already holds, and a workflow deployment attempt still preparing, which the caller can retry once it becomes active. `authType: \"public\"` leaves the chat open to anyone holding the URL. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "The complete desired state of a workflow's chat.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ReplaceChatDeploymentRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The published chat deployment.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ReplaceWorkflowChatDeploymentResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"operationId": "deleteWorkflowChatDeployment",
|
||
"summary": "Delete Workflow Chat Deployment",
|
||
"description": "Stop serving a workflow's hosted chat. Its URL stops answering and the identifier becomes free again. The workflow's own deployment is untouched and stays executable through the workflow API — to undeploy that, use `DELETE /workflows/{workflowId}/deploy`. A workspace API key is rejected with `403`; use a personal API key.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The chat deployment was removed.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DeleteWorkflowChatDeploymentResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/execute": {
|
||
"post": {
|
||
"operationId": "executeWorkflowV2",
|
||
"summary": "Execute Workflow",
|
||
"description": "Execute the active deployment by default, or select manual execution of the current saved workflow state with `run.source: \"manual\"`. Manual runs require a personal API key with current write access and support synchronous or Server-Sent Event execution only; workspace keys, anonymous public access, and async manual runs are rejected. A manual run can enter through one runnable trigger (including external integration/webhook triggers) or resume at a named block from the exact same-workflow run identified by `sourceRunId`; the server loads that run's persisted snapshot, which is never accepted from the request. Omit a trigger block id only when the saved workflow has exactly one runnable trigger. Public deployed workflows permit anonymous synchronous and streaming execution, while asynchronous deployed execution requires an API key. A synchronous run that exceeds its execution timeout returns HTTP 200 with `status: \"failed\"` and `error.code: \"TIMEOUT\"` rather than an HTTP error, so branch on `status`. Each option carries the modes it requires and the modes that reject it; a violated combination is a 400.",
|
||
"tags": ["Workflows"],
|
||
"security": [
|
||
{
|
||
"apiKey": []
|
||
},
|
||
{}
|
||
],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
},
|
||
{
|
||
"name": "x-run-id",
|
||
"in": "header",
|
||
"required": false,
|
||
"description": "Caller-supplied run identifier, available only to API-key callers. A one-shot uniqueness claim, NOT an idempotency key: reusing a value fails with `409` and `error.details.code: \"RUN_ID_CONFLICT\"` rather than replaying the original result. To retry safely, send a fresh value per attempt, or omit the header and let the server allocate one.",
|
||
"schema": {
|
||
"description": "Caller-supplied run identifier, available only to API-key callers. A one-shot uniqueness claim, NOT an idempotency key: reusing a value fails with `409` and `error.details.code: \"RUN_ID_CONFLICT\"` rather than replaying the original result. To retry safely, send a fresh value per attempt, or omit the header and let the server allocate one.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
}
|
||
},
|
||
{
|
||
"name": "x-sim-via",
|
||
"in": "header",
|
||
"required": false,
|
||
"description": "Comma-separated workflow identifiers naming the workflow-to-workflow call chain that led to this request. Each hop appends its own workflow id, and Sim sets it automatically; supply it yourself only when relaying an existing chain. A chain at the maximum depth is rejected with `409` and `error.details.code: \"CALL_CHAIN_DEPTH_EXCEEDED\"`.",
|
||
"schema": {
|
||
"description": "Comma-separated workflow identifiers naming the workflow-to-workflow call chain that led to this request. Each hop appends its own workflow id, and Sim sets it automatically; supply it yourself only when relaying an existing chain. A chain at the maximum depth is rejected with `409` and `error.details.code: \"CALL_CHAIN_DEPTH_EXCEEDED\"`.",
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Input, workflow-state selection, and execution-mode options. Each option carries the modes it requires and the modes that reject it; a violated combination is a 400.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ExecuteWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "A synchronous run result or Server-Sent Event stream.",
|
||
"headers": {
|
||
"X-Run-Id": {
|
||
"$ref": "#/components/headers/X-Run-Id"
|
||
},
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ExecuteWorkflowSyncResponse"
|
||
}
|
||
},
|
||
"text/event-stream": {
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"202": {
|
||
"description": "The asynchronous run was queued.",
|
||
"headers": {
|
||
"X-Run-Id": {
|
||
"$ref": "#/components/headers/X-Run-Id"
|
||
},
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ExecuteWorkflowQueuedResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"402": {
|
||
"$ref": "#/components/responses/UsageLimitExceeded"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/RunIdConflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"499": {
|
||
"$ref": "#/components/responses/ClientClosedRequest"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/runs": {
|
||
"get": {
|
||
"operationId": "listWorkflowRunsV2",
|
||
"summary": "List Workflow Runs",
|
||
"description": "List recorded runs of a workflow with filtering and opaque cursor pagination. Runs are hard-deleted once they pass the payer's log retention window, so an older run is simply absent rather than reported as removed. The window is 30 days from run start on the free plan, unbounded on Pro and Team, and set per organization on Enterprise with an optional per-workspace override.",
|
||
"tags": ["Workflow Runs"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
}
|
||
},
|
||
{
|
||
"name": "status",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Filter by run status.",
|
||
"schema": {
|
||
"description": "Filter by run status.",
|
||
"type": "string",
|
||
"enum": ["pending", "running", "completed", "failed", "cancelled", "paused"]
|
||
}
|
||
},
|
||
{
|
||
"name": "trigger",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Filter by trigger type.",
|
||
"schema": {
|
||
"description": "Filter by trigger type.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
},
|
||
{
|
||
"name": "startDate",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant.",
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
|
||
"description": "Only include runs started at or after this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
|
||
}
|
||
},
|
||
{
|
||
"name": "endDate",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant.",
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
|
||
"description": "Only include runs started at or before this UTC ISO 8601 timestamp, e.g. `2026-08-06T00:00:00Z`. A date without a time, or a timestamp carrying a UTC offset instead of `Z`, is rejected, as is year `0000`, which names no storable instant."
|
||
}
|
||
},
|
||
{
|
||
"name": "limit",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Maximum workflow runs to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"schema": {
|
||
"default": 50,
|
||
"description": "Maximum workflow runs to return per page. Must be a whole number from 1 to 100. Defaults to 50.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 100
|
||
}
|
||
},
|
||
{
|
||
"name": "cursor",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"schema": {
|
||
"description": "Opaque cursor from the previous page. Send it back with the same sort and filters; only `limit` may change. Change anything else and pagination must restart without a cursor.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
},
|
||
{
|
||
"name": "order",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Sort direction by run start time. This list is sortable only by run start time, so it takes `order` in place of `sortBy`/`sortOrder`, which it rejects.",
|
||
"schema": {
|
||
"default": "desc",
|
||
"description": "Sort direction by run start time. This list is sortable only by run start time, so it takes `order` in place of `sortBy`/`sortOrder`, which it rejects.",
|
||
"type": "string",
|
||
"enum": ["asc", "desc"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "A page of workflow runs.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowRunListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/runs/{runId}": {
|
||
"get": {
|
||
"operationId": "getWorkflowRunV2",
|
||
"summary": "Get Workflow Run",
|
||
"description": "Get current workflow run state, optionally including final and block outputs. With `includeOutput`, `files` lists the files the run produced, each with a `downloadPath`; add `includeFileBase64` to inline their bytes, which answers `413` naming the download path when a single file, or the run's inlined total, exceeds the 16 MiB ceiling. Because inlining reads object storage, this `GET` is not a safe read. A `HEAD` skips the effect but is authorized exactly as the `GET` is, so it answers `400`, `401`, `403`, or `404` wherever the `GET` would and an empty `200` otherwise. Skipping the effect means skipping the read that produces the payload, so that `200` carries none of the response headers documented below — it answers whether the `GET` would be allowed, not what the `GET` would return.",
|
||
"tags": ["Workflow Runs"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
},
|
||
{
|
||
"name": "runId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow run identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
}
|
||
},
|
||
{
|
||
"name": "includeOutput",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Include the final workflow output when true. It does not gate `blockOutputs`, which `selectedOutputs` selects on its own.",
|
||
"schema": {
|
||
"description": "Include the final workflow output when true. It does not gate `blockOutputs`, which `selectedOutputs` selects on its own.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
{
|
||
"name": "selectedOutputs",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Comma-separated block output references to include, as `blockId` or `blockId.path`. Block *names* are not resolved here — unlike the execute request, this resource reads a recorded run and matches ids only, so a name selects nothing and yields an empty `blockOutputs`.",
|
||
"schema": {
|
||
"description": "Comma-separated block output references to include, as `blockId` or `blockId.path`. Block *names* are not resolved here — unlike the execute request, this resource reads a recorded run and matches ids only, so a name selects nothing and yields an empty `blockOutputs`.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
{
|
||
"name": "includeFileBase64",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Inline each produced file's bytes as base64. Requires `includeOutput`. A file above the inline ceiling answers `413` naming its download path; fetch large files from `downloadPath` instead.",
|
||
"schema": {
|
||
"description": "Inline each produced file's bytes as base64. Requires `includeOutput`. A file above the inline ceiling answers `413` naming its download path; fetch large files from `downloadPath` instead.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
{
|
||
"name": "base64MaxBytes",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Per-file inline ceiling, lowering but never raising the server limit of 16 MiB.",
|
||
"schema": {
|
||
"description": "Per-file inline ceiling, lowering but never raising the server limit of 16 MiB.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 16777216
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow run status.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowRunStatusResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/runs/{runId}/files/{fileId}": {
|
||
"get": {
|
||
"operationId": "downloadWorkflowRunFileV2",
|
||
"summary": "Download Workflow Run File",
|
||
"description": "Download one file a run produced. The run resource reports the files a run emitted; address one of them by its `id` here. Run output carries `/api/files/serve/...` URLs that reject API keys, so this is the byte path out of a run for an API-key caller. Execution objects are not retained indefinitely, so a `404` for a file an older run produced is expected rather than a fault. Runs are hard-deleted once they pass the payer's log retention window, so an older run is simply absent rather than reported as removed. The window is 30 days from run start on the free plan, unbounded on Pro and Team, and set per organization on Enterprise with an optional per-workspace override. Downloading records an audit event, so it is not a safe read. A `HEAD` skips the effect but is authorized exactly as the `GET` is, so it answers `400`, `401`, `403`, or `404` wherever the `GET` would and an empty `200` otherwise. Skipping the effect means skipping the read that produces the payload, so that `200` carries none of the response headers documented below — it answers whether the `GET` would be allowed, not what the `GET` would return. In particular a `HEAD` does not report `Content-Length`, so it cannot be used to size a download in advance; read the size from the file resource instead.",
|
||
"tags": ["Workflow Runs"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
},
|
||
{
|
||
"name": "runId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow run identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
}
|
||
},
|
||
{
|
||
"name": "fileId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Identifier of a file the run produced, as reported by the run resource.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 256,
|
||
"description": "Identifier of a file the run produced, as reported by the run resource."
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The run file bytes.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
},
|
||
"Content-Type": {
|
||
"$ref": "#/components/headers/Content-Type"
|
||
},
|
||
"Content-Disposition": {
|
||
"$ref": "#/components/headers/Content-Disposition"
|
||
},
|
||
"Content-Length": {
|
||
"$ref": "#/components/headers/Content-Length"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/octet-stream": {
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "binary"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/runs/{runId}/resume": {
|
||
"post": {
|
||
"operationId": "resumeWorkflowRunV2",
|
||
"summary": "Resume Workflow Run",
|
||
"description": "Resume one human-in-the-loop pause context. The resumed attempt receives a new run identifier and may complete synchronously or return a queue receipt.",
|
||
"tags": ["Workflow Runs"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
},
|
||
{
|
||
"name": "runId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow run identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
}
|
||
}
|
||
],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Pause context and optional input used to resume a workflow run.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ResumeWorkflowRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The resumed workflow attempt completed synchronously.",
|
||
"headers": {
|
||
"X-Run-Id": {
|
||
"$ref": "#/components/headers/X-Run-Id"
|
||
},
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ResumeWorkflowSyncResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"202": {
|
||
"description": "The resumed workflow attempt was queued.",
|
||
"headers": {
|
||
"X-Run-Id": {
|
||
"$ref": "#/components/headers/X-Run-Id"
|
||
},
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/ResumeWorkflowQueuedResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"402": {
|
||
"$ref": "#/components/responses/UsageLimitExceeded"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/{workflowId}/runs/{runId}/cancel": {
|
||
"post": {
|
||
"operationId": "cancelRunV2",
|
||
"summary": "Cancel Workflow Run",
|
||
"description": "Request cancellation of a running, queued, or paused workflow run. Cancelling a run already in a terminal state succeeds with no effect. A run produced by a table workflow group is a `409` when its cell can no longer accept the cancellation.",
|
||
"tags": ["Workflow Runs"],
|
||
"parameters": [
|
||
{
|
||
"name": "workflowId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Unique workflow identifier."
|
||
}
|
||
},
|
||
{
|
||
"name": "runId",
|
||
"in": "path",
|
||
"required": true,
|
||
"description": "Unique workflow run identifier.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The cancellation outcome.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/CancelWorkflowRunResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/v2/workflows/folders": {
|
||
"get": {
|
||
"operationId": "listWorkflowsFolders",
|
||
"summary": "List Workflow Folders",
|
||
"description": "List canonical workflow folders in a workspace. The bounded set is returned in one page; `nextCursor` is always null. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workspaceId",
|
||
"in": "query",
|
||
"required": true,
|
||
"description": "Workspace whose folders should be listed.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace whose folders should be listed."
|
||
}
|
||
},
|
||
{
|
||
"name": "parentPath",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Restrict results to direct children of this parent path.",
|
||
"schema": {
|
||
"description": "Restrict results to direct children of this parent path.",
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
}
|
||
},
|
||
{
|
||
"name": "search",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Case-insensitive substring match against the folder name.",
|
||
"schema": {
|
||
"description": "Case-insensitive substring match against the folder name.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 200
|
||
}
|
||
},
|
||
{
|
||
"name": "sortBy",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order.",
|
||
"schema": {
|
||
"default": "name",
|
||
"description": "Field used to sort the result. Sorting by `name` is case-sensitive and follows the storage collation, so do not rely on a case-insensitive order.",
|
||
"type": "string",
|
||
"enum": ["name", "createdAt", "updatedAt"]
|
||
}
|
||
},
|
||
{
|
||
"name": "sortOrder",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Sort direction.",
|
||
"schema": {
|
||
"default": "asc",
|
||
"description": "Sort direction.",
|
||
"type": "string",
|
||
"enum": ["asc", "desc"]
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "A list of workflow folders.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/WorkflowFolderListResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"operationId": "createWorkflowsFolder",
|
||
"summary": "Create Workflow Folder",
|
||
"description": "Create a canonical workflow folder in a workspace. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Workspace and canonical path for a new workflow folder.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/CreateWorkflowFolderRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"201": {
|
||
"description": "The created workflow folder.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/CreateWorkflowFolderResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"patch": {
|
||
"operationId": "relocateWorkflowsFolder",
|
||
"summary": "Rename or Move Workflow Folder",
|
||
"description": "Rename or move a workflow folder and its descendants to a canonical path. A workspace folder tree over 10,000 folders is a `413`.",
|
||
"tags": ["Workflows"],
|
||
"requestBody": {
|
||
"required": true,
|
||
"description": "Current and destination paths for a workflow folder.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RelocateWorkflowFolderRequest"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "The relocated workflow folder.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/RelocateWorkflowFolderResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"415": {
|
||
"$ref": "#/components/responses/UnsupportedMediaType"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"operationId": "deleteWorkflowsFolder",
|
||
"summary": "Delete Workflow Folder",
|
||
"description": "Delete a workflow folder, optionally including its descendants and workflows.",
|
||
"tags": ["Workflows"],
|
||
"parameters": [
|
||
{
|
||
"name": "workspaceId",
|
||
"in": "query",
|
||
"required": true,
|
||
"description": "Workspace containing the folder.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace containing the folder."
|
||
}
|
||
},
|
||
{
|
||
"name": "path",
|
||
"in": "query",
|
||
"required": true,
|
||
"description": "Path of the folder to delete.",
|
||
"schema": {
|
||
"description": "Path of the folder to delete.",
|
||
"$ref": "#/components/schemas/NonRootFolderPathInput"
|
||
}
|
||
},
|
||
{
|
||
"name": "recursive",
|
||
"in": "query",
|
||
"required": false,
|
||
"description": "Delete the folder's nested files and folders too. An empty folder deletes either way; a non-empty one needs this. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected.",
|
||
"schema": {
|
||
"description": "Delete the folder's nested files and folders too. An empty folder deletes either way; a non-empty one needs this. The listed spellings are the whole accepted vocabulary and are case-sensitive; any other value is rejected.",
|
||
"enum": [
|
||
"true",
|
||
"1",
|
||
"yes",
|
||
"on",
|
||
"y",
|
||
"enabled",
|
||
"false",
|
||
"0",
|
||
"no",
|
||
"off",
|
||
"n",
|
||
"disabled"
|
||
],
|
||
"default": "false",
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "The workflow folder was deleted.",
|
||
"headers": {
|
||
"X-RateLimit-Limit": {
|
||
"$ref": "#/components/headers/X-RateLimit-Limit"
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"$ref": "#/components/headers/X-RateLimit-Remaining"
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"$ref": "#/components/headers/X-RateLimit-Reset"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/DeleteWorkflowFolderResponse"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"400": {
|
||
"$ref": "#/components/responses/BadRequest"
|
||
},
|
||
"401": {
|
||
"$ref": "#/components/responses/Unauthorized"
|
||
},
|
||
"403": {
|
||
"$ref": "#/components/responses/Forbidden"
|
||
},
|
||
"404": {
|
||
"$ref": "#/components/responses/NotFound"
|
||
},
|
||
"409": {
|
||
"$ref": "#/components/responses/Conflict"
|
||
},
|
||
"413": {
|
||
"$ref": "#/components/responses/PayloadTooLarge"
|
||
},
|
||
"423": {
|
||
"$ref": "#/components/responses/Locked"
|
||
},
|
||
"429": {
|
||
"$ref": "#/components/responses/RateLimited"
|
||
},
|
||
"500": {
|
||
"$ref": "#/components/responses/InternalError"
|
||
},
|
||
"503": {
|
||
"$ref": "#/components/responses/ServiceUnavailable"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"components": {
|
||
"securitySchemes": {
|
||
"apiKey": {
|
||
"type": "apiKey",
|
||
"in": "header",
|
||
"name": "X-API-Key",
|
||
"description": "Your Sim API key, personal or workspace-scoped. Generate one under Settings, then API Keys. Operations that reject workspace keys say so in their own description."
|
||
}
|
||
},
|
||
"headers": {
|
||
"Content-Type": {
|
||
"description": "MIME type of the file, defaulting to application/octet-stream when the stored type is unavailable.",
|
||
"schema": {
|
||
"type": "string",
|
||
"title": "Content type",
|
||
"description": "MIME type of the file, defaulting to application/octet-stream when the stored type is unavailable."
|
||
}
|
||
},
|
||
"Content-Disposition": {
|
||
"description": "Attachment disposition containing sanitized and RFC 5987 encoded filenames.",
|
||
"schema": {
|
||
"type": "string",
|
||
"title": "Content disposition",
|
||
"description": "Attachment disposition containing sanitized and RFC 5987 encoded filenames."
|
||
}
|
||
},
|
||
"Content-Length": {
|
||
"description": "File size in bytes.",
|
||
"schema": {
|
||
"type": "string",
|
||
"pattern": "^(0|[1-9]\\d*)$",
|
||
"title": "Content length",
|
||
"description": "File size in bytes."
|
||
}
|
||
},
|
||
"X-RateLimit-Limit": {
|
||
"description": "Maximum requests allowed in the current window.",
|
||
"schema": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"title": "Rate limit",
|
||
"description": "Maximum requests allowed in the current window."
|
||
}
|
||
},
|
||
"X-RateLimit-Remaining": {
|
||
"description": "Requests remaining in the current window.",
|
||
"schema": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"title": "Rate limit remaining",
|
||
"description": "Requests remaining in the current window."
|
||
}
|
||
},
|
||
"X-RateLimit-Reset": {
|
||
"description": "ISO 8601 timestamp when the current rate-limit window resets.",
|
||
"schema": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
|
||
"title": "Rate limit reset",
|
||
"description": "ISO 8601 timestamp when the current rate-limit window resets."
|
||
}
|
||
},
|
||
"Retry-After": {
|
||
"description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset.",
|
||
"schema": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"title": "Retry after",
|
||
"description": "Seconds to wait before retrying, sent on `429` and `503`. Add jitter rather than retrying at exactly this offset."
|
||
}
|
||
},
|
||
"X-Run-Id": {
|
||
"description": "Identifier assigned to the workflow run.",
|
||
"schema": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"title": "Run identifier",
|
||
"description": "Identifier assigned to the workflow run."
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"BadRequest": {
|
||
"description": "The request is invalid. This includes a query parameter sent with no value (`?limit=`, `?search=`), which is rejected rather than read as zero, empty, or the parameter default — omit the parameter instead.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "BAD_REQUEST",
|
||
"message": "Invalid request"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"Unauthorized": {
|
||
"description": "The API key is missing or invalid.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "UNAUTHORIZED",
|
||
"message": "API key required"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"UsageLimitExceeded": {
|
||
"description": "The workspace has exceeded its usage or billing limits.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "USAGE_LIMIT_EXCEEDED",
|
||
"message": "Usage limit exceeded. Please upgrade your plan to continue."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"Forbidden": {
|
||
"description": "The caller lacks the rights this operation requires. When the cause is one a caller can act on, `error.details.code` names it. A resource in a workspace the caller cannot reach at all answers `404` instead, so absence and denial are indistinguishable.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "FORBIDDEN",
|
||
"message": "Insufficient workspace permissions",
|
||
"details": {
|
||
"code": "INSUFFICIENT_WORKSPACE_ROLE"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"NotFound": {
|
||
"description": "The requested resource was not found.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "NOT_FOUND",
|
||
"message": "Not found"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"Conflict": {
|
||
"description": "The request conflicts with current resource state.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "CONFLICT",
|
||
"message": "Webhook path already in use"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"RunIdConflict": {
|
||
"description": "The run cannot be started, for one of two causes named by `error.details.code`: `RUN_ID_CONFLICT` when the supplied `X-Run-Id` is already claimed, and `CALL_CHAIN_DEPTH_EXCEEDED` when the incoming `X-Sim-Via` chain has reached the maximum workflow-to-workflow call depth.",
|
||
"headers": {
|
||
"X-Run-Id": {
|
||
"$ref": "#/components/headers/X-Run-Id"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "CONFLICT",
|
||
"message": "Run ID has already been used",
|
||
"details": {
|
||
"code": "RUN_ID_CONFLICT",
|
||
"runId": "0f7c1a2e-9b3d-4c58-8a21-6d4e5f7a9b01"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"PayloadTooLarge": {
|
||
"description": "The request, or a resource collection it must materialize, exceeds the allowed size: an oversized request body, a generated artifact past the download ceiling, or a workspace folder tree too large to load in full.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "PAYLOAD_TOO_LARGE",
|
||
"message": "Request body is too large"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"UnsupportedMediaType": {
|
||
"description": "The request uses an unsupported media type.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "UNSUPPORTED_MEDIA_TYPE",
|
||
"message": "Request body must be sent as application/json"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"Locked": {
|
||
"description": "The resource is locked and cannot be modified.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "LOCKED",
|
||
"message": "Workflow is locked"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"RateLimited": {
|
||
"description": "The caller exceeded the request rate limit.",
|
||
"headers": {
|
||
"Retry-After": {
|
||
"$ref": "#/components/headers/Retry-After"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "RATE_LIMITED",
|
||
"message": "API rate limit exceeded",
|
||
"details": {
|
||
"retryAfter": "2026-01-01T00:00:30.000Z"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"ClientClosedRequest": {
|
||
"description": "The client closed the connection before the response was produced. An abort can leave the run going, so `error.details.runId` carries the run id — reconcile against the runs resource rather than starting another run.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "CLIENT_CLOSED_REQUEST",
|
||
"message": "Client cancelled request",
|
||
"details": {
|
||
"runId": "0f7c1a2e-9b3d-4c58-8a21-6d4e5f7a9b01"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"InternalError": {
|
||
"description": "An unexpected server error occurred.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "INTERNAL_ERROR",
|
||
"message": "Internal server error"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"ServiceUnavailable": {
|
||
"description": "A required service is temporarily unavailable. `Retry-After` carries the seconds to wait; treat it as a floor and add jitter. The header is omitted when `error.details.code` is `ASYNC_ENQUEUE_AMBIGUOUS`, because the run may already have started — reconcile against the returned run id instead of retrying.",
|
||
"headers": {
|
||
"Retry-After": {
|
||
"$ref": "#/components/headers/Retry-After"
|
||
}
|
||
},
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"$ref": "#/components/schemas/V2Error"
|
||
},
|
||
"example": {
|
||
"error": {
|
||
"code": "SERVICE_UNAVAILABLE",
|
||
"message": "Service temporarily unavailable"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"schemas": {
|
||
"V2Error": {
|
||
"type": "object",
|
||
"properties": {
|
||
"error": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "string",
|
||
"description": "Stable machine-readable error code."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"description": "Human-readable explanation of the error."
|
||
},
|
||
"details": {
|
||
"description": "Structured error details. On a `403` whose cause a caller can act on, this carries a `code` from a closed set:\n- `INSUFFICIENT_WORKSPACE_ROLE` — The caller has access to the workspace but its role is below the one this operation requires.\n- `PERSONAL_API_KEYS_DISABLED` — The workspace's organization does not allow personal API keys. Use a workspace API key.\n- `WORKSPACE_KEY_OPERATION_NOT_PERMITTED` — This operation is not available to a workspace-scoped API key. Use a personal API key.\n- `PRINCIPAL_KIND_NOT_PERMITTED` — This operation does not accept the caller’s kind of API key.\n- `ORGANIZATION_MEMBERSHIP_REQUIRED` — The caller is not a member of the organization it named.\n- `ORGANIZATION_ADMIN_REQUIRED` — The caller is a member of the organization but not an admin or owner.\n- `ENTERPRISE_PLAN_REQUIRED` — The organization has no active enterprise subscription.\n- `ORGANIZATION_PLAN_REQUIRED` — The organization has no active organization subscription (Pro for Teams, Max for Teams, or Enterprise).\n- `AUDIT_LOGS_DISABLED` — Audit logging is not enabled for this deployment.\n- `SKILL_EDITOR_ACCESS_REQUIRED` — The caller can write in the workspace but is not an editor of this skill.\n- `SECRET_ADMIN_ACCESS_REQUIRED` — The caller can write in the workspace but is not an admin of this secret. Ask a workspace admin, or someone holding admin on the secret, to grant access or set the value.\n- `WORKSPACE_RESOURCE_LIMIT_REACHED` — The workspace already holds the maximum number of resources of this kind. Delete one, or contact Sim to raise the limit; the message names the ceiling.\n- `PUBLIC_SHARING_NOT_ALLOWED` — The workspace's organization does not permit sharing this resource publicly. An organization admin controls the policy.\n- `CREDENTIAL_ADMIN_ACCESS_REQUIRED` — The caller can reach the workspace but cannot administer this credential.\n- `MCP_SERVER_URL_NOT_ALLOWED` — The supplied MCP server URL is outside the allowed domains or resolves to an internal address.\n- `WORKSPACE_PLAN_CAPABILITY_REQUIRED` — The workspace's plan does not include a capability this request depends on. The message names the capability; upgrading the workspace's plan is the remedy.\n- `CHAT_AUTH_MODE_NOT_PERMITTED` — The workspace's permission group does not allow the chat authentication mode the request selected. A mode already saved on the deployment may still be re-saved; changing to a disallowed one cannot.\n- `CONNECTOR_MANAGED_RESOURCE_READ_ONLY` — This resource is managed by a knowledge base connector and cannot be edited directly. Change it at the source and re-sync, or exclude the document from the connector."
|
||
}
|
||
},
|
||
"required": ["code", "message"],
|
||
"additionalProperties": false,
|
||
"description": "Canonical error details."
|
||
}
|
||
},
|
||
"required": ["error"],
|
||
"additionalProperties": false,
|
||
"title": "v2 error response",
|
||
"description": "Canonical error envelope returned by the public v2 API.",
|
||
"examples": [
|
||
{
|
||
"error": {
|
||
"code": "BAD_REQUEST",
|
||
"message": "The request is invalid."
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"FolderPathInput": {
|
||
"title": "Folder path input",
|
||
"description": "Folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as \"New folder\" is `/New%20folder`: everything outside `A-Z a-z 0-9 - _ . ~` is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal `.` or `..` segment are rejected. At most 64 segments and 4096 encoded bytes.",
|
||
"maxLength": 4096,
|
||
"type": "string"
|
||
},
|
||
"WorkflowListItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"webUrl": {
|
||
"type": "string",
|
||
"format": "uri",
|
||
"description": "Canonical absolute URL for opening this resource in the Sim web application."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Workflow name.",
|
||
"examples": ["Customer support triage"]
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Workflow description, or null when none is set."
|
||
},
|
||
"folderPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical containing-folder path; `/` is the workspace root.",
|
||
"maxLength": 4096,
|
||
"examples": ["/Operations"]
|
||
},
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"description": "Workspace that owns the workflow."
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether the workflow has an active deployment."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 activation timestamp, or null when not deployed.",
|
||
"format": "date-time"
|
||
},
|
||
"runCount": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Runs that finished successfully. Failed, cancelled, and paused runs are not counted, and the counter is never reduced when a run ages out of log retention — so it does not match the size of `GET /api/v2/workflows/{workflowId}/runs`, in either direction."
|
||
},
|
||
"lastRunAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp of the latest run counted by `runCount`, or null when none has been. Stamped by the same successful-run path, so a workflow whose only runs failed reports null here.",
|
||
"format": "date-time"
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was created.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was last updated.",
|
||
"format": "date-time"
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"webUrl",
|
||
"name",
|
||
"description",
|
||
"folderPath",
|
||
"workspaceId",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"runCount",
|
||
"lastRunAt",
|
||
"createdAt",
|
||
"updatedAt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Workflow summary",
|
||
"description": "Summary of a workflow and its deployment and run state."
|
||
},
|
||
"WorkflowListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowListItem"
|
||
},
|
||
"description": "Items in the current page."
|
||
},
|
||
"nextCursor": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Opaque cursor for the next page. Send it back as `cursor`; `null` means there is nothing further to fetch. Never construct one yourself."
|
||
}
|
||
},
|
||
"required": ["data", "nextCursor"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow list response",
|
||
"description": "A cursor-paginated page of workflow summaries.",
|
||
"examples": [
|
||
{
|
||
"data": [
|
||
{
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"webUrl": "https://www.sim.ai/workspace/a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64/w/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"folderPath": "/Operations",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"isDeployed": true,
|
||
"deployedAt": "2026-06-12T10:30:00.000Z",
|
||
"runCount": 42,
|
||
"lastRunAt": "2026-08-09T18:04:11.000Z",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z"
|
||
}
|
||
],
|
||
"nextCursor": null
|
||
}
|
||
]
|
||
},
|
||
"SeededWorkflowBlock": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Block identifier."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"description": "Registered block type."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Block display name."
|
||
}
|
||
},
|
||
"required": ["id", "type", "name"],
|
||
"additionalProperties": false,
|
||
"title": "Seeded workflow block",
|
||
"description": "A block the platform placed in a newly created workflow."
|
||
},
|
||
"CreateWorkflowResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"webUrl": {
|
||
"type": "string",
|
||
"format": "uri",
|
||
"description": "Canonical absolute URL for opening this resource in the Sim web application."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Workflow name.",
|
||
"examples": ["Customer support triage"]
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Workflow description, or null when none is set."
|
||
},
|
||
"folderPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical containing-folder path; `/` is the workspace root.",
|
||
"maxLength": 4096,
|
||
"examples": ["/Operations"]
|
||
},
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"description": "Workspace that owns the workflow."
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether the workflow has an active deployment."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 activation timestamp, or null when not deployed.",
|
||
"format": "date-time"
|
||
},
|
||
"runCount": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Runs that finished successfully. Failed, cancelled, and paused runs are not counted, and the counter is never reduced when a run ages out of log retention — so it does not match the size of `GET /api/v2/workflows/{workflowId}/runs`, in either direction."
|
||
},
|
||
"lastRunAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp of the latest run counted by `runCount`, or null when none has been. Stamped by the same successful-run path, so a workflow whose only runs failed reports null here.",
|
||
"format": "date-time"
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was created.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was last updated.",
|
||
"format": "date-time"
|
||
},
|
||
"blocks": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/SeededWorkflowBlock"
|
||
},
|
||
"description": "Blocks seeded into the new workflow. Contains the start block; attach edges to its `id`."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"webUrl",
|
||
"name",
|
||
"description",
|
||
"folderPath",
|
||
"workspaceId",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"runCount",
|
||
"lastRunAt",
|
||
"createdAt",
|
||
"updatedAt",
|
||
"blocks"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Create workflow result",
|
||
"description": "The created workflow and the blocks it was seeded with."
|
||
},
|
||
"CreateWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/CreateWorkflowResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Create workflow response",
|
||
"description": "The created workflow and the blocks it was seeded with.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"webUrl": "https://www.sim.ai/workspace/a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64/w/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"folderPath": "/Operations",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"isDeployed": false,
|
||
"deployedAt": null,
|
||
"runCount": 0,
|
||
"lastRunAt": null,
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z",
|
||
"blocks": [
|
||
{
|
||
"id": "start-1",
|
||
"type": "starter",
|
||
"name": "Start"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"CreateWorkflowRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace in which to create the workflow."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255,
|
||
"description": "Workflow name."
|
||
},
|
||
"description": {
|
||
"description": "Optional workflow description.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"maxLength": 50000
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"folderPath": {
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
}
|
||
},
|
||
"required": ["workspaceId", "name"],
|
||
"additionalProperties": false,
|
||
"title": "Create workflow request",
|
||
"description": "Name, description, workspace, and optional folder for a new workflow."
|
||
},
|
||
"WorkflowBlock": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block identifier, unique within the workflow."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"description": "Registered block type."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Block display name; must be unique within the workflow."
|
||
},
|
||
"position": {
|
||
"type": "object",
|
||
"properties": {
|
||
"x": {
|
||
"type": "number",
|
||
"description": "Canvas x coordinate."
|
||
},
|
||
"y": {
|
||
"type": "number",
|
||
"description": "Canvas y coordinate."
|
||
}
|
||
},
|
||
"required": ["x", "y"],
|
||
"additionalProperties": false,
|
||
"description": "Canvas coordinates of a block."
|
||
},
|
||
"subBlocks": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Sub-block identifier."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Sub-block input type."
|
||
},
|
||
"value": {
|
||
"description": "Configured value; shape depends on the sub-block type."
|
||
}
|
||
},
|
||
"required": ["id", "type", "value"],
|
||
"additionalProperties": false,
|
||
"description": "One configurable input on a block."
|
||
},
|
||
"description": "Configured inputs keyed by sub-block id."
|
||
},
|
||
"outputs": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "Declared shape of one output; depends on the block type."
|
||
},
|
||
"description": "Declared output shape keyed by output name."
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"description": "Whether the block runs."
|
||
},
|
||
"horizontalHandles": {
|
||
"description": "Whether edge handles render horizontally.",
|
||
"type": "boolean"
|
||
},
|
||
"height": {
|
||
"description": "Rendered block height.",
|
||
"type": "number"
|
||
},
|
||
"advancedMode": {
|
||
"description": "Whether the block is edited in advanced mode.",
|
||
"type": "boolean"
|
||
},
|
||
"errorEnabled": {
|
||
"description": "Whether the block exposes an error branch.",
|
||
"type": "boolean"
|
||
},
|
||
"retry": {
|
||
"type": "object",
|
||
"properties": {
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"description": "Whether the block retries on failure."
|
||
},
|
||
"maxTries": {
|
||
"type": "integer",
|
||
"minimum": 2,
|
||
"maximum": 5,
|
||
"description": "Total attempts, including the first."
|
||
},
|
||
"waitBetweenTriesMs": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 5000,
|
||
"description": "Delay between attempts, in milliseconds."
|
||
}
|
||
},
|
||
"required": ["enabled", "maxTries", "waitBetweenTriesMs"],
|
||
"additionalProperties": false,
|
||
"description": "Per-block retry configuration."
|
||
},
|
||
"triggerMode": {
|
||
"description": "Whether the block acts as the workflow trigger.",
|
||
"type": "boolean"
|
||
},
|
||
"data": {
|
||
"type": "object",
|
||
"properties": {
|
||
"parentId": {
|
||
"description": "Identifier of the containing loop or parallel.",
|
||
"type": "string"
|
||
},
|
||
"extent": {
|
||
"description": "Constrains the block to its parent bounds.",
|
||
"type": "string",
|
||
"const": "parent"
|
||
},
|
||
"width": {
|
||
"description": "Rendered container width.",
|
||
"type": "number"
|
||
},
|
||
"height": {
|
||
"description": "Rendered container height.",
|
||
"type": "number"
|
||
},
|
||
"collection": {
|
||
"description": "Items a forEach loop or collection parallel iterates."
|
||
},
|
||
"count": {
|
||
"description": "Iteration count for a `for` loop or count parallel.",
|
||
"type": "number"
|
||
},
|
||
"loopType": {
|
||
"description": "Loop container kind.",
|
||
"type": "string",
|
||
"enum": ["for", "forEach", "while", "doWhile"]
|
||
},
|
||
"whileCondition": {
|
||
"description": "Condition expression for a `while` loop.",
|
||
"type": "string"
|
||
},
|
||
"doWhileCondition": {
|
||
"description": "Condition expression for a `doWhile` loop.",
|
||
"type": "string"
|
||
},
|
||
"parallelType": {
|
||
"description": "Parallel container kind.",
|
||
"type": "string",
|
||
"enum": ["collection", "count"]
|
||
},
|
||
"batchSize": {
|
||
"description": "Maximum concurrent branches of a parallel.",
|
||
"type": "number"
|
||
},
|
||
"type": {
|
||
"description": "Container subtype.",
|
||
"type": "string"
|
||
},
|
||
"canonicalModes": {
|
||
"description": "Per-field editing mode, keyed by canonical parameter id.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"type": "string",
|
||
"enum": ["basic", "advanced"]
|
||
}
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"description": "Container and layout metadata carried by a block."
|
||
},
|
||
"locked": {
|
||
"description": "Whether the block is locked against edits.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["id", "type", "name", "position", "subBlocks", "outputs", "enabled"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow block",
|
||
"description": "One node of a workflow graph and its configuration."
|
||
},
|
||
"WorkflowEdge": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Edge identifier, unique within the workflow."
|
||
},
|
||
"source": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Source block id."
|
||
},
|
||
"target": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Target block id."
|
||
},
|
||
"sourceHandle": {
|
||
"description": "Source port, or null for the block default.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"targetHandle": {
|
||
"description": "Target port, or null for the block default.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"type": {
|
||
"description": "Edge renderer type.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["id", "source", "target"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow edge",
|
||
"description": "A directed connection between two blocks."
|
||
},
|
||
"WorkflowLoop": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Loop container identifier; equal to the loop block id."
|
||
},
|
||
"nodes": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Block ids inside the loop."
|
||
},
|
||
"iterations": {
|
||
"type": "number",
|
||
"description": "Resolved iteration count."
|
||
},
|
||
"loopType": {
|
||
"type": "string",
|
||
"enum": ["for", "forEach", "while", "doWhile"],
|
||
"description": "Loop kind."
|
||
},
|
||
"forEachItems": {
|
||
"description": "Items a forEach loop iterates, or the expression producing them.",
|
||
"anyOf": [
|
||
{
|
||
"type": "array",
|
||
"items": {
|
||
"description": "One item the loop iterates."
|
||
}
|
||
},
|
||
{
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "One item the loop iterates."
|
||
}
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"whileCondition": {
|
||
"description": "Condition expression for a `while` loop.",
|
||
"type": "string"
|
||
},
|
||
"doWhileCondition": {
|
||
"description": "Condition expression for a `doWhile` loop.",
|
||
"type": "string"
|
||
},
|
||
"enabled": {
|
||
"description": "Whether the loop runs.",
|
||
"type": "boolean"
|
||
},
|
||
"locked": {
|
||
"description": "Whether the loop is locked against edits.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["id", "nodes", "iterations", "loopType"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow loop",
|
||
"description": "A loop container derived from the workflow blocks."
|
||
},
|
||
"WorkflowParallel": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Parallel container identifier; equal to the parallel block id."
|
||
},
|
||
"nodes": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Block ids inside the parallel."
|
||
},
|
||
"distribution": {
|
||
"description": "Items distributed across branches, or the expression producing them.",
|
||
"anyOf": [
|
||
{
|
||
"type": "array",
|
||
"items": {
|
||
"description": "One item distributed to a branch."
|
||
}
|
||
},
|
||
{
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "One item distributed to a branch."
|
||
}
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"count": {
|
||
"description": "Fixed branch count.",
|
||
"type": "number"
|
||
},
|
||
"parallelType": {
|
||
"description": "Parallel kind.",
|
||
"type": "string",
|
||
"enum": ["count", "collection"]
|
||
},
|
||
"batchSize": {
|
||
"description": "Maximum concurrent branches.",
|
||
"type": "number"
|
||
},
|
||
"enabled": {
|
||
"description": "Whether the parallel runs.",
|
||
"type": "boolean"
|
||
},
|
||
"locked": {
|
||
"description": "Whether the parallel is locked against edits.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["id", "nodes"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow parallel",
|
||
"description": "A parallel container derived from the workflow blocks."
|
||
},
|
||
"WorkflowVariable": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Variable identifier."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Variable name, referenced from block inputs."
|
||
},
|
||
"type": {
|
||
"default": "string",
|
||
"description": "Declared variable type.",
|
||
"type": "string",
|
||
"enum": ["string", "number", "boolean", "object", "array", "plain"]
|
||
},
|
||
"value": {
|
||
"description": "Variable value; free-form and validated per `type` at use time."
|
||
}
|
||
},
|
||
"required": ["id", "name", "type", "value"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow variable",
|
||
"description": "A workflow-scoped variable."
|
||
},
|
||
"WorkflowGraph": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blocks": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowBlock"
|
||
},
|
||
"description": "Blocks keyed by block id."
|
||
},
|
||
"edges": {
|
||
"maxItems": 10000,
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowEdge"
|
||
},
|
||
"description": "Directed connections between blocks."
|
||
},
|
||
"loops": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowLoop"
|
||
},
|
||
"description": "Loop containers keyed by container id; always present, `{}` when there are none."
|
||
},
|
||
"parallels": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowParallel"
|
||
},
|
||
"description": "Parallel containers keyed by container id; always present, `{}` when there are none."
|
||
},
|
||
"variables": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowVariable"
|
||
},
|
||
"description": "Workflow variables keyed by variable id; always present, `{}` when there are none."
|
||
}
|
||
},
|
||
"required": ["blocks", "edges", "loops", "parallels", "variables"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow graph",
|
||
"description": "The editable draft graph of a workflow: blocks, edges, derived loop and parallel containers, and variables."
|
||
},
|
||
"WorkflowStateResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowGraph"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow state response",
|
||
"description": "The editable draft graph of a workflow.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"blocks": {},
|
||
"edges": [],
|
||
"loops": {},
|
||
"parallels": {},
|
||
"variables": {}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowLintReport": {
|
||
"type": "object",
|
||
"properties": {
|
||
"sources": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockName", "blockType"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Blocks with no incoming edge. A trigger block is naturally a source; anything else here is unreachable."
|
||
},
|
||
"sinks": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockName", "blockType"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Blocks with no outgoing edge."
|
||
},
|
||
"orphanBlocks": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockName", "blockType"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Blocks with neither an incoming nor an outgoing edge."
|
||
},
|
||
"emptyOutgoingPorts": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
},
|
||
"handle": {
|
||
"type": "string",
|
||
"description": "Source handle with nothing connected to it."
|
||
},
|
||
"label": {
|
||
"type": "string",
|
||
"description": "Human-readable name of the port."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockName", "blockType", "handle", "label"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Branch and container ports that lead nowhere."
|
||
},
|
||
"invalidBranchPorts": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
},
|
||
"sourceHandle": {
|
||
"type": "string",
|
||
"description": "Source handle that does not match the block."
|
||
},
|
||
"reason": {
|
||
"type": "string",
|
||
"description": "Why the handle is not valid for this block."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockName", "blockType", "sourceHandle", "reason"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Condition and router edges whose source handle names no real branch."
|
||
},
|
||
"invalidConnectionTargets": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"sourceBlockId": {
|
||
"type": "string",
|
||
"description": "Block the edge leaves."
|
||
},
|
||
"sourceBlockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the source block."
|
||
},
|
||
"sourceHandle": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Handle the edge leaves from."
|
||
},
|
||
"targetBlockId": {
|
||
"type": "string",
|
||
"description": "Block the edge points at."
|
||
},
|
||
"reason": {
|
||
"type": "string",
|
||
"description": "Why the target is not a legal destination."
|
||
}
|
||
},
|
||
"required": [
|
||
"sourceBlockId",
|
||
"sourceBlockName",
|
||
"sourceHandle",
|
||
"targetBlockId",
|
||
"reason"
|
||
],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Edges pointing at a block that cannot legally receive them."
|
||
},
|
||
"fieldIssues": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
},
|
||
"missingRequiredFields": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Required sub-block fields that resolve empty in the active mode."
|
||
},
|
||
"inactiveModeValues": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"canonicalId": {
|
||
"type": "string",
|
||
"description": "Canonical parameter the two sub-block modes share."
|
||
},
|
||
"activeMemberId": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Sub-block the runtime reads, where the value should live."
|
||
},
|
||
"inactiveMemberId": {
|
||
"type": "string",
|
||
"description": "Sub-block holding the stranded value, which the runtime ignores."
|
||
},
|
||
"kind": {
|
||
"type": "string",
|
||
"enum": ["credential", "resource", "other"],
|
||
"description": "What kind of value is stranded."
|
||
}
|
||
},
|
||
"required": ["canonicalId", "activeMemberId", "inactiveMemberId", "kind"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Values stranded on the inactive member of a canonical pair."
|
||
}
|
||
},
|
||
"required": [
|
||
"blockId",
|
||
"blockName",
|
||
"blockType",
|
||
"missingRequiredFields",
|
||
"inactiveModeValues"
|
||
],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Per-block configuration problems. The most actionable part of the report for a headless graph builder: a block missing a required field will fail at run time."
|
||
},
|
||
"unresolvedReferences": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the finding is about."
|
||
},
|
||
"blockName": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Display name of the block, when it has one."
|
||
},
|
||
"blockType": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Registered type of the block, when it has one."
|
||
},
|
||
"field": {
|
||
"type": "string",
|
||
"description": "Sub-block field holding the reference."
|
||
},
|
||
"value": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
],
|
||
"description": "The reference, or references, that did not resolve."
|
||
},
|
||
"kind": {
|
||
"type": "string",
|
||
"enum": ["credential", "resource", "custom-tool", "mcp-tool", "skill"],
|
||
"description": "What kind of entity the reference was expected to name."
|
||
},
|
||
"reason": {
|
||
"type": "string",
|
||
"description": "Why the reference does not resolve."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockName", "blockType", "field", "value", "kind", "reason"],
|
||
"additionalProperties": false
|
||
},
|
||
"description": "Credential, resource, tool, and skill references that do not resolve. These values are still persisted; they are reported, not dropped."
|
||
},
|
||
"notes": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Advisory notes about the report itself."
|
||
}
|
||
},
|
||
"required": [
|
||
"sources",
|
||
"sinks",
|
||
"orphanBlocks",
|
||
"emptyOutgoingPorts",
|
||
"invalidBranchPorts",
|
||
"invalidConnectionTargets",
|
||
"fieldIssues",
|
||
"unresolvedReferences",
|
||
"notes"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Workflow lint report",
|
||
"description": "Advisory findings about the saved graph. Findings never block the write; they tell a caller what will misbehave at run time."
|
||
},
|
||
"ReplaceWorkflowStateResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the workflow whose draft graph was written."
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal notes about blocks and edges that were normalized or dropped before persistence. Empty when there was nothing to report."
|
||
},
|
||
"needsRedeployment": {
|
||
"type": "boolean",
|
||
"description": "Whether the live deployment now differs from the draft. A graph write never changes what the deployed endpoint serves; deploy to publish it."
|
||
},
|
||
"lint": {
|
||
"$ref": "#/components/schemas/WorkflowLintReport"
|
||
},
|
||
"dryRun": {
|
||
"type": "boolean",
|
||
"description": "Whether this request only validated. `true` means nothing was persisted; the findings describe what a committed write of the same body would produce."
|
||
}
|
||
},
|
||
"required": ["id", "warnings", "needsRedeployment", "lint", "dryRun"],
|
||
"additionalProperties": false,
|
||
"title": "Replace workflow state result",
|
||
"description": "Outcome of replacing a workflow draft graph, with its advisory findings."
|
||
},
|
||
"ReplaceWorkflowStateResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/ReplaceWorkflowStateResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Replace workflow state response",
|
||
"description": "Outcome of replacing a workflow draft graph.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"warnings": [],
|
||
"needsRedeployment": true,
|
||
"dryRun": false,
|
||
"lint": {
|
||
"sources": [],
|
||
"sinks": [],
|
||
"orphanBlocks": [],
|
||
"emptyOutgoingPorts": [],
|
||
"invalidBranchPorts": [],
|
||
"invalidConnectionTargets": [],
|
||
"fieldIssues": [],
|
||
"unresolvedReferences": [],
|
||
"notes": []
|
||
}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowBlockInput": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block identifier, unique within the workflow."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Registered block type."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255,
|
||
"description": "Block display name; must be unique within the workflow."
|
||
},
|
||
"position": {
|
||
"type": "object",
|
||
"properties": {
|
||
"x": {
|
||
"type": "number",
|
||
"description": "Canvas x coordinate."
|
||
},
|
||
"y": {
|
||
"type": "number",
|
||
"description": "Canvas y coordinate."
|
||
}
|
||
},
|
||
"required": ["x", "y"],
|
||
"description": "Canvas coordinates of a block."
|
||
},
|
||
"subBlocks": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Sub-block identifier."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Sub-block input type."
|
||
},
|
||
"value": {
|
||
"description": "Configured value; shape depends on the sub-block type."
|
||
}
|
||
},
|
||
"required": ["id", "type", "value"],
|
||
"description": "One configurable input on a block."
|
||
},
|
||
"description": "Configured inputs keyed by sub-block id."
|
||
},
|
||
"outputs": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "Declared shape of one output; depends on the block type."
|
||
},
|
||
"description": "Declared output shape keyed by output name."
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"description": "Whether the block runs."
|
||
},
|
||
"horizontalHandles": {
|
||
"description": "Whether edge handles render horizontally.",
|
||
"type": "boolean"
|
||
},
|
||
"height": {
|
||
"description": "Rendered block height.",
|
||
"type": "number"
|
||
},
|
||
"advancedMode": {
|
||
"description": "Whether the block is edited in advanced mode.",
|
||
"type": "boolean"
|
||
},
|
||
"errorEnabled": {
|
||
"description": "Whether the block exposes an error branch.",
|
||
"type": "boolean"
|
||
},
|
||
"retry": {
|
||
"type": "object",
|
||
"properties": {
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"description": "Whether the block retries on failure."
|
||
},
|
||
"maxTries": {
|
||
"type": "integer",
|
||
"minimum": 2,
|
||
"maximum": 5,
|
||
"description": "Total attempts, including the first."
|
||
},
|
||
"waitBetweenTriesMs": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 5000,
|
||
"description": "Delay between attempts, in milliseconds."
|
||
}
|
||
},
|
||
"required": ["enabled", "maxTries", "waitBetweenTriesMs"],
|
||
"description": "Per-block retry configuration."
|
||
},
|
||
"triggerMode": {
|
||
"description": "Whether the block acts as the workflow trigger.",
|
||
"type": "boolean"
|
||
},
|
||
"data": {
|
||
"type": "object",
|
||
"properties": {
|
||
"parentId": {
|
||
"description": "Identifier of the containing loop or parallel.",
|
||
"type": "string"
|
||
},
|
||
"extent": {
|
||
"description": "Constrains the block to its parent bounds.",
|
||
"type": "string",
|
||
"const": "parent"
|
||
},
|
||
"width": {
|
||
"description": "Rendered container width.",
|
||
"type": "number"
|
||
},
|
||
"height": {
|
||
"description": "Rendered container height.",
|
||
"type": "number"
|
||
},
|
||
"collection": {
|
||
"description": "Items a forEach loop or collection parallel iterates."
|
||
},
|
||
"count": {
|
||
"description": "Iteration count for a `for` loop or count parallel.",
|
||
"type": "number"
|
||
},
|
||
"loopType": {
|
||
"description": "Loop container kind.",
|
||
"type": "string",
|
||
"enum": ["for", "forEach", "while", "doWhile"]
|
||
},
|
||
"whileCondition": {
|
||
"description": "Condition expression for a `while` loop.",
|
||
"type": "string"
|
||
},
|
||
"doWhileCondition": {
|
||
"description": "Condition expression for a `doWhile` loop.",
|
||
"type": "string"
|
||
},
|
||
"parallelType": {
|
||
"description": "Parallel container kind.",
|
||
"type": "string",
|
||
"enum": ["collection", "count"]
|
||
},
|
||
"batchSize": {
|
||
"description": "Maximum concurrent branches of a parallel.",
|
||
"type": "number"
|
||
},
|
||
"type": {
|
||
"description": "Container subtype.",
|
||
"type": "string"
|
||
},
|
||
"canonicalModes": {
|
||
"description": "Per-field editing mode, keyed by canonical parameter id.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"type": "string",
|
||
"enum": ["basic", "advanced"]
|
||
}
|
||
}
|
||
},
|
||
"description": "Container and layout metadata carried by a block."
|
||
},
|
||
"locked": {
|
||
"description": "Whether the block is locked against edits.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["id", "type", "name", "position", "subBlocks", "outputs", "enabled"],
|
||
"title": "Workflow block",
|
||
"description": "One node of a workflow graph and its configuration."
|
||
},
|
||
"WorkflowEdgeInput": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Edge identifier, unique within the workflow."
|
||
},
|
||
"source": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Source block id."
|
||
},
|
||
"target": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Target block id."
|
||
},
|
||
"sourceHandle": {
|
||
"description": "Source port, or null for the block default.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"targetHandle": {
|
||
"description": "Target port, or null for the block default.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"type": {
|
||
"description": "Edge renderer type.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["id", "source", "target"],
|
||
"title": "Workflow edge",
|
||
"description": "A directed connection between two blocks."
|
||
},
|
||
"WorkflowLoopInput": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Loop container identifier; equal to the loop block id."
|
||
},
|
||
"nodes": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Block ids inside the loop."
|
||
},
|
||
"iterations": {
|
||
"type": "number",
|
||
"description": "Resolved iteration count."
|
||
},
|
||
"loopType": {
|
||
"type": "string",
|
||
"enum": ["for", "forEach", "while", "doWhile"],
|
||
"description": "Loop kind."
|
||
},
|
||
"forEachItems": {
|
||
"description": "Items a forEach loop iterates, or the expression producing them.",
|
||
"anyOf": [
|
||
{
|
||
"type": "array",
|
||
"items": {
|
||
"description": "One item the loop iterates."
|
||
}
|
||
},
|
||
{
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "One item the loop iterates."
|
||
}
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"whileCondition": {
|
||
"description": "Condition expression for a `while` loop.",
|
||
"type": "string"
|
||
},
|
||
"doWhileCondition": {
|
||
"description": "Condition expression for a `doWhile` loop.",
|
||
"type": "string"
|
||
},
|
||
"enabled": {
|
||
"description": "Whether the loop runs.",
|
||
"type": "boolean"
|
||
},
|
||
"locked": {
|
||
"description": "Whether the loop is locked against edits.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["id", "nodes", "iterations", "loopType"],
|
||
"title": "Workflow loop",
|
||
"description": "A loop container derived from the workflow blocks."
|
||
},
|
||
"WorkflowParallelInput": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Parallel container identifier; equal to the parallel block id."
|
||
},
|
||
"nodes": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Block ids inside the parallel."
|
||
},
|
||
"distribution": {
|
||
"description": "Items distributed across branches, or the expression producing them.",
|
||
"anyOf": [
|
||
{
|
||
"type": "array",
|
||
"items": {
|
||
"description": "One item distributed to a branch."
|
||
}
|
||
},
|
||
{
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "One item distributed to a branch."
|
||
}
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"count": {
|
||
"description": "Fixed branch count.",
|
||
"type": "number"
|
||
},
|
||
"parallelType": {
|
||
"description": "Parallel kind.",
|
||
"type": "string",
|
||
"enum": ["count", "collection"]
|
||
},
|
||
"batchSize": {
|
||
"description": "Maximum concurrent branches.",
|
||
"type": "number"
|
||
},
|
||
"enabled": {
|
||
"description": "Whether the parallel runs.",
|
||
"type": "boolean"
|
||
},
|
||
"locked": {
|
||
"description": "Whether the parallel is locked against edits.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["id", "nodes"],
|
||
"title": "Workflow parallel",
|
||
"description": "A parallel container derived from the workflow blocks."
|
||
},
|
||
"WorkflowVariableInput": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Variable identifier."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255,
|
||
"description": "Variable name, referenced from block inputs."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"enum": ["string", "number", "boolean", "object", "array", "plain"],
|
||
"description": "Declared variable type."
|
||
},
|
||
"value": {
|
||
"description": "Variable value; free-form and validated per `type` at use time."
|
||
}
|
||
},
|
||
"required": ["id", "name", "type", "value"],
|
||
"title": "Workflow variable",
|
||
"description": "A workflow-scoped variable."
|
||
},
|
||
"ReplaceWorkflowStateRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blocks": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowBlockInput"
|
||
},
|
||
"description": "Blocks keyed by block id."
|
||
},
|
||
"edges": {
|
||
"maxItems": 10000,
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowEdgeInput"
|
||
},
|
||
"description": "Directed connections between blocks."
|
||
},
|
||
"loops": {
|
||
"description": "Ignored on write: loop containers are recomputed from `blocks`.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowLoopInput"
|
||
}
|
||
},
|
||
"parallels": {
|
||
"description": "Ignored on write: parallel containers are recomputed from `blocks`.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowParallelInput"
|
||
}
|
||
},
|
||
"variables": {
|
||
"description": "Replacement variable set. Omit to leave the stored variables untouched.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"$ref": "#/components/schemas/WorkflowVariableInput"
|
||
}
|
||
}
|
||
},
|
||
"required": ["blocks", "edges"],
|
||
"additionalProperties": false,
|
||
"title": "Replace workflow state request",
|
||
"description": "A complete replacement draft graph for a workflow.",
|
||
"examples": [
|
||
{
|
||
"blocks": {},
|
||
"edges": []
|
||
}
|
||
]
|
||
},
|
||
"WorkflowSkippedItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"enum": [
|
||
"block_not_found",
|
||
"invalid_block_type",
|
||
"block_not_allowed",
|
||
"model_not_allowed",
|
||
"block_locked",
|
||
"tool_not_allowed",
|
||
"invalid_edge_target",
|
||
"invalid_edge_source",
|
||
"invalid_edge_scope",
|
||
"invalid_source_handle",
|
||
"invalid_target_handle",
|
||
"invalid_subblock_field",
|
||
"missing_required_params",
|
||
"invalid_subflow_parent",
|
||
"nested_subflow_not_allowed",
|
||
"duplicate_block_name",
|
||
"reserved_block_name",
|
||
"retry_not_supported",
|
||
"duplicate_trigger",
|
||
"duplicate_single_instance_block",
|
||
"disabled_ancestor"
|
||
],
|
||
"description": "Machine-readable reason the engine declined an operation."
|
||
},
|
||
"operationType": {
|
||
"type": "string",
|
||
"description": "The `operation_type` that was declined."
|
||
},
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block the declined operation targeted."
|
||
},
|
||
"reason": {
|
||
"type": "string",
|
||
"description": "Human-readable explanation."
|
||
},
|
||
"details": {
|
||
"description": "Additional context for the reason; keys depend on `type`.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "One piece of engine-supplied context for the reason."
|
||
}
|
||
}
|
||
},
|
||
"required": ["type", "operationType", "blockId", "reason"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow skipped item",
|
||
"description": "One operation the edit engine did not apply."
|
||
},
|
||
"WorkflowInputValidationError": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block whose input was rejected."
|
||
},
|
||
"blockType": {
|
||
"type": "string",
|
||
"description": "Type of the block whose input was rejected."
|
||
},
|
||
"field": {
|
||
"type": "string",
|
||
"description": "Sub-block field that was rejected."
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"description": "Why the value was rejected."
|
||
}
|
||
},
|
||
"required": ["blockId", "blockType", "field", "error"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow input validation error",
|
||
"description": "One block input that was dropped rather than persisted."
|
||
},
|
||
"ApplyWorkflowOperationsResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the workflow whose draft graph was written."
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal notes about blocks and edges that were normalized or dropped before persistence. Empty when there was nothing to report."
|
||
},
|
||
"needsRedeployment": {
|
||
"type": "boolean",
|
||
"description": "Whether the live deployment now differs from the draft. A graph write never changes what the deployed endpoint serves; deploy to publish it."
|
||
},
|
||
"applied": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Operations the engine applied."
|
||
},
|
||
"skipped": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowSkippedItem"
|
||
},
|
||
"description": "Operations the engine declined. Empty when everything applied."
|
||
},
|
||
"deferred": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowSkippedItem"
|
||
},
|
||
"description": "Forward-referencing edges the engine recorded rather than applied. These are NOT failures: the engine wires each one as soon as its target block exists, in this batch or a later one. Do not re-issue them."
|
||
},
|
||
"inputValidationErrors": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowInputValidationError"
|
||
},
|
||
"description": "Block inputs that were dropped rather than persisted, and only those. The rest of the operation still applied. References that merely fail to resolve stay persisted and are reported in `lint.unresolvedReferences` instead."
|
||
},
|
||
"mintedBlockIds": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"type": "string",
|
||
"description": "The id the block was actually given."
|
||
},
|
||
"description": "The id each newly created block was actually given, keyed by the `block_id` you asked for, and present only for the ones that differ. A `block_id` on an `add` or `insert_into_subflow` that is not already a UUID is replaced with a minted one, so this is how you learn what to reference afterwards. Within a single batch you can keep using your own ids — references between operations are remapped for you — but a later request must use the minted id, so send your own UUIDs when you want an id you chose to survive."
|
||
},
|
||
"lint": {
|
||
"$ref": "#/components/schemas/WorkflowLintReport"
|
||
},
|
||
"dryRun": {
|
||
"type": "boolean",
|
||
"description": "Whether this request only evaluated. `true` means nothing was persisted; the outcome describes what a committed apply of the same body would produce."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"warnings",
|
||
"needsRedeployment",
|
||
"applied",
|
||
"skipped",
|
||
"deferred",
|
||
"inputValidationErrors",
|
||
"mintedBlockIds",
|
||
"lint",
|
||
"dryRun"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Apply workflow operations result",
|
||
"description": "Outcome of a batch of semantic edits against a workflow graph."
|
||
},
|
||
"ApplyWorkflowOperationsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/ApplyWorkflowOperationsResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Apply workflow operations response",
|
||
"description": "Outcome of a batch of semantic edits.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"applied": 1,
|
||
"skipped": [],
|
||
"deferred": [],
|
||
"inputValidationErrors": [],
|
||
"mintedBlockIds": {
|
||
"triage": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77"
|
||
},
|
||
"lint": {
|
||
"sources": [],
|
||
"sinks": [],
|
||
"orphanBlocks": [],
|
||
"emptyOutgoingPorts": [],
|
||
"invalidBranchPorts": [],
|
||
"invalidConnectionTargets": [],
|
||
"fieldIssues": [
|
||
{
|
||
"blockId": "agent-1",
|
||
"blockName": "Triage",
|
||
"blockType": "agent",
|
||
"missingRequiredFields": ["systemPrompt"],
|
||
"inactiveModeValues": []
|
||
}
|
||
],
|
||
"unresolvedReferences": [],
|
||
"notes": []
|
||
},
|
||
"warnings": [],
|
||
"needsRedeployment": true,
|
||
"dryRun": false
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowEditOperation": {
|
||
"oneOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation_type": {
|
||
"type": "string",
|
||
"const": "add",
|
||
"description": "Create a new block."
|
||
},
|
||
"block_id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block the operation targets. For `add`, the id the new block will be given."
|
||
},
|
||
"params": {
|
||
"type": "object",
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Registered block type."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block display name."
|
||
}
|
||
},
|
||
"required": ["type", "name"],
|
||
"additionalProperties": {
|
||
"description": "One block-specific input or connection descriptor."
|
||
},
|
||
"description": "Block type and name, plus any block-specific configuration. Beyond `type` and `name` the accepted keys are `inputs`, `connections`, `retry`, `triggerMode`, and `advancedMode`. `inputs` carries the block's own configuration keyed by sub-block id, for example `inputs: { model: \"gpt-4o\", systemPrompt: \"...\" }` — never wrapped in `subBlocks`. Block-level settings sit beside `inputs`, never inside it: `retry`, `triggerMode`, `advancedMode`. `connections` is keyed by source handle and each value is a target block id, `{ block, handle }`, or an array of either; `success` is accepted as an alias for the `source` handle."
|
||
}
|
||
},
|
||
"required": ["operation_type", "block_id", "params"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation_type": {
|
||
"type": "string",
|
||
"const": "edit",
|
||
"description": "Change an existing block: its inputs, name, or connections."
|
||
},
|
||
"block_id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block the operation targets. For `add`, the id the new block will be given."
|
||
},
|
||
"params": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "One operation parameter; see the description for the accepted keys."
|
||
},
|
||
"description": "Fields to change on the target block. Send only what changes. Accepted keys: `inputs`, `name`, `connections`, `removeEdges`, `nestedNodes`, `retry`, `triggerMode`, `advancedMode`. `inputs` carries the block's own configuration keyed by sub-block id, for example `inputs: { model: \"gpt-4o\", systemPrompt: \"...\" }` — never wrapped in `subBlocks`. Block-level settings sit beside `inputs`, never inside it: `retry`, `triggerMode`, `advancedMode`. `connections` is keyed by source handle and each value is a target block id, `{ block, handle }`, or an array of either; `success` is accepted as an alias for the `source` handle. Re-sending `connections` replaces that block's outgoing edges, so use `removeEdges` — `[{ targetBlockId, sourceHandle? }]`, `sourceHandle` defaulting to `source` — to drop one edge without restating the rest."
|
||
}
|
||
},
|
||
"required": ["operation_type", "block_id", "params"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation_type": {
|
||
"type": "string",
|
||
"const": "delete",
|
||
"description": "Remove a block and every edge touching it."
|
||
},
|
||
"block_id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block the operation targets. For `add`, the id the new block will be given."
|
||
}
|
||
},
|
||
"required": ["operation_type", "block_id"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation_type": {
|
||
"type": "string",
|
||
"const": "insert_into_subflow",
|
||
"description": "Create a block inside a loop or parallel container."
|
||
},
|
||
"block_id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block the operation targets. For `add`, the id the new block will be given."
|
||
},
|
||
"params": {
|
||
"type": "object",
|
||
"properties": {
|
||
"subflowId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Loop or parallel container to insert the block into."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Registered block type."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block display name."
|
||
}
|
||
},
|
||
"required": ["subflowId", "type", "name"],
|
||
"additionalProperties": {
|
||
"description": "One block-specific input or connection descriptor."
|
||
},
|
||
"description": "Container, block type and name, plus any block-specific configuration. Takes the same keys as an `add`: `inputs`, `connections`, `retry`, `triggerMode`, `advancedMode`. `inputs` carries the block's own configuration keyed by sub-block id, for example `inputs: { model: \"gpt-4o\", systemPrompt: \"...\" }` — never wrapped in `subBlocks`. Block-level settings sit beside `inputs`, never inside it: `retry`, `triggerMode`, `advancedMode`. `connections` is keyed by source handle and each value is a target block id, `{ block, handle }`, or an array of either; `success` is accepted as an alias for the `source` handle."
|
||
}
|
||
},
|
||
"required": ["operation_type", "block_id", "params"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation_type": {
|
||
"type": "string",
|
||
"const": "extract_from_subflow",
|
||
"description": "Move a block out of its loop or parallel container."
|
||
},
|
||
"block_id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block the operation targets. For `add`, the id the new block will be given."
|
||
},
|
||
"params": {
|
||
"type": "object",
|
||
"properties": {
|
||
"subflowId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Loop or parallel container the block moves into or out of."
|
||
}
|
||
},
|
||
"required": ["subflowId"],
|
||
"additionalProperties": {
|
||
"description": "One block-specific input."
|
||
},
|
||
"description": "Container identifier, plus any block-specific inputs."
|
||
}
|
||
},
|
||
"required": ["operation_type", "block_id", "params"],
|
||
"additionalProperties": false
|
||
}
|
||
],
|
||
"title": "Workflow edit operation",
|
||
"description": "One semantic edit against a workflow graph."
|
||
},
|
||
"ApplyWorkflowOperationsRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"operations": {
|
||
"minItems": 1,
|
||
"maxItems": 200,
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowEditOperation"
|
||
},
|
||
"description": "Edits to apply, in a single batch."
|
||
},
|
||
"atomic": {
|
||
"default": false,
|
||
"description": "Fail the whole batch when any operation is declined or any block input would be dropped. The default applies what it can and reports the rest in `skipped` and `inputValidationErrors`; `true` writes nothing and answers `409` instead.",
|
||
"type": "boolean"
|
||
},
|
||
"layout": {
|
||
"default": "targeted",
|
||
"description": "Whether to reposition blocks the batch touched. `targeted` (default) nudges only the affected subgraph; `none` leaves every position exactly as supplied.",
|
||
"type": "string",
|
||
"enum": ["targeted", "none"]
|
||
},
|
||
"setBlockEnabled": {
|
||
"description": "Blocks to enable or disable, applied after `operations`. Disabling a loop or parallel cascades to its unlocked descendants; enabling a block whose container is disabled is declined.",
|
||
"maxItems": 200,
|
||
"type": "array",
|
||
"items": {
|
||
"type": "object",
|
||
"properties": {
|
||
"block_id": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block the operation targets. For `add`, the id the new block will be given."
|
||
},
|
||
"enabled": {
|
||
"type": "boolean",
|
||
"description": "Whether the block should run."
|
||
}
|
||
},
|
||
"required": ["block_id", "enabled"],
|
||
"additionalProperties": false
|
||
}
|
||
}
|
||
},
|
||
"required": ["operations"],
|
||
"additionalProperties": false,
|
||
"title": "Apply workflow operations request",
|
||
"description": "A batch of semantic edits against a workflow graph.",
|
||
"examples": [
|
||
{
|
||
"operations": [
|
||
{
|
||
"operation_type": "add",
|
||
"block_id": "agent-1",
|
||
"params": {
|
||
"type": "agent",
|
||
"name": "Triage"
|
||
}
|
||
}
|
||
]
|
||
}
|
||
]
|
||
},
|
||
"ApplyWorkflowVariablesResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the workflow whose variables were updated."
|
||
},
|
||
"variableCount": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Variables the workflow now holds."
|
||
},
|
||
"changed": {
|
||
"type": "boolean",
|
||
"description": "Whether anything actually changed. A no-op batch answers `200` with `false`."
|
||
}
|
||
},
|
||
"required": ["id", "variableCount", "changed"],
|
||
"additionalProperties": false,
|
||
"title": "Apply workflow variables result",
|
||
"description": "Outcome of a workflow variable update."
|
||
},
|
||
"ApplyWorkflowVariablesResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/ApplyWorkflowVariablesResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Apply workflow variables response",
|
||
"description": "Outcome of a workflow variable update.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"variableCount": 3,
|
||
"changed": true
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ApplyWorkflowVariablesRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"operations": {
|
||
"minItems": 1,
|
||
"maxItems": 100,
|
||
"type": "array",
|
||
"items": {
|
||
"oneOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation": {
|
||
"type": "string",
|
||
"const": "add",
|
||
"description": "Create a variable with this name."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255,
|
||
"description": "Variable name."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"enum": ["string", "number", "boolean", "object", "array", "plain"],
|
||
"description": "Declared variable type."
|
||
},
|
||
"value": {
|
||
"description": "Variable value, coerced to `type`."
|
||
}
|
||
},
|
||
"required": ["operation", "name", "type", "value"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation": {
|
||
"type": "string",
|
||
"const": "edit",
|
||
"description": "Replace the value, and optionally the type, of an existing variable."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255,
|
||
"description": "Name of the variable to update."
|
||
},
|
||
"type": {
|
||
"description": "Replacement type; the stored type is kept when omitted.",
|
||
"type": "string",
|
||
"enum": ["string", "number", "boolean", "object", "array", "plain"]
|
||
},
|
||
"value": {
|
||
"description": "Replacement value, coerced to the effective type."
|
||
}
|
||
},
|
||
"required": ["operation", "name", "value"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"operation": {
|
||
"type": "string",
|
||
"const": "delete",
|
||
"description": "Remove the variable with this name."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255,
|
||
"description": "Name of the variable to remove."
|
||
}
|
||
},
|
||
"required": ["operation", "name"],
|
||
"additionalProperties": false
|
||
}
|
||
],
|
||
"description": "One variable change."
|
||
},
|
||
"description": "Variable changes to apply, in order."
|
||
}
|
||
},
|
||
"required": ["operations"],
|
||
"additionalProperties": false,
|
||
"title": "Apply workflow variables request",
|
||
"description": "Additions, edits, and deletions against a workflow’s variables."
|
||
},
|
||
"DuplicateWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowListItem"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Duplicate workflow response",
|
||
"description": "The created copy.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"webUrl": "https://www.sim.ai/workspace/a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64/w/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage (copy)",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"folderPath": "/Operations",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"isDeployed": false,
|
||
"deployedAt": null,
|
||
"runCount": 0,
|
||
"lastRunAt": null,
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"DuplicateWorkflowRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"description": "Name for the copy. Defaults to the source name, deduplicated within the folder.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255
|
||
},
|
||
"folderPath": {
|
||
"description": "Destination folder path. Defaults to the source workflow's folder.",
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"title": "Duplicate workflow request",
|
||
"description": "Optional name and destination folder for the copy."
|
||
},
|
||
"RestoreWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowListItem"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Restore workflow response",
|
||
"description": "The restored workflow.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"webUrl": "https://www.sim.ai/workspace/a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64/w/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"folderPath": "/Operations",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"isDeployed": true,
|
||
"deployedAt": "2026-06-12T10:30:00.000Z",
|
||
"runCount": 42,
|
||
"lastRunAt": "2026-08-09T18:04:11.000Z",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"MoveWorkflowsResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"moved": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Workflows that were relocated."
|
||
},
|
||
"failed": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Workflows that were not relocated — absent from the workspace, archived, or locked. Best-effort by design: the rest of the batch still moved."
|
||
},
|
||
"folderPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical destination folder path.",
|
||
"maxLength": 4096
|
||
}
|
||
},
|
||
"required": ["moved", "failed", "folderPath"],
|
||
"additionalProperties": false,
|
||
"title": "Move workflows result",
|
||
"description": "Which workflows moved and which did not."
|
||
},
|
||
"MoveWorkflowsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/MoveWorkflowsResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Move workflows response",
|
||
"description": "Which workflows moved and which did not.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"moved": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"],
|
||
"failed": [],
|
||
"folderPath": "/Operations"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"MoveWorkflowsRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace holding every workflow in the batch."
|
||
},
|
||
"workflowIds": {
|
||
"minItems": 1,
|
||
"maxItems": 100,
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"description": "Workflows to move. Duplicates are collapsed."
|
||
},
|
||
"folderPath": {
|
||
"description": "Destination folder path; `/` moves the workflows to the workspace root.",
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
}
|
||
},
|
||
"required": ["workspaceId", "workflowIds", "folderPath"],
|
||
"additionalProperties": false,
|
||
"title": "Move workflows request",
|
||
"description": "Workflows to relocate and the folder to relocate them into."
|
||
},
|
||
"WorkflowInputField": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Input field name."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"description": "Input field type."
|
||
},
|
||
"description": {
|
||
"description": "Optional input field description.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["name", "type"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow input field",
|
||
"description": "A deployed API trigger input exposed by a workflow."
|
||
},
|
||
"WorkflowDetail": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"webUrl": {
|
||
"type": "string",
|
||
"format": "uri",
|
||
"description": "Canonical absolute URL for opening this resource in the Sim web application."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Workflow name.",
|
||
"examples": ["Customer support triage"]
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Workflow description, or null when none is set."
|
||
},
|
||
"folderPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical containing-folder path; `/` is the workspace root.",
|
||
"maxLength": 4096,
|
||
"examples": ["/Operations"]
|
||
},
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"description": "Workspace that owns the workflow."
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether the workflow has an active deployment."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 activation timestamp, or null when not deployed.",
|
||
"format": "date-time"
|
||
},
|
||
"runCount": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Runs that finished successfully. Failed, cancelled, and paused runs are not counted, and the counter is never reduced when a run ages out of log retention — so it does not match the size of `GET /api/v2/workflows/{workflowId}/runs`, in either direction."
|
||
},
|
||
"lastRunAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp of the latest run counted by `runCount`, or null when none has been. Stamped by the same successful-run path, so a workflow whose only runs failed reports null here.",
|
||
"format": "date-time"
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was created.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was last updated.",
|
||
"format": "date-time"
|
||
},
|
||
"variables": {
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "Structured workflow variable value."
|
||
},
|
||
"description": "Workflow-scoped variables keyed by variable identifier."
|
||
},
|
||
"inputs": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowInputField"
|
||
},
|
||
"description": "Input fields exposed by the workflow API trigger."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"webUrl",
|
||
"name",
|
||
"description",
|
||
"folderPath",
|
||
"workspaceId",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"runCount",
|
||
"lastRunAt",
|
||
"createdAt",
|
||
"updatedAt",
|
||
"variables",
|
||
"inputs"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Workflow detail",
|
||
"description": "Full workflow summary with variables and API-trigger input fields."
|
||
},
|
||
"WorkflowDetailResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowDetail"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow detail response",
|
||
"description": "Detailed workflow metadata, variables, and trigger inputs.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"webUrl": "https://www.sim.ai/workspace/a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64/w/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"folderPath": "/Operations",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"isDeployed": true,
|
||
"deployedAt": "2026-06-12T10:30:00.000Z",
|
||
"runCount": 42,
|
||
"lastRunAt": "2026-08-09T18:04:11.000Z",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z",
|
||
"variables": {},
|
||
"inputs": []
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"UpdateWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowListItem"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Update workflow response",
|
||
"description": "The updated workflow summary.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"webUrl": "https://www.sim.ai/workspace/a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64/w/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"folderPath": "/Operations",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"isDeployed": true,
|
||
"deployedAt": "2026-06-12T10:30:00.000Z",
|
||
"runCount": 42,
|
||
"lastRunAt": "2026-08-09T18:04:11.000Z",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"UpdateWorkflowRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"description": "Replacement workflow name.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 255
|
||
},
|
||
"description": {
|
||
"description": "Replacement workflow description; null clears it.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"maxLength": 50000
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"folderPath": {
|
||
"description": "Destination folder path; `/` moves the workflow to the workspace root.",
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"title": "Update workflow request",
|
||
"description": "Fields to update on an existing workflow."
|
||
},
|
||
"DeleteWorkflowResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the archived workflow."
|
||
},
|
||
"deleted": {
|
||
"type": "boolean",
|
||
"const": true,
|
||
"description": "Confirms that the workflow is no longer live."
|
||
},
|
||
"archived": {
|
||
"type": "boolean",
|
||
"const": true,
|
||
"description": "The workflow was archived, not erased. Its schedules, webhooks, MCP tools, and chats were archived with it, and `POST /workflows/{workflowId}/restore` brings all of them back."
|
||
}
|
||
},
|
||
"required": ["id", "deleted", "archived"],
|
||
"additionalProperties": false,
|
||
"title": "Delete workflow result",
|
||
"description": "Confirmation that a workflow was archived."
|
||
},
|
||
"DeleteWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/DeleteWorkflowResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Delete workflow response",
|
||
"description": "Confirmation that the workflow was archived.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"deleted": true,
|
||
"archived": true
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowVersion": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique deployment-version identifier."
|
||
},
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Monotonically increasing deployment version number."
|
||
},
|
||
"name": {
|
||
"description": "Optional deployment-version label.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"description": {
|
||
"description": "Optional deployment-version release note.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"isActive": {
|
||
"type": "boolean",
|
||
"description": "Whether this version is currently serving executions."
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when this version was created.",
|
||
"format": "date-time"
|
||
},
|
||
"deployedBy": {
|
||
"description": "Display name of the user who created the deployment, when available.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"latestOperationStatus": {
|
||
"description": "Latest lifecycle-operation status for this version.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"enum": ["preparing", "activating", "active", "failed", "superseded"]
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"required": ["id", "version", "isActive", "createdAt"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow version",
|
||
"description": "A saved deployment version of a workflow."
|
||
},
|
||
"WorkflowVersionListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowVersion"
|
||
},
|
||
"description": "Items in the current page."
|
||
},
|
||
"nextCursor": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Opaque cursor for the next page. Send it back as `cursor`; `null` means there is nothing further to fetch. Never construct one yourself."
|
||
}
|
||
},
|
||
"required": ["data", "nextCursor"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow version list response",
|
||
"description": "A cursor-paginated page of deployment versions.",
|
||
"examples": [
|
||
{
|
||
"data": [
|
||
{
|
||
"id": "version_3",
|
||
"version": 3,
|
||
"name": "Escalation routing",
|
||
"description": "Adds the priority escalation branch.",
|
||
"isActive": true,
|
||
"createdAt": "2026-06-12T10:30:00.000Z",
|
||
"deployedBy": "Jane Smith",
|
||
"latestOperationStatus": "active"
|
||
}
|
||
],
|
||
"nextCursor": null
|
||
}
|
||
]
|
||
},
|
||
"DeployedWorkflowState": {
|
||
"title": "Deployed workflow state",
|
||
"description": "Workflow graph snapshot pinned by a deployment version.",
|
||
"type": "object",
|
||
"additionalProperties": true
|
||
},
|
||
"WorkflowVersionDetail": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique deployment-version identifier."
|
||
},
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Monotonically increasing deployment version number."
|
||
},
|
||
"name": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Version label, or null when unset."
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Version release note, or null when unset."
|
||
},
|
||
"isActive": {
|
||
"type": "boolean",
|
||
"description": "Whether this version is currently serving executions."
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when this version was created.",
|
||
"format": "date-time"
|
||
},
|
||
"state": {
|
||
"description": "Deployed workflow graph snapshot pinned by this version, with credential-bearing values redacted to null: `oauth-input`, `password: true`, table sub-block values, sensitive nested tool parameters, and any parameter without authoritative codec metadata.",
|
||
"$ref": "#/components/schemas/DeployedWorkflowState"
|
||
}
|
||
},
|
||
"required": ["id", "version", "name", "description", "isActive", "createdAt", "state"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow version detail",
|
||
"description": "A deployment version together with the workflow state it pins."
|
||
},
|
||
"WorkflowVersionDetailResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowVersionDetail"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow version detail response",
|
||
"description": "The deployment version and its pinned workflow graph.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "version_3",
|
||
"version": 3,
|
||
"name": "Escalation routing",
|
||
"description": "Adds the priority escalation branch.",
|
||
"isActive": true,
|
||
"createdAt": "2026-06-12T10:30:00.000Z",
|
||
"state": {
|
||
"blocks": {},
|
||
"edges": []
|
||
}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowVersionMetadata": {
|
||
"type": "object",
|
||
"properties": {
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Monotonically increasing deployment version number."
|
||
},
|
||
"name": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Version label, or null when unset."
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Version release note, or null when unset."
|
||
}
|
||
},
|
||
"required": ["version", "name", "description"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow version metadata",
|
||
"description": "Mutable label and release note of a deployment version."
|
||
},
|
||
"UpdateWorkflowVersionResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowVersionMetadata"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Update workflow version response",
|
||
"description": "The deployment version metadata after the update.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"version": 3,
|
||
"name": "Escalation routing",
|
||
"description": "Adds the priority escalation branch."
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"UpdateWorkflowVersionRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"description": "New label for the deployment version.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 100
|
||
},
|
||
"description": {
|
||
"description": "New release note for the deployment version, or null to clear it.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"maxLength": 50000
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"title": "Update workflow version request",
|
||
"description": "Merge-patch body for the mutable metadata of a deployment version.",
|
||
"examples": [
|
||
{
|
||
"name": "Escalation routing",
|
||
"description": "Adds the priority escalation branch."
|
||
}
|
||
]
|
||
},
|
||
"ActiveDeploymentSummary": {
|
||
"type": "object",
|
||
"properties": {
|
||
"deploymentVersionId": {
|
||
"type": "string",
|
||
"description": "Identifier of the active deployment version."
|
||
},
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Numeric active deployment version."
|
||
},
|
||
"deployedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when this version became active.",
|
||
"format": "date-time"
|
||
}
|
||
},
|
||
"required": ["deploymentVersionId", "version", "deployedAt"],
|
||
"additionalProperties": false,
|
||
"title": "Active deployment",
|
||
"description": "Summary of the workflow version currently serving API executions."
|
||
},
|
||
"DeploymentOperationSummary": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique deployment operation identifier."
|
||
},
|
||
"deploymentVersionId": {
|
||
"type": "string",
|
||
"description": "Deployment version targeted by this operation."
|
||
},
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Numeric deployment version."
|
||
},
|
||
"action": {
|
||
"type": "string",
|
||
"enum": ["deploy", "activate"],
|
||
"description": "Operation being performed on the deployment version."
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"enum": ["preparing", "activating", "active", "failed", "superseded"],
|
||
"description": "Current deployment lifecycle status."
|
||
},
|
||
"isCurrent": {
|
||
"default": true,
|
||
"description": "Whether this operation still describes the current deployment attempt.",
|
||
"type": "boolean"
|
||
},
|
||
"readiness": {
|
||
"$ref": "#/components/schemas/DeploymentReadiness"
|
||
},
|
||
"requestedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the deployment operation was requested.",
|
||
"format": "date-time"
|
||
},
|
||
"activatedAt": {
|
||
"description": "ISO 8601 activation timestamp, or null before activation completes.",
|
||
"format": "date-time",
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
},
|
||
"error": {
|
||
"description": "Deployment failure details, or null when no failure occurred.",
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/DeploymentOperationError"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"deploymentVersionId",
|
||
"version",
|
||
"action",
|
||
"status",
|
||
"isCurrent",
|
||
"readiness",
|
||
"requestedAt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Deployment operation",
|
||
"description": "Lifecycle state of a deployment or version-activation attempt."
|
||
},
|
||
"DeploymentReadiness": {
|
||
"type": "object",
|
||
"properties": {
|
||
"webhooks": {
|
||
"type": "string",
|
||
"enum": ["pending", "ready", "not_applicable"],
|
||
"description": "Webhook synchronization readiness."
|
||
},
|
||
"schedules": {
|
||
"type": "string",
|
||
"enum": ["pending", "ready", "not_applicable"],
|
||
"description": "Schedule synchronization readiness."
|
||
},
|
||
"mcp": {
|
||
"type": "string",
|
||
"enum": ["pending", "ready", "not_applicable"],
|
||
"description": "MCP synchronization readiness."
|
||
}
|
||
},
|
||
"required": ["webhooks", "schedules", "mcp"],
|
||
"additionalProperties": false,
|
||
"title": "Deployment readiness",
|
||
"description": "Readiness of the side effects required to activate a deployment."
|
||
},
|
||
"DeploymentOperationError": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "string",
|
||
"description": "Stable deployment failure code."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"description": "Human-readable deployment failure message."
|
||
},
|
||
"retryable": {
|
||
"type": "boolean",
|
||
"description": "Whether retrying the deployment may succeed."
|
||
}
|
||
},
|
||
"required": ["code", "message", "retryable"],
|
||
"additionalProperties": false,
|
||
"title": "Deployment operation error",
|
||
"description": "Failure details for a deployment lifecycle operation."
|
||
},
|
||
"VersionActivationResult": {
|
||
"title": "Version activation result",
|
||
"description": "Activation attempt accepted for processing. Activation is asynchronous; inspect `isDeployed` and `latestDeploymentAttempt` for current state.",
|
||
"$ref": "#/components/schemas/RollbackResult"
|
||
},
|
||
"RollbackResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether a workflow version is currently live and available for API execution."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp associated with the deployment, or null when unavailable.",
|
||
"format": "date-time",
|
||
"examples": ["2026-06-12T10:30:00.000Z"]
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal synchronization warnings. Empty when there is nothing to report."
|
||
},
|
||
"activeDeployment": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ActiveDeploymentSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Currently live deployment version, or null while no version is active."
|
||
},
|
||
"latestDeploymentAttempt": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/DeploymentOperationSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Most recent deployment lifecycle attempt, or null when none is available."
|
||
},
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Deployment version selected for re-activation."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"warnings",
|
||
"activeDeployment",
|
||
"latestDeploymentAttempt",
|
||
"version"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Rollback result",
|
||
"description": "Rollback attempt accepted for processing. Activation is asynchronous; inspect `isDeployed` and `latestDeploymentAttempt` for current state."
|
||
},
|
||
"ActivateWorkflowVersionResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether a workflow version is currently live and available for API execution."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp associated with the deployment, or null when unavailable.",
|
||
"format": "date-time",
|
||
"examples": ["2026-06-12T10:30:00.000Z"]
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal synchronization warnings. Empty when there is nothing to report."
|
||
},
|
||
"activeDeployment": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ActiveDeploymentSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Currently live deployment version, or null while no version is active."
|
||
},
|
||
"latestDeploymentAttempt": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/DeploymentOperationSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Most recent deployment lifecycle attempt, or null when none is available."
|
||
},
|
||
"version": {
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Deployment version selected for re-activation."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"warnings",
|
||
"activeDeployment",
|
||
"latestDeploymentAttempt",
|
||
"version"
|
||
],
|
||
"additionalProperties": false,
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/VersionActivationResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Activate workflow version response",
|
||
"description": "Current deployment state after accepting the activation attempt.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"isDeployed": false,
|
||
"deployedAt": null,
|
||
"warnings": [],
|
||
"activeDeployment": null,
|
||
"latestDeploymentAttempt": {
|
||
"id": "depop_01J8ZK4RX5N7Y3S0U8D6E1W2",
|
||
"deploymentVersionId": "depver_01J8ZK4RX5N7Y3S0U8D6E1W3",
|
||
"version": 3,
|
||
"action": "activate",
|
||
"status": "activating",
|
||
"isCurrent": true,
|
||
"readiness": {
|
||
"webhooks": "ready",
|
||
"schedules": "ready",
|
||
"mcp": "not_applicable"
|
||
},
|
||
"requestedAt": "2026-06-12T10:30:00.000Z",
|
||
"activatedAt": null,
|
||
"error": null
|
||
},
|
||
"version": 3
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ActivateWorkflowVersionRequest": {
|
||
"default": {},
|
||
"title": "Activate workflow version request",
|
||
"description": "No body. The version to promote is named by the request path.",
|
||
"examples": [{}],
|
||
"type": "object",
|
||
"properties": {},
|
||
"additionalProperties": false
|
||
},
|
||
"RevertWorkflowVersionResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier."
|
||
},
|
||
"version": {
|
||
"anyOf": [
|
||
{
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991
|
||
},
|
||
{
|
||
"type": "string",
|
||
"const": "active"
|
||
}
|
||
],
|
||
"description": "Deployment version loaded into the draft, or `active` for the live version."
|
||
},
|
||
"lastSaved": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Epoch milliseconds at which the overwritten draft was saved."
|
||
}
|
||
},
|
||
"required": ["id", "version", "lastSaved"],
|
||
"additionalProperties": false,
|
||
"title": "Revert workflow version result",
|
||
"description": "The draft after it was overwritten by a deployment version."
|
||
},
|
||
"RevertWorkflowVersionResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/RevertWorkflowVersionResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Revert workflow version response",
|
||
"description": "The draft after it was overwritten by the deployment version.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"version": 3,
|
||
"lastSaved": 1765535400000
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"RevertWorkflowVersionRequest": {
|
||
"default": {},
|
||
"title": "Revert workflow version request",
|
||
"description": "No body. The version to load into the draft is named by the request path.",
|
||
"examples": [{}],
|
||
"type": "object",
|
||
"properties": {},
|
||
"additionalProperties": false
|
||
},
|
||
"WorkflowDeployment": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether a workflow version is currently live and available for API execution."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp associated with the deployment, or null when unavailable.",
|
||
"format": "date-time",
|
||
"examples": ["2026-06-12T10:30:00.000Z"]
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal synchronization warnings. Empty when there is nothing to report."
|
||
},
|
||
"activeDeployment": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ActiveDeploymentSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Currently live deployment version, or null while no version is active."
|
||
},
|
||
"latestDeploymentAttempt": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/DeploymentOperationSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Most recent deployment lifecycle attempt, or null when none is available."
|
||
},
|
||
"needsRedeployment": {
|
||
"type": "boolean",
|
||
"description": "Whether the editable draft has diverged from the live deployment version. False while a deployment attempt is still preparing or activating, and false when nothing is deployed."
|
||
},
|
||
"isPublicApi": {
|
||
"type": "boolean",
|
||
"description": "Whether the deployed workflow accepts unauthenticated public API execution. While true, anyone holding the execution URL can run the workflow — and be billed for it — without an API key, so this is the field an audit of what a deployment exposes reads. Changed with `PATCH /workflows/{workflowId}/deployment`."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"warnings",
|
||
"activeDeployment",
|
||
"latestDeploymentAttempt",
|
||
"needsRedeployment",
|
||
"isPublicApi"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Workflow deployment",
|
||
"description": "Current deployment state of a workflow, including draft-versus-live drift and the most recent deployment attempt."
|
||
},
|
||
"WorkflowDeploymentResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowDeployment"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow deployment response",
|
||
"description": "Current deployment state, including draft-versus-live drift and whether the deployment is publicly executable.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"isDeployed": true,
|
||
"needsRedeployment": true,
|
||
"isPublicApi": false,
|
||
"deployedAt": "2026-06-12T10:30:00.000Z",
|
||
"warnings": [],
|
||
"activeDeployment": {
|
||
"deploymentVersionId": "depver_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"version": 3,
|
||
"deployedAt": "2026-06-12T10:30:00.000Z"
|
||
},
|
||
"latestDeploymentAttempt": {
|
||
"id": "depop_01J8ZK3QW4M6X2R9T7B5C0V1",
|
||
"deploymentVersionId": "depver_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"version": 3,
|
||
"action": "deploy",
|
||
"status": "active",
|
||
"isCurrent": true,
|
||
"readiness": {
|
||
"webhooks": "ready",
|
||
"schedules": "ready",
|
||
"mcp": "not_applicable"
|
||
},
|
||
"requestedAt": "2026-06-12T10:29:58.000Z",
|
||
"activatedAt": "2026-06-12T10:30:00.000Z",
|
||
"error": null
|
||
}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowPublicApiSettings": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier."
|
||
},
|
||
"isPublicApi": {
|
||
"type": "boolean",
|
||
"description": "Whether the deployed workflow accepts unauthenticated public API execution."
|
||
}
|
||
},
|
||
"required": ["id", "isPublicApi"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow public API settings",
|
||
"description": "Whether a deployed workflow is executable without an API key."
|
||
},
|
||
"UpdateWorkflowPublicApiResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowPublicApiSettings"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Update workflow public API response",
|
||
"description": "Public API access after the update.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"isPublicApi": true
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"UpdateWorkflowPublicApiRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"isPublicApi": {
|
||
"type": "boolean",
|
||
"description": "Whether the deployed workflow should accept unauthenticated public API execution."
|
||
}
|
||
},
|
||
"required": ["isPublicApi"],
|
||
"additionalProperties": false,
|
||
"title": "Update workflow public API request",
|
||
"description": "Enable or disable unauthenticated public execution of the deployed workflow.",
|
||
"examples": [
|
||
{
|
||
"isPublicApi": true
|
||
}
|
||
]
|
||
},
|
||
"DeployResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether a workflow version is currently live and available for API execution."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp associated with the deployment, or null when unavailable.",
|
||
"format": "date-time",
|
||
"examples": ["2026-06-12T10:30:00.000Z"]
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal synchronization warnings. Empty when there is nothing to report."
|
||
},
|
||
"activeDeployment": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ActiveDeploymentSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Currently live deployment version, or null while no version is active."
|
||
},
|
||
"latestDeploymentAttempt": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/DeploymentOperationSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Most recent deployment lifecycle attempt, or null when none is available."
|
||
},
|
||
"version": {
|
||
"description": "Deployment version created for this attempt, when available.",
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"warnings",
|
||
"activeDeployment",
|
||
"latestDeploymentAttempt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Deploy result",
|
||
"description": "Deployment attempt accepted for processing. Activation is asynchronous, and `latestDeploymentAttempt` is the attempt handle — returned by every deployment mutation as well as this read. Poll activation with `isDeployed` and `deployedAt` on the workflow, or `isActive` on `GET /workflows/{workflowId}/versions`."
|
||
},
|
||
"DeployWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/DeployResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Deploy workflow response",
|
||
"description": "Current deployment state after accepting the attempt.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"isDeployed": false,
|
||
"deployedAt": null,
|
||
"warnings": [],
|
||
"activeDeployment": null,
|
||
"latestDeploymentAttempt": {
|
||
"id": "depop_01J8ZK3QW4M6X2R9T7B5C0V1",
|
||
"deploymentVersionId": "depver_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"version": 3,
|
||
"action": "deploy",
|
||
"status": "preparing",
|
||
"isCurrent": true,
|
||
"readiness": {
|
||
"webhooks": "pending",
|
||
"schedules": "ready",
|
||
"mcp": "not_applicable"
|
||
},
|
||
"requestedAt": "2026-06-12T10:30:00.000Z",
|
||
"activatedAt": null,
|
||
"error": null
|
||
},
|
||
"version": 3
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"DeployWorkflowRequest": {
|
||
"default": {},
|
||
"title": "Deploy workflow request",
|
||
"description": "Optional metadata for the new deployment version.",
|
||
"examples": [
|
||
{
|
||
"name": "Escalation routing",
|
||
"description": "Adds the priority escalation branch."
|
||
}
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"description": "Optional label for the deployment version.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 100
|
||
},
|
||
"description": {
|
||
"description": "Optional release note for the deployment version.",
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"maxLength": 50000
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"additionalProperties": false
|
||
},
|
||
"UndeployResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique workflow identifier.",
|
||
"examples": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"]
|
||
},
|
||
"isDeployed": {
|
||
"type": "boolean",
|
||
"description": "Whether a workflow version is currently live and available for API execution."
|
||
},
|
||
"deployedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp associated with the deployment, or null when unavailable.",
|
||
"format": "date-time",
|
||
"examples": ["2026-06-12T10:30:00.000Z"]
|
||
},
|
||
"warnings": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Non-fatal synchronization warnings. Empty when there is nothing to report."
|
||
},
|
||
"activeDeployment": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ActiveDeploymentSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Currently live deployment version, or null while no version is active."
|
||
},
|
||
"latestDeploymentAttempt": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/DeploymentOperationSummary"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Most recent deployment lifecycle attempt, or null when none is available."
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"isDeployed",
|
||
"deployedAt",
|
||
"warnings",
|
||
"activeDeployment",
|
||
"latestDeploymentAttempt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Undeploy result",
|
||
"description": "Deployment state after a successful undeploy. `isDeployed` is false and no workflow version is active."
|
||
},
|
||
"UndeployWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/UndeployResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Undeploy workflow response",
|
||
"description": "Deployment state after deactivating the active version.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"isDeployed": false,
|
||
"deployedAt": null,
|
||
"warnings": [],
|
||
"activeDeployment": null,
|
||
"latestDeploymentAttempt": null
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"RollbackWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/RollbackResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Rollback workflow response",
|
||
"description": "Current deployment state after accepting the rollback attempt.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"isDeployed": false,
|
||
"deployedAt": null,
|
||
"warnings": [],
|
||
"activeDeployment": null,
|
||
"latestDeploymentAttempt": {
|
||
"id": "depop_01J8ZK4RX5N7Y3S0U8D6E1W2",
|
||
"deploymentVersionId": "depver_01J8ZK4RX5N7Y3S0U8D6E1W3",
|
||
"version": 2,
|
||
"action": "activate",
|
||
"status": "activating",
|
||
"isCurrent": true,
|
||
"readiness": {
|
||
"webhooks": "ready",
|
||
"schedules": "ready",
|
||
"mcp": "not_applicable"
|
||
},
|
||
"requestedAt": "2026-06-12T10:30:00.000Z",
|
||
"activatedAt": null,
|
||
"error": null
|
||
},
|
||
"version": 2
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"RollbackWorkflowRequest": {
|
||
"default": {},
|
||
"title": "Rollback workflow request",
|
||
"description": "Optional deployment version to reactivate.",
|
||
"examples": [
|
||
{
|
||
"version": 2
|
||
}
|
||
],
|
||
"type": "object",
|
||
"properties": {
|
||
"version": {
|
||
"description": "Deployment version to reactivate. Omit to select the previous active version.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 2147483647
|
||
}
|
||
},
|
||
"additionalProperties": false
|
||
},
|
||
"WorkflowExportPayload": {
|
||
"type": "object",
|
||
"properties": {
|
||
"version": {
|
||
"type": "string",
|
||
"const": "1.0",
|
||
"description": "Workflow export format version."
|
||
},
|
||
"exportedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the export was created.",
|
||
"format": "date-time"
|
||
},
|
||
"workflow": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the source workflow."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Name of the exported workflow."
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Description of the exported workflow, or null when unset."
|
||
},
|
||
"workspaceId": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Identifier of the source workspace, or null for legacy exports."
|
||
},
|
||
"folderPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical containing-folder path; `/` is the workspace root.",
|
||
"maxLength": 4096
|
||
}
|
||
},
|
||
"required": ["id", "name", "description", "workspaceId", "folderPath"],
|
||
"additionalProperties": false,
|
||
"description": "Source workflow metadata."
|
||
},
|
||
"state": {
|
||
"type": "object",
|
||
"additionalProperties": true,
|
||
"description": "Secret-sanitized workflow graph, edges, loops, parallels, metadata, and variables."
|
||
}
|
||
},
|
||
"required": ["version", "exportedAt", "workflow", "state"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow export payload",
|
||
"description": "Portable, secret-sanitized workflow export. Workspace-scoped bindings must be selected again after import."
|
||
},
|
||
"ExportWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowExportPayload"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Export workflow response",
|
||
"description": "Portable, secret-sanitized workflow data.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"version": "1.0",
|
||
"exportedAt": "2026-08-09T18:04:11.000Z",
|
||
"workflow": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"folderPath": "/Operations"
|
||
},
|
||
"state": {
|
||
"blocks": {},
|
||
"edges": []
|
||
}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ImportedWorkflow": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the imported workflow."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Imported workflow name."
|
||
},
|
||
"description": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Imported workflow description."
|
||
},
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"description": "Workspace that owns the imported workflow."
|
||
},
|
||
"folderPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical containing-folder path.",
|
||
"maxLength": 4096
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was imported.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the workflow was last updated.",
|
||
"format": "date-time"
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"name",
|
||
"description",
|
||
"workspaceId",
|
||
"folderPath",
|
||
"createdAt",
|
||
"updatedAt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Imported workflow",
|
||
"description": "Workflow created by an import operation."
|
||
},
|
||
"ImportWorkflowResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/ImportedWorkflow"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Import workflow response",
|
||
"description": "The workflow created by the import.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"name": "Customer support triage",
|
||
"description": "Routes incoming support requests to the right team.",
|
||
"workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64",
|
||
"folderPath": "/Operations",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-08-09T18:04:11.000Z"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ImportWorkflowRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace in which to import the workflow."
|
||
},
|
||
"workflow": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "JSON string containing a workflow export object or bare workflow state."
|
||
},
|
||
{
|
||
"type": "object",
|
||
"additionalProperties": true,
|
||
"description": "Workflow export object or bare workflow state."
|
||
}
|
||
],
|
||
"description": "Workflow export object, bare workflow state, or JSON string containing either form."
|
||
},
|
||
"folderPath": {
|
||
"description": "Destination folder path; omit for the workspace root.",
|
||
"$ref": "#/components/schemas/FolderPathInput"
|
||
},
|
||
"name": {
|
||
"description": "Override for the imported workflow name.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 200
|
||
},
|
||
"description": {
|
||
"description": "Override for the imported workflow description.",
|
||
"type": "string",
|
||
"maxLength": 2000
|
||
}
|
||
},
|
||
"required": ["workspaceId", "workflow"],
|
||
"additionalProperties": false,
|
||
"title": "Import workflow request",
|
||
"description": "Portable workflow data and destination metadata for an import."
|
||
},
|
||
"ChatDeploymentListItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique chat deployment identifier."
|
||
},
|
||
"workflowId": {
|
||
"type": "string",
|
||
"description": "Workflow this deployment publishes."
|
||
},
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"description": "Workspace the deployment belongs to, derived from its workflow."
|
||
},
|
||
"identifier": {
|
||
"type": "string",
|
||
"description": "URL slug the deployed chat answers on. Unique across live deployments."
|
||
},
|
||
"url": {
|
||
"type": "string",
|
||
"description": "Public URL of the deployed chat. There is no chat subdomain — the identifier is a path segment.",
|
||
"examples": ["https://sim.ai/chat/support"]
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "Title shown to visitors."
|
||
},
|
||
"description": {
|
||
"type": "string",
|
||
"description": "Description shown to visitors. Empty when unset."
|
||
},
|
||
"isActive": {
|
||
"type": "boolean",
|
||
"description": "Whether the deployment answers requests."
|
||
},
|
||
"authType": {
|
||
"type": "string",
|
||
"enum": ["public", "password", "email", "sso"],
|
||
"description": "How visitors are gated: `public` (no gate), `password`, `email`, or `sso`."
|
||
},
|
||
"outputConfigs": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/StoredChatDeploymentOutputConfig"
|
||
},
|
||
"description": "Block outputs surfaced to visitors."
|
||
},
|
||
"includeThinking": {
|
||
"type": "boolean",
|
||
"description": "Whether visitors may receive provider thinking events. They must also opt into the streaming protocol."
|
||
},
|
||
"includeToolCalls": {
|
||
"type": "boolean",
|
||
"description": "Whether visitors may receive tool lifecycle events. They must also opt into the streaming protocol."
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the deployment was created.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the deployment was last modified.",
|
||
"format": "date-time"
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"workflowId",
|
||
"workspaceId",
|
||
"identifier",
|
||
"url",
|
||
"title",
|
||
"description",
|
||
"isActive",
|
||
"authType",
|
||
"outputConfigs",
|
||
"includeThinking",
|
||
"includeToolCalls",
|
||
"createdAt",
|
||
"updatedAt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Chat deployment list entry",
|
||
"description": "A workflow published as a hosted chat, without the fields the detail read gates."
|
||
},
|
||
"StoredChatDeploymentOutputConfig": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"description": "Block whose output the chat streams."
|
||
},
|
||
"path": {
|
||
"type": "string",
|
||
"description": "Path within that block output. Empty means the whole output."
|
||
}
|
||
},
|
||
"required": ["blockId", "path"],
|
||
"additionalProperties": false,
|
||
"title": "Stored chat deployment output config",
|
||
"description": "One block output currently surfaced to chat visitors."
|
||
},
|
||
"ChatDeploymentListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/ChatDeploymentListItem"
|
||
},
|
||
"description": "Items in the current page."
|
||
},
|
||
"nextCursor": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Opaque cursor for the next page. Send it back as `cursor`; `null` means there is nothing further to fetch. Never construct one yourself."
|
||
}
|
||
},
|
||
"required": ["data", "nextCursor"],
|
||
"additionalProperties": false,
|
||
"title": "Chat deployment list response",
|
||
"description": "A cursor-paginated page of chat deployments.",
|
||
"examples": [
|
||
{
|
||
"data": [
|
||
{
|
||
"id": "chat_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94",
|
||
"identifier": "support",
|
||
"url": "https://sim.ai/chat/support",
|
||
"title": "Support chat",
|
||
"description": "Ask about billing, onboarding, or outages.",
|
||
"isActive": true,
|
||
"authType": "public",
|
||
"outputConfigs": [
|
||
{
|
||
"blockId": "block_01J8ZK3QW4M6X2R9T7B5C0V4",
|
||
"path": "content"
|
||
}
|
||
],
|
||
"includeThinking": false,
|
||
"includeToolCalls": false,
|
||
"createdAt": "2026-06-12T10:30:00.000Z",
|
||
"updatedAt": "2026-06-12T10:30:00.000Z"
|
||
}
|
||
],
|
||
"nextCursor": null
|
||
}
|
||
]
|
||
},
|
||
"StoredChatDeploymentCustomizations": {
|
||
"type": "object",
|
||
"properties": {
|
||
"primaryColor": {
|
||
"description": "CSS color used for the chat accent.",
|
||
"type": "string"
|
||
},
|
||
"welcomeMessage": {
|
||
"description": "First message shown to a visitor.",
|
||
"type": "string"
|
||
},
|
||
"imageUrl": {
|
||
"description": "Avatar image shown beside assistant messages.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"title": "Stored chat deployment customizations",
|
||
"description": "Presentation overrides currently stored on the deployed chat."
|
||
},
|
||
"ChatDeployment": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Unique chat deployment identifier."
|
||
},
|
||
"workflowId": {
|
||
"type": "string",
|
||
"description": "Workflow this deployment publishes."
|
||
},
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"description": "Workspace the deployment belongs to, derived from its workflow."
|
||
},
|
||
"identifier": {
|
||
"type": "string",
|
||
"description": "URL slug the deployed chat answers on. Unique across live deployments."
|
||
},
|
||
"url": {
|
||
"type": "string",
|
||
"description": "Public URL of the deployed chat. There is no chat subdomain — the identifier is a path segment.",
|
||
"examples": ["https://sim.ai/chat/support"]
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"description": "Title shown to visitors."
|
||
},
|
||
"description": {
|
||
"type": "string",
|
||
"description": "Description shown to visitors. Empty when unset."
|
||
},
|
||
"isActive": {
|
||
"type": "boolean",
|
||
"description": "Whether the deployment answers requests."
|
||
},
|
||
"authType": {
|
||
"type": "string",
|
||
"enum": ["public", "password", "email", "sso"],
|
||
"description": "How visitors are gated: `public` (no gate), `password`, `email`, or `sso`."
|
||
},
|
||
"hasPassword": {
|
||
"type": "boolean",
|
||
"description": "Whether a password is stored. The password itself is never readable."
|
||
},
|
||
"allowedEmails": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"description": "Email addresses or domains admitted under `email` and `sso` gating. Empty otherwise."
|
||
},
|
||
"customizations": {
|
||
"description": "Presentation overrides. Unset fields fall back to platform defaults.",
|
||
"$ref": "#/components/schemas/StoredChatDeploymentCustomizations"
|
||
},
|
||
"outputConfigs": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/StoredChatDeploymentOutputConfig"
|
||
},
|
||
"description": "Block outputs surfaced to visitors."
|
||
},
|
||
"includeThinking": {
|
||
"type": "boolean",
|
||
"description": "Whether visitors may receive provider thinking events. They must also opt into the streaming protocol."
|
||
},
|
||
"includeToolCalls": {
|
||
"type": "boolean",
|
||
"description": "Whether visitors may receive tool lifecycle events. They must also opt into the streaming protocol."
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the deployment was created.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the deployment was last modified.",
|
||
"format": "date-time"
|
||
}
|
||
},
|
||
"required": [
|
||
"id",
|
||
"workflowId",
|
||
"workspaceId",
|
||
"identifier",
|
||
"url",
|
||
"title",
|
||
"description",
|
||
"isActive",
|
||
"authType",
|
||
"hasPassword",
|
||
"allowedEmails",
|
||
"customizations",
|
||
"outputConfigs",
|
||
"includeThinking",
|
||
"includeToolCalls",
|
||
"createdAt",
|
||
"updatedAt"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Chat deployment",
|
||
"description": "A workflow published as a hosted chat."
|
||
},
|
||
"GetWorkflowChatDeploymentResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/ChatDeployment"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Get workflow chat deployment response",
|
||
"description": "The workflow's chat deployment.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "chat_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94",
|
||
"identifier": "support",
|
||
"url": "https://sim.ai/chat/support",
|
||
"title": "Support chat",
|
||
"description": "Ask about billing, onboarding, or outages.",
|
||
"isActive": true,
|
||
"authType": "public",
|
||
"hasPassword": false,
|
||
"allowedEmails": [],
|
||
"customizations": {
|
||
"primaryColor": "#6F3DFA",
|
||
"welcomeMessage": "Hi there! How can I help?"
|
||
},
|
||
"outputConfigs": [
|
||
{
|
||
"blockId": "block_01J8ZK3QW4M6X2R9T7B5C0V4",
|
||
"path": "content"
|
||
}
|
||
],
|
||
"includeThinking": false,
|
||
"includeToolCalls": false,
|
||
"createdAt": "2026-06-12T10:30:00.000Z",
|
||
"updatedAt": "2026-06-12T10:30:00.000Z"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ReplaceWorkflowChatDeploymentResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/ChatDeployment"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Replace workflow chat deployment response",
|
||
"description": "The chat deployment as stored after the replace.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "chat_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94",
|
||
"identifier": "support",
|
||
"url": "https://sim.ai/chat/support",
|
||
"title": "Support chat",
|
||
"description": "Ask about billing, onboarding, or outages.",
|
||
"isActive": true,
|
||
"authType": "public",
|
||
"hasPassword": false,
|
||
"allowedEmails": [],
|
||
"customizations": {
|
||
"primaryColor": "#6F3DFA",
|
||
"welcomeMessage": "Hi there! How can I help?"
|
||
},
|
||
"outputConfigs": [
|
||
{
|
||
"blockId": "block_01J8ZK3QW4M6X2R9T7B5C0V4",
|
||
"path": "content"
|
||
}
|
||
],
|
||
"includeThinking": false,
|
||
"includeToolCalls": false,
|
||
"createdAt": "2026-06-12T10:30:00.000Z",
|
||
"updatedAt": "2026-06-12T10:30:00.000Z"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ChatDeploymentCustomizations": {
|
||
"type": "object",
|
||
"properties": {
|
||
"primaryColor": {
|
||
"description": "CSS color used for the chat accent.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 64
|
||
},
|
||
"welcomeMessage": {
|
||
"description": "First message shown to a visitor.",
|
||
"type": "string",
|
||
"maxLength": 2000
|
||
},
|
||
"imageUrl": {
|
||
"description": "Avatar image shown beside assistant messages.",
|
||
"type": "string",
|
||
"maxLength": 2048
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"title": "Chat deployment customizations",
|
||
"description": "Presentation overrides for the deployed chat."
|
||
},
|
||
"ChatDeploymentOutputConfig": {
|
||
"type": "object",
|
||
"properties": {
|
||
"blockId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Block whose output the chat streams."
|
||
},
|
||
"path": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Path within that block output."
|
||
}
|
||
},
|
||
"required": ["blockId", "path"],
|
||
"additionalProperties": false,
|
||
"title": "Chat deployment output config",
|
||
"description": "One block output surfaced to chat visitors."
|
||
},
|
||
"ReplaceChatDeploymentRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"identifier": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[a-z0-9-]+$",
|
||
"description": "URL slug the deployed chat answers on. Must be free across live deployments."
|
||
},
|
||
"title": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 200,
|
||
"description": "Title shown to visitors."
|
||
},
|
||
"description": {
|
||
"description": "Description shown to visitors. Omitted clears it.",
|
||
"type": "string",
|
||
"maxLength": 2000
|
||
},
|
||
"customizations": {
|
||
"description": "Presentation overrides. Omitted fields take platform defaults.",
|
||
"$ref": "#/components/schemas/ChatDeploymentCustomizations"
|
||
},
|
||
"authType": {
|
||
"description": "How visitors are gated. `public` leaves the chat open to anyone holding the URL.",
|
||
"default": "public",
|
||
"type": "string",
|
||
"enum": ["public", "password", "email", "sso"]
|
||
},
|
||
"password": {
|
||
"description": "Write-only password. Required whenever `authType` is `password`, and rejected otherwise. Never readable back.",
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 1024
|
||
},
|
||
"allowedEmails": {
|
||
"description": "Email addresses or domains admitted under `email` and `sso` gating. At least one is required for those modes.",
|
||
"maxItems": 500,
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
},
|
||
"outputConfigs": {
|
||
"description": "Block outputs to surface to visitors. Omitted surfaces none.",
|
||
"maxItems": 100,
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/ChatDeploymentOutputConfig"
|
||
}
|
||
},
|
||
"includeThinking": {
|
||
"description": "Allow visitors to receive provider thinking events.",
|
||
"default": false,
|
||
"type": "boolean"
|
||
},
|
||
"includeToolCalls": {
|
||
"description": "Allow visitors to receive tool lifecycle events.",
|
||
"default": false,
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["identifier", "title"],
|
||
"additionalProperties": false,
|
||
"title": "Replace chat deployment request",
|
||
"description": "The complete desired state of a workflow's chat.",
|
||
"examples": [
|
||
{
|
||
"identifier": "support",
|
||
"title": "Support chat"
|
||
}
|
||
]
|
||
},
|
||
"DeleteChatDeploymentResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier of the removed chat deployment."
|
||
},
|
||
"deleted": {
|
||
"type": "boolean",
|
||
"const": true,
|
||
"description": "Whether the deployment was removed."
|
||
}
|
||
},
|
||
"required": ["id", "deleted"],
|
||
"additionalProperties": false,
|
||
"title": "Delete chat deployment result",
|
||
"description": "Chat deployment removal acknowledgement."
|
||
},
|
||
"DeleteWorkflowChatDeploymentResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/DeleteChatDeploymentResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Delete workflow chat deployment response",
|
||
"description": "Acknowledgement that the chat deployment was removed.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"id": "chat_01J8ZK3QW4M6X2R9T7B5C0V2",
|
||
"deleted": true
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ExecutionError": {
|
||
"type": "object",
|
||
"properties": {
|
||
"message": {
|
||
"type": "string",
|
||
"description": "Human-readable workflow execution failure message."
|
||
},
|
||
"code": {
|
||
"type": "string",
|
||
"enum": [
|
||
"TIMEOUT",
|
||
"CANCELLED",
|
||
"USAGE_LIMIT_EXCEEDED",
|
||
"INVALID_INPUT",
|
||
"BLOCK_EXECUTION_FAILED",
|
||
"CHILD_WORKFLOW_FAILED",
|
||
"EXECUTION_FAILED"
|
||
],
|
||
"description": "Stable machine-readable execution failure code. `BLOCK_EXECUTION_FAILED` and `CHILD_WORKFLOW_FAILED` are reported only where block attribution is available; elsewhere a block-level failure is reported as `EXECUTION_FAILED`."
|
||
},
|
||
"blockId": {
|
||
"description": "Identifier of the failing block. Present on the synchronous execute response only; the polled run resource and the resume response cannot attribute a block.",
|
||
"type": "string"
|
||
},
|
||
"blockName": {
|
||
"description": "Display name of the failing block. Present on the synchronous execute response only.",
|
||
"type": "string"
|
||
},
|
||
"blockType": {
|
||
"description": "Integration or block type that failed. Present on the synchronous execute response only.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["message", "code"],
|
||
"additionalProperties": false,
|
||
"title": "Execution error",
|
||
"description": "Structured in-band failure details for a workflow run."
|
||
},
|
||
"WorkflowRunResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"runId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
},
|
||
"workflowId": {
|
||
"type": "string",
|
||
"description": "Workflow that produced the run."
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"enum": ["completed", "failed", "paused", "cancelled"],
|
||
"description": "Terminal or paused run status."
|
||
},
|
||
"output": {
|
||
"description": "Workflow output, including partial output on failure."
|
||
},
|
||
"error": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ExecutionError"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Structured execution failure, or null when none occurred."
|
||
},
|
||
"startedAt": {
|
||
"description": "ISO 8601 timestamp when execution started.",
|
||
"format": "date-time",
|
||
"type": "string"
|
||
},
|
||
"endedAt": {
|
||
"description": "ISO 8601 timestamp when execution ended.",
|
||
"format": "date-time",
|
||
"type": "string"
|
||
},
|
||
"durationMs": {
|
||
"description": "Execution duration in milliseconds.",
|
||
"type": "number",
|
||
"minimum": 0
|
||
}
|
||
},
|
||
"required": ["runId", "workflowId", "status", "output", "error"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow run result",
|
||
"description": "Synchronous workflow run output and in-band execution status. Run failures are reported in band, not as HTTP errors — a run that exceeds its execution timeout returns HTTP 200 with `status: \"failed\"` and `error.code: \"TIMEOUT\"`, so branch on `status`."
|
||
},
|
||
"ExecuteWorkflowSyncResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowRunResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Synchronous workflow execution response",
|
||
"description": "Completed, failed, paused, or cancelled synchronous workflow run.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"status": "completed",
|
||
"output": {
|
||
"result": "Ticket routed to Support"
|
||
},
|
||
"error": null,
|
||
"startedAt": "2026-08-09T18:04:10.000Z",
|
||
"endedAt": "2026-08-09T18:04:11.000Z",
|
||
"durationMs": 1000
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"QueuedWorkflowRun": {
|
||
"type": "object",
|
||
"properties": {
|
||
"runId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
},
|
||
"statusUrl": {
|
||
"type": "string",
|
||
"format": "uri",
|
||
"description": "Absolute URL of the workflow run resource."
|
||
}
|
||
},
|
||
"required": ["runId", "statusUrl"],
|
||
"additionalProperties": false,
|
||
"title": "Queued workflow run",
|
||
"description": "Receipt returned when a workflow run is queued."
|
||
},
|
||
"ExecuteWorkflowQueuedResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/QueuedWorkflowRun"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Queued workflow execution response",
|
||
"description": "Receipt returned for an asynchronous workflow run.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"statusUrl": "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/runs/run_8f14e45f-ceea-467f-a"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ExecuteWorkflowRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"input": {
|
||
"description": "Workflow input keyed by the selected trigger input-field name.",
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "Value supplied for one workflow input field."
|
||
}
|
||
},
|
||
"run": {
|
||
"description": "Workflow state and entry point to execute. Omit for the active deployment. Manual execution requires a personal API key with write access and supports synchronous or streamed runs only.",
|
||
"oneOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"source": {
|
||
"type": "string",
|
||
"const": "deployment",
|
||
"description": "Execute the active deployed workflow state."
|
||
}
|
||
},
|
||
"required": ["source"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"source": {
|
||
"type": "string",
|
||
"const": "manual",
|
||
"description": "Execute the current saved workflow state manually."
|
||
},
|
||
"entry": {
|
||
"description": "Manual entry mode. Omit to enter through the workflow trigger; a block entry requires an exact source run.",
|
||
"oneOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"const": "trigger",
|
||
"description": "Enter the manual run through a runnable trigger."
|
||
},
|
||
"blockId": {
|
||
"description": "Runnable trigger block to enter through. Omit only when the saved workflow has exactly one runnable trigger.",
|
||
"type": "string",
|
||
"minLength": 1
|
||
},
|
||
"useMockPayload": {
|
||
"description": "Use the selected trigger's server-derived mock payload. Cannot be combined with `input`.",
|
||
"type": "boolean"
|
||
}
|
||
},
|
||
"required": ["type"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"type": {
|
||
"type": "string",
|
||
"const": "block",
|
||
"description": "Resume manual execution at a block using persisted upstream state."
|
||
},
|
||
"blockId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Saved workflow block at which manual execution should resume."
|
||
},
|
||
"sourceRunId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Exact prior run whose persisted execution snapshot supplies upstream block state."
|
||
}
|
||
},
|
||
"required": ["type", "blockId", "sourceRunId"],
|
||
"additionalProperties": false
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"required": ["source"],
|
||
"additionalProperties": false
|
||
}
|
||
]
|
||
},
|
||
"async": {
|
||
"default": false,
|
||
"description": "Queue the run and return a 202 receipt when true. Requires an API key, cannot be combined with `stream`, and rejects all streaming and output-shaping options (`selectedOutputs`, `includeThinking`, `includeToolCalls`, `includeFileBase64`, `base64MaxBytes`).",
|
||
"type": "boolean"
|
||
},
|
||
"executionTimeoutSeconds": {
|
||
"description": "Requested server-side timeout for an asynchronous run, in seconds. An upper bound, not the effective timeout: the run uses the smaller of this value and the plan's execution timeout, so requesting more than the plan allows silently yields the plan timeout. Rejected with `400` unless `async` is true.",
|
||
"type": "integer",
|
||
"minimum": 1,
|
||
"maximum": 604800
|
||
},
|
||
"stream": {
|
||
"default": false,
|
||
"description": "Return Server-Sent Events instead of JSON when true. Cannot be combined with `async`.",
|
||
"type": "boolean"
|
||
},
|
||
"selectedOutputs": {
|
||
"description": "Block output references to include in a streamed response. Rejected when `async` is true.",
|
||
"maxItems": 100,
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string",
|
||
"minLength": 1
|
||
}
|
||
},
|
||
"includeThinking": {
|
||
"default": false,
|
||
"description": "Include model reasoning events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true.",
|
||
"type": "boolean"
|
||
},
|
||
"includeToolCalls": {
|
||
"default": false,
|
||
"description": "Include tool-call events in an agent-event stream. Requires `stream: true` and the `X-Sim-Stream-Protocol: agent-events-v1` request header, and is rejected when `async` is true.",
|
||
"type": "boolean"
|
||
},
|
||
"includeFileBase64": {
|
||
"description": "Inline eligible output files as base64 content. Rejected when `async` is true.",
|
||
"type": "boolean"
|
||
},
|
||
"base64MaxBytes": {
|
||
"description": "Maximum total bytes of file content to inline as base64, lowering but never raising the server limit of 16 MiB. Rejected when `async` is true.",
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 16777216
|
||
}
|
||
},
|
||
"additionalProperties": false,
|
||
"title": "Execute workflow request",
|
||
"description": "Input, workflow-state selection, and execution-mode options. Each option carries the modes it requires and the modes that reject it; a violated combination is a 400.",
|
||
"examples": [
|
||
{
|
||
"input": {
|
||
"ticketId": "ticket_123"
|
||
}
|
||
},
|
||
{
|
||
"input": {
|
||
"ticketId": "ticket_123"
|
||
},
|
||
"async": true
|
||
},
|
||
{
|
||
"input": {
|
||
"ticketId": "ticket_123"
|
||
},
|
||
"stream": true
|
||
},
|
||
{
|
||
"run": {
|
||
"source": "manual"
|
||
}
|
||
},
|
||
{
|
||
"run": {
|
||
"source": "manual",
|
||
"entry": {
|
||
"type": "block",
|
||
"blockId": "block_123",
|
||
"sourceRunId": "run_123"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowRunListItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"runId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
},
|
||
"workflowId": {
|
||
"type": "string",
|
||
"description": "Workflow that produced the run."
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"enum": [
|
||
"pending",
|
||
"running",
|
||
"paused",
|
||
"redacting",
|
||
"completed",
|
||
"failed",
|
||
"cancelled"
|
||
],
|
||
"description": "Current or terminal run status. `redacting` is transient, reported while a finished run's output is being scrubbed. `paused` means the run is waiting to be resumed — either held at a human-in-the-loop pause point, or left paused by a resume attempt that did not complete. Only the single-run response distinguishes the two, through `paused.automaticResumeWaitingReason`."
|
||
},
|
||
"trigger": {
|
||
"type": "string",
|
||
"description": "Trigger type that started the run."
|
||
},
|
||
"startedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the run started.",
|
||
"format": "date-time"
|
||
},
|
||
"endedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 timestamp when the run ended, or null while active.",
|
||
"format": "date-time"
|
||
},
|
||
"durationMs": {
|
||
"anyOf": [
|
||
{
|
||
"type": "number"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Run duration in milliseconds, or null while active."
|
||
},
|
||
"cost": {
|
||
"anyOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"total": {
|
||
"type": "number",
|
||
"description": "Total credits consumed by the run."
|
||
}
|
||
},
|
||
"required": ["total"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Credit cost, or null when unavailable."
|
||
}
|
||
},
|
||
"required": [
|
||
"runId",
|
||
"workflowId",
|
||
"status",
|
||
"trigger",
|
||
"startedAt",
|
||
"endedAt",
|
||
"durationMs",
|
||
"cost"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Workflow run summary",
|
||
"description": "Summary of a recorded workflow run."
|
||
},
|
||
"WorkflowRunListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowRunListItem"
|
||
},
|
||
"description": "Items in the current page."
|
||
},
|
||
"nextCursor": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Opaque cursor for the next page. Send it back as `cursor`; `null` means there is nothing further to fetch. Never construct one yourself."
|
||
}
|
||
},
|
||
"required": ["data", "nextCursor"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow run list response",
|
||
"description": "A cursor-paginated page of workflow run summaries.",
|
||
"examples": [
|
||
{
|
||
"data": [
|
||
{
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"status": "completed",
|
||
"trigger": "api",
|
||
"startedAt": "2026-08-09T18:04:10.000Z",
|
||
"endedAt": "2026-08-09T18:04:11.000Z",
|
||
"durationMs": 1000,
|
||
"cost": {
|
||
"total": 12
|
||
}
|
||
}
|
||
],
|
||
"nextCursor": null
|
||
}
|
||
]
|
||
},
|
||
"V2RunFile": {
|
||
"type": "object",
|
||
"properties": {
|
||
"id": {
|
||
"type": "string",
|
||
"description": "Identifier to address this file by on the download endpoint."
|
||
},
|
||
"name": {
|
||
"type": "string",
|
||
"description": "File name, including its extension."
|
||
},
|
||
"size": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "File size in bytes."
|
||
},
|
||
"type": {
|
||
"type": "string",
|
||
"description": "MIME type recorded for the file."
|
||
},
|
||
"downloadPath": {
|
||
"type": "string",
|
||
"description": "Path to fetch this file's bytes from, relative to the API host."
|
||
},
|
||
"base64": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Base64-encoded contents when `includeFileBase64` was requested and the file fits the inline ceiling, otherwise null."
|
||
}
|
||
},
|
||
"required": ["id", "name", "size", "type", "downloadPath", "base64"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow run file",
|
||
"description": "A file produced by a workflow run."
|
||
},
|
||
"WorkflowRunStatus": {
|
||
"type": "object",
|
||
"properties": {
|
||
"runId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
},
|
||
"workflowId": {
|
||
"type": "string",
|
||
"description": "Workflow that produced the run."
|
||
},
|
||
"status": {
|
||
"type": "string",
|
||
"enum": [
|
||
"pending",
|
||
"running",
|
||
"paused",
|
||
"redacting",
|
||
"completed",
|
||
"failed",
|
||
"cancelled",
|
||
"queued"
|
||
],
|
||
"description": "Current or terminal run status. `redacting` is transient, reported while a finished run's output is being scrubbed. `paused` means the run is waiting to be resumed — either held at a human-in-the-loop pause point, or left paused by a resume attempt that did not complete. Only the single-run response distinguishes the two, through `paused.automaticResumeWaitingReason`."
|
||
},
|
||
"trigger": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Trigger type that started the run. Backfilled as `api` for a run that is still queued, so it is populated from the first poll."
|
||
},
|
||
"startedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 start timestamp. A queued run reports the time it was enqueued, so it is populated from the first poll.",
|
||
"format": "date-time"
|
||
},
|
||
"endedAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 end timestamp, or null while nonterminal.",
|
||
"format": "date-time"
|
||
},
|
||
"durationMs": {
|
||
"anyOf": [
|
||
{
|
||
"type": "number"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Run duration in milliseconds, or null while active."
|
||
},
|
||
"paused": {
|
||
"anyOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"contextId": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Resume context identifier, or null while every pause point is mid-resume."
|
||
},
|
||
"pausedAt": {
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
|
||
"description": "ISO 8601 timestamp when the execution entered the paused state."
|
||
},
|
||
"resumeAt": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"format": "date-time",
|
||
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO 8601 scheduled automatic-resume timestamp, or null when no resume time is set."
|
||
},
|
||
"pauseKind": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string",
|
||
"enum": ["time", "human"]
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Whether the pause waits for time or human input, or null when unspecified."
|
||
},
|
||
"blockedOnBlockId": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Workflow block awaiting resume, or null when no block is identified."
|
||
},
|
||
"automaticResumeWaitingReason": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Why automatic resume is waiting, or null when it is not — on a paused run, null means it is waiting on human input. Recorded whenever a resume attempt fails and cleared once one succeeds. A non-retryable or exhausted failure is prefixed `Automatic resume requires manual intervention: `."
|
||
},
|
||
"pausePointCount": {
|
||
"type": "number",
|
||
"description": "Number of pause points tracked for the execution."
|
||
},
|
||
"resumedCount": {
|
||
"type": "number",
|
||
"description": "Number of pause points that have resumed."
|
||
}
|
||
},
|
||
"required": [
|
||
"contextId",
|
||
"pausedAt",
|
||
"resumeAt",
|
||
"pauseKind",
|
||
"blockedOnBlockId",
|
||
"automaticResumeWaitingReason",
|
||
"pausePointCount",
|
||
"resumedCount"
|
||
],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Current pause details, or null when the run is not paused."
|
||
},
|
||
"cost": {
|
||
"anyOf": [
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"total": {
|
||
"type": "number",
|
||
"description": "Total credits consumed by the run."
|
||
}
|
||
},
|
||
"required": ["total"],
|
||
"additionalProperties": false
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Credit cost, or null when unavailable."
|
||
},
|
||
"error": {
|
||
"anyOf": [
|
||
{
|
||
"$ref": "#/components/schemas/ExecutionError"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Structured execution failure, or null when none occurred. Reclassified from the persisted error message, so `blockId`/`blockName`/`blockType` are absent and a block-level failure reports `EXECUTION_FAILED` here even when the same run reported `BLOCK_EXECUTION_FAILED` on its synchronous execute response."
|
||
},
|
||
"output": {
|
||
"anyOf": [
|
||
{
|
||
"description": "Final workflow output value."
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Final workflow output when requested, otherwise null."
|
||
},
|
||
"blockOutputs": {
|
||
"anyOf": [
|
||
{
|
||
"type": "object",
|
||
"propertyNames": {
|
||
"type": "string"
|
||
},
|
||
"additionalProperties": {
|
||
"description": "Output value produced by one workflow block."
|
||
}
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Outputs of the blocks named by `selectedOutputs`, or null when none were requested. Gated by `selectedOutputs` alone — `includeOutput` governs `output` only."
|
||
},
|
||
"files": {
|
||
"anyOf": [
|
||
{
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/V2RunFile"
|
||
}
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Files this run produced, or null when `includeOutput` is false. Matches the nullability of `output`."
|
||
}
|
||
},
|
||
"required": [
|
||
"runId",
|
||
"workflowId",
|
||
"status",
|
||
"trigger",
|
||
"startedAt",
|
||
"endedAt",
|
||
"durationMs",
|
||
"paused",
|
||
"cost",
|
||
"error",
|
||
"output",
|
||
"blockOutputs",
|
||
"files"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Workflow run status",
|
||
"description": "Detailed current state of a workflow run."
|
||
},
|
||
"WorkflowRunStatusResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowRunStatus"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow run status response",
|
||
"description": "Detailed current state of a workflow run.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"status": "completed",
|
||
"trigger": "api",
|
||
"startedAt": "2026-08-09T18:04:10.000Z",
|
||
"endedAt": "2026-08-09T18:04:11.000Z",
|
||
"durationMs": 1000,
|
||
"paused": null,
|
||
"cost": {
|
||
"total": 12
|
||
},
|
||
"error": null,
|
||
"output": {
|
||
"result": "Ticket routed to Support"
|
||
},
|
||
"blockOutputs": null,
|
||
"files": [
|
||
{
|
||
"id": "file_1a2b3c",
|
||
"name": "summary.pdf",
|
||
"size": 20480,
|
||
"type": "application/pdf",
|
||
"downloadPath": "/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/runs/run_8f14e45f-ceea-467f-a/files/file_1a2b3c",
|
||
"base64": null
|
||
}
|
||
]
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ResumeWorkflowSyncResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowRunResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Synchronous workflow resume response",
|
||
"description": "Completed, failed, paused, or cancelled resumed workflow run.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36",
|
||
"status": "completed",
|
||
"output": {
|
||
"result": "Ticket routed to Support"
|
||
},
|
||
"error": null,
|
||
"startedAt": "2026-08-09T18:04:10.000Z",
|
||
"endedAt": "2026-08-09T18:04:11.000Z",
|
||
"durationMs": 1000
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"QueuedWorkflowResume": {
|
||
"type": "object",
|
||
"properties": {
|
||
"runId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
},
|
||
"statusUrl": {
|
||
"type": "string",
|
||
"format": "uri",
|
||
"description": "Absolute URL of the workflow run resource."
|
||
},
|
||
"queuePosition": {
|
||
"description": "Current queue position, when available.",
|
||
"type": "integer",
|
||
"exclusiveMinimum": 0,
|
||
"maximum": 9007199254740991
|
||
}
|
||
},
|
||
"required": ["runId", "statusUrl"],
|
||
"additionalProperties": false,
|
||
"title": "Queued workflow resume",
|
||
"description": "Receipt returned when a resumed workflow attempt is queued."
|
||
},
|
||
"ResumeWorkflowQueuedResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/QueuedWorkflowResume"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Queued workflow resume response",
|
||
"description": "Receipt returned when a resumed workflow attempt is queued.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"statusUrl": "https://www.sim.ai/api/v2/workflows/3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36/runs/run_8f14e45f-ceea-467f-a"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"ResumeWorkflowRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"contextId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"description": "Human-in-the-loop pause-context identifier."
|
||
},
|
||
"input": {
|
||
"description": "Input supplied to the paused workflow block."
|
||
}
|
||
},
|
||
"required": ["contextId"],
|
||
"additionalProperties": false,
|
||
"title": "Resume workflow request",
|
||
"description": "Pause context and optional input used to resume a workflow run.",
|
||
"examples": [
|
||
{
|
||
"contextId": "ctx_123",
|
||
"input": {
|
||
"approved": true
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"CancelWorkflowRunResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"success": {
|
||
"type": "boolean",
|
||
"description": "Whether cancellation was accepted."
|
||
},
|
||
"runId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"pattern": "^[A-Za-z0-9._:-]+$",
|
||
"description": "Unique workflow run identifier.",
|
||
"examples": ["run_8f14e45f-ceea-467f-a"]
|
||
},
|
||
"redisAvailable": {
|
||
"type": "boolean",
|
||
"description": "Whether the distributed cancellation channel was available."
|
||
},
|
||
"durablyRecorded": {
|
||
"type": "boolean",
|
||
"description": "Whether this request durably recorded a cancellation. Always false for a run that was already terminal, where the request is satisfied but nothing was written."
|
||
},
|
||
"locallyAborted": {
|
||
"type": "boolean",
|
||
"description": "Whether an in-process execution was aborted."
|
||
},
|
||
"pausedCancelled": {
|
||
"type": "boolean",
|
||
"description": "Whether a paused execution was cancelled."
|
||
},
|
||
"reason": {
|
||
"description": "Machine-readable cancellation outcome, present on every cancellation including full successes. `recorded` is the success value. `already_cancelled`, `already_completed`, and `already_failed` mean the run had already reached that terminal state, so nothing was cancelled and `durablyRecorded` is false. `redis_unavailable` and `redis_write_failed` mean the distributed cancellation signal was not written, so an already-running execution may not observe the cancellation. `paused_event_publish_failed` and `paused_database_cancel_failed` name the failing step for a paused run.",
|
||
"type": "string",
|
||
"enum": [
|
||
"recorded",
|
||
"already_cancelled",
|
||
"already_completed",
|
||
"already_failed",
|
||
"redis_unavailable",
|
||
"redis_write_failed",
|
||
"paused_event_publish_failed",
|
||
"paused_database_cancel_failed"
|
||
]
|
||
}
|
||
},
|
||
"required": [
|
||
"success",
|
||
"runId",
|
||
"redisAvailable",
|
||
"durablyRecorded",
|
||
"locallyAborted",
|
||
"pausedCancelled"
|
||
],
|
||
"additionalProperties": false,
|
||
"title": "Cancel workflow run result",
|
||
"description": "Outcome of a workflow run cancellation request. Cancellation is best-effort: a run already in a terminal state succeeds with no effect, reported as `durablyRecorded: false` with an `already_*` reason naming the state observed."
|
||
},
|
||
"CancelWorkflowRunResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/CancelWorkflowRunResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Cancel workflow run response",
|
||
"description": "Outcome of the cancellation request.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"success": true,
|
||
"runId": "run_8f14e45f-ceea-467f-a",
|
||
"redisAvailable": true,
|
||
"durablyRecorded": true,
|
||
"locallyAborted": true,
|
||
"pausedCancelled": false,
|
||
"reason": "recorded"
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"WorkflowFolder": {
|
||
"type": "object",
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"description": "Folder name."
|
||
},
|
||
"path": {
|
||
"type": "string",
|
||
"title": "Non-root folder path",
|
||
"description": "Canonical folder path used as the public folder identifier.",
|
||
"maxLength": 4096
|
||
},
|
||
"parentPath": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Canonical parent path; `/` is the root.",
|
||
"maxLength": 4096
|
||
},
|
||
"createdAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the folder was created.",
|
||
"format": "date-time"
|
||
},
|
||
"updatedAt": {
|
||
"type": "string",
|
||
"description": "ISO 8601 timestamp when the folder was last updated.",
|
||
"format": "date-time"
|
||
},
|
||
"locked": {
|
||
"type": "boolean",
|
||
"description": "Whether the folder is currently locked for mutation."
|
||
}
|
||
},
|
||
"required": ["name", "path", "parentPath", "createdAt", "updatedAt", "locked"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow folder",
|
||
"description": "A canonical workflow folder and its mutation lock state."
|
||
},
|
||
"WorkflowFolderListResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/components/schemas/WorkflowFolder"
|
||
},
|
||
"description": "Items in the current page."
|
||
},
|
||
"nextCursor": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Always `null` — this list has no `cursor` or `limit` param and returns its whole bounded set in one page. Present so the list can gain pages later without a shape change."
|
||
}
|
||
},
|
||
"required": ["data", "nextCursor"],
|
||
"additionalProperties": false,
|
||
"title": "Workflow folder list response",
|
||
"description": "A list of canonical workflow folders.",
|
||
"examples": [
|
||
{
|
||
"data": [
|
||
{
|
||
"name": "Operations",
|
||
"path": "/Operations",
|
||
"parentPath": "/",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-05-01T09:00:00.000Z",
|
||
"locked": false
|
||
}
|
||
],
|
||
"nextCursor": null
|
||
}
|
||
]
|
||
},
|
||
"CreateWorkflowFolderResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowFolder"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Create workflow folder response",
|
||
"description": "The created workflow folder.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"name": "Operations",
|
||
"path": "/Operations",
|
||
"parentPath": "/",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-05-01T09:00:00.000Z",
|
||
"locked": false
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"NonRootFolderPathInput": {
|
||
"title": "Non-root folder path input",
|
||
"description": "Non-root folder path. A missing leading slash is normalized before validation. Segments are percent-encoded, so a folder shown as \"New folder\" is `/New%20folder`: everything outside `A-Z a-z 0-9 - _ . ~` is escaped as uppercase hex, and only that exact encoding is accepted. A trailing slash, an empty segment, and a literal `.` or `..` segment are rejected. At most 64 segments and 4096 encoded bytes.",
|
||
"maxLength": 4096,
|
||
"type": "string"
|
||
},
|
||
"CreateWorkflowFolderRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace in which to create the folder."
|
||
},
|
||
"path": {
|
||
"description": "Path of the folder to create.",
|
||
"$ref": "#/components/schemas/NonRootFolderPathInput"
|
||
}
|
||
},
|
||
"required": ["workspaceId", "path"],
|
||
"additionalProperties": false,
|
||
"title": "Create workflow folder request",
|
||
"description": "Workspace and canonical path for a new workflow folder."
|
||
},
|
||
"RelocateWorkflowFolderResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/WorkflowFolder"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Relocate workflow folder response",
|
||
"description": "The relocated workflow folder.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"name": "Support",
|
||
"path": "/Support",
|
||
"parentPath": "/",
|
||
"createdAt": "2026-05-01T09:00:00.000Z",
|
||
"updatedAt": "2026-05-01T09:00:00.000Z",
|
||
"locked": false
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"RelocateWorkflowFolderRequest": {
|
||
"type": "object",
|
||
"properties": {
|
||
"workspaceId": {
|
||
"type": "string",
|
||
"minLength": 1,
|
||
"maxLength": 128,
|
||
"description": "Workspace containing the folder."
|
||
},
|
||
"path": {
|
||
"description": "Current folder path.",
|
||
"$ref": "#/components/schemas/NonRootFolderPathInput"
|
||
},
|
||
"destinationPath": {
|
||
"description": "New full path for the folder and its descendants.",
|
||
"$ref": "#/components/schemas/NonRootFolderPathInput"
|
||
}
|
||
},
|
||
"required": ["workspaceId", "path", "destinationPath"],
|
||
"additionalProperties": false,
|
||
"title": "Relocate workflow folder request",
|
||
"description": "Current and destination paths for a workflow folder."
|
||
},
|
||
"DeleteWorkflowFolderResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"path": {
|
||
"type": "string",
|
||
"title": "Folder path",
|
||
"description": "Path of the deleted workflow folder.",
|
||
"maxLength": 4096
|
||
},
|
||
"deleted": {
|
||
"type": "boolean",
|
||
"const": true,
|
||
"description": "Confirms that the folder was deleted."
|
||
},
|
||
"deletedItems": {
|
||
"type": "object",
|
||
"properties": {
|
||
"folders": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Number of folders deleted."
|
||
},
|
||
"workflows": {
|
||
"type": "integer",
|
||
"minimum": 0,
|
||
"maximum": 9007199254740991,
|
||
"description": "Number of workflows deleted."
|
||
}
|
||
},
|
||
"required": ["folders", "workflows"],
|
||
"additionalProperties": false,
|
||
"description": "Resources removed by the deletion."
|
||
}
|
||
},
|
||
"required": ["path", "deleted", "deletedItems"],
|
||
"additionalProperties": false,
|
||
"title": "Delete workflow folder result",
|
||
"description": "Confirmation and deletion counts for a workflow folder."
|
||
},
|
||
"DeleteWorkflowFolderResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"data": {
|
||
"description": "Response data.",
|
||
"$ref": "#/components/schemas/DeleteWorkflowFolderResult"
|
||
}
|
||
},
|
||
"required": ["data"],
|
||
"additionalProperties": false,
|
||
"title": "Delete workflow folder response",
|
||
"description": "Confirmation and counts for the deleted folder.",
|
||
"examples": [
|
||
{
|
||
"data": {
|
||
"path": "/Operations",
|
||
"deleted": true,
|
||
"deletedItems": {
|
||
"folders": 1,
|
||
"workflows": 0
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
},
|
||
"x-generated-by": "scripts/generate-openapi.ts"
|
||
}
|