{ "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": "Workspace Sync", "description": "Portable workflow configuration, workspace forks, push and pull, and durable operation status." }, { "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": [] }, { "oauthBearer": [] } ], "paths": { "/api/v2/workflows": { "get": { "operationId": "listWorkflows", "summary": "List workflows", "description": "List active workflows in a workspace. Requires workspace read access.\n\nUse `scope=archived` to find workflows available for restoration. Filter by folder, deployment, or name; sort and page with the returned cursor. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:read`.", "x-sim-docs-intro": "List active workflows in a workspace. Requires workspace read access.", "x-sim-docs-details": "Use `scope=archived` to find workflows available for restoration. Filter by folder, deployment, or name; sort and page with the returned cursor. Workspace folder trees exceeding 10,000 folders return `413`.", "x-sim-operation": "workflows.list", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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. The folder filter resolves against active folders only, so pairing it with `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. The folder filter resolves against active folders only, so pairing it with `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. Unknown folder paths contribute no matches.", "schema": { "description": "Restrict results to workflows in this folder path. Unknown folder paths contribute no matches.", "$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. Do not rely on case-insensitive ordering when sorting by `name`.", "schema": { "default": "position", "description": "Field used to sort the result. Do not rely on case-insensitive ordering when sorting by `name`.", "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 } } } } } }, "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 an undeployed workflow at the workspace root or in a workflow folder. Requires workspace write access.\n\nThe response includes the seeded start block and its ID for connecting other blocks. A name already used in the destination folder returns `409`. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-docs-intro": "Create an undeployed workflow at the workspace root or in a workflow folder. Requires workspace write access.", "x-sim-docs-details": "The response includes the seeded start block and its ID for connecting other blocks. A name already used in the destination folder returns `409`. Workspace folder trees exceeding 10,000 folders return `413`.", "x-sim-operation": "workflows.create", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "requestBody": { "required": true, "description": "Name, description, workspace, and optional folder for a new workflow.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "name": "Customer support triage", "folderPath": "/Operations" } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } ] } } } } } } }, "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": "Read the saved editable draft, including blocks, edges, loop and parallel containers, and variables. Requires workspace read access. Configured values are included; use this state with Replace workflow state for same-workspace editing, or Export workflow for portable data with registered credential fields cleared. This read records no audit event; `HEAD` mirrors `GET`.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "blocks": {}, "edges": [], "loops": {}, "parallels": {}, "variables": {} } } } } } } }, "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 the draft graph in one write. Requires workspace write access. Concurrent row-locked writes are last-write-wins; IDs owned by another workflow return `409`. Deployments, schedules, and webhook registrations are unchanged. Deploy to serve the edits.\n\nLint is advisory. Use `dryRun=true` to validate without saving, auditing, or notifying collaborators. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.state.replace", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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 writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs.", "schema": { "description": "Validate and lint without writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs.", "type": "boolean" } } ], "requestBody": { "required": true, "description": "A complete replacement draft graph for a workflow.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplaceWorkflowStateRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "blocks": {}, "edges": [] } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "warnings": [], "needsRedeployment": true, "dryRun": false, "lint": { "sources": [], "sinks": [], "orphanBlocks": [], "emptyOutgoingPorts": [], "invalidBranchPorts": [], "invalidConnectionTargets": [], "fieldIssues": [], "unresolvedReferences": [], "tableFieldIssues": [], "manualRunIssue": null, "notes": [] } } } } } } } }, "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}/outline": { "get": { "operationId": "getWorkflowOutline", "summary": "Get workflow outline", "description": "Read the saved draft as a compact outline: connections embedded in their source blocks, loop and parallel children nested under their container, and null values omitted. Fields hidden from agents are omitted too, some of them real configuration, as are blocks whose parent container no longer exists; compare with Get workflow state for the full configuration. Requires workspace read access, and reveals nothing Get workflow state does not: its derived fields, such as `triggerWebhookUrl`, are computed from values that state already returns. The outline is read-only: it adds those derived fields and omits positions and edge handles, so never send it to Replace workflow state; edit with Apply workflow operations or a full state from Get workflow state. This read records no audit event; `HEAD` mirrors `GET`.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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 outline.", "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/WorkflowOutlineResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "blocks": { "start-1": { "type": "starter", "name": "Start", "enabled": true, "connections": { "source": "agent-1" } }, "agent-1": { "type": "agent", "name": "Agent 1", "enabled": true, "inputs": { "systemPrompt": "Route the ticket to the right team." } } } } } } } } } }, "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}/operations": { "post": { "operationId": "applyWorkflowOperations", "summary": "Apply workflow operations", "description": "Apply draft edits and block enablement changes in one write. Requires workspace write access. The live deployment is unchanged; lint is advisory.\n\nInspect `skipped` and `inputValidationErrors` for edits that did not apply. Deferred edges apply when their targets exist; do not resubmit them. With `atomic=true`, declined operations or dropped inputs return `409` (`OPERATIONS_NOT_APPLIED`) without saving. A `409` with code `CONFLICT` means the workflow changed after the batch read it and nothing was saved; re-read the workflow and retry. Use returned `mintedBlockIds` in later requests. `dryRun=true` evaluates without saving, auditing, or notifying. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.operations.apply", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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 writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs.", "schema": { "description": "Validate and lint without writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs.", "type": "boolean" } } ], "requestBody": { "required": true, "description": "A batch of semantic edits against a workflow graph.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplyWorkflowOperationsRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "operations": [ { "operation_type": "add", "block_id": "agent-1", "params": { "type": "agent", "name": "Triage", "inputs": { "tools": [ { "type": "cloudwatch", "operation": "describe_alarm_history", "usageControl": "auto", "params": {} } ] } } } ] } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "applied": 1, "skipped": [], "deferred": [], "inputValidationErrors": [], "mintedBlockIds": { "agent-1": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77" }, "lint": { "sources": [ { "blockId": "start-1", "blockName": "Start", "blockType": "start_trigger" } ], "sinks": [ { "blockId": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "blockName": "Triage", "blockType": "agent" } ], "orphanBlocks": [], "emptyOutgoingPorts": [], "invalidBranchPorts": [], "invalidConnectionTargets": [], "fieldIssues": [ { "blockId": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "blockName": "Triage", "blockType": "agent", "missingRequiredFields": ["systemPrompt"], "inactiveModeValues": [] } ], "unresolvedReferences": [], "tableFieldIssues": [], "manualRunIssue": null, "notes": [] }, "warnings": [ "Workflow lint found issues (Blocks missing required fields: 1). The findings are in `lint`." ], "needsRedeployment": true, "dryRun": false } } } } } } }, "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, or delete variables by name with workspace write access. Operations run in order. Values are coerced to their declared type when possible and otherwise stored as supplied. A no-op batch returns `changed: false`; read current values with Get workflow.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.variables.apply_operations", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "variableCount": 3, "changed": true } } } } } } }, "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": "Create an undeployed copy of a workflow's graph and variables in the same workspace. Requires workspace write access. The destination folder and name default to the source; name collisions in the destination are resolved automatically. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.duplicate", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "name": "Customer support triage (copy)", "folderPath": "/Operations" } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } } } } } } }, "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": "Restore an archived workflow and its archived schedules, webhooks, MCP tools, and hosted chat. Requires workspace write access. An active workflow returns `409`. If its folder is archived, the workflow returns to the workspace root. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.restore", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } } } } } } }, "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": "Move up to 100 workflows to one folder with workspace write access. Each move succeeds or fails independently; missing, archived, or locked workflows appear in `failed`. Duplicate IDs are ignored. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.bulk.move", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "requestBody": { "required": true, "description": "Workflows to relocate and the folder to relocate them into.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MoveWorkflowsRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "workflowIds": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"], "folderPath": "/Operations" } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "moved": ["3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36"], "failed": [], "folderPath": "/Operations" } } } } } } }, "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 workflow metadata, variables, and trigger input fields from the saved draft. Requires workspace read access. Input fields may differ from the live deployment; `inputSchema` describes the `input` an API run of the active deployment accepts. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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": [ { "name": "ticket", "type": "string" } ], "inputSchema": { "type": "object", "properties": { "ticket": { "type": "string" } }, "required": ["ticket"] } } } } } } } }, "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": "Update a workflow's name, description, or folder path with workspace write access. Omitted fields remain unchanged; `description: null` clears the description. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.update", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "name": "Customer support and escalation", "folderPath": "/Operations" } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } } } } } } }, "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 and stop its schedules, webhooks, MCP tools, and hosted chat. Requires workspace write access. Find it with List workflows (`scope=archived`) and recover it with Restore workflow. Both `deleted` and `archived` acknowledge archival.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.delete", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "deleted": true, "archived": true } } } } } } }, "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 saved deployment versions, newest first, with workspace read access. Each version pins an immutable graph; its name and release note can be updated.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.versions.list", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 } } } } } }, "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/compare": { "get": { "operationId": "compareWorkflowVersionsV2", "summary": "Compare workflow versions", "description": "Compare two deployment versions of the same workflow with workspace read access. The comparison excludes layout changes and withholds credential-bearing values while reporting their changes. Connections include stable block and port IDs. The combined snapshots and the comparison result must each fit within 16 MiB.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.versions.compare", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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": "base", "in": "query", "required": true, "description": "Deployment version to compare from.", "schema": { "type": "integer", "exclusiveMinimum": 0, "maximum": 2147483647, "description": "Deployment version to compare from." } }, { "name": "target", "in": "query", "required": true, "description": "Deployment version to compare to, in the same workflow.", "schema": { "type": "integer", "exclusiveMinimum": 0, "maximum": 2147483647, "description": "Deployment version to compare to, in the same workflow." } } ], "responses": { "200": { "description": "Changes from the base deployment to the target 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/WorkflowVersionComparisonResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "base": 1, "target": 2, "diff": { "addedBlocks": [], "removedBlocks": [], "modifiedBlocks": [], "edgeChanges": { "added": 0, "removed": 0, "addedDetails": [], "removedDetails": [] }, "loopChanges": { "added": 0, "removed": 0, "modified": 0 }, "parallelChanges": { "added": 0, "removed": 0, "modified": 0 }, "containerChanges": [], "variableChanges": { "added": 0, "removed": 0, "modified": 0, "addedNames": [], "removedNames": [], "modifiedNames": [] }, "hasChanges": false } } } } } } } }, "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/{workflowId}/versions/{version}": { "get": { "operationId": "getWorkflowVersionV2", "summary": "Get workflow version", "description": "Get a deployment version and its pinned graph with workspace read access. Registered credential fields and opaque table/tool values are cleared. Environment references and ordinary workflow variables remain included; review other configuration before sharing.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.versions.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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": [] } } } } } } } }, "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": "Update a deployment version's name or release note with workspace write access. Omitted fields remain unchanged; `description: null` clears the note. The graph and live version are unchanged. Use Activate workflow version to serve it.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.versions.update", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "name": "Escalation routing", "description": "Adds the priority escalation branch." } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "version": 3, "name": "Escalation routing", "description": "Adds the priority escalation branch." } } } } } } }, "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": "Activate a specific deployment version asynchronously. Requires workspace Admin access and works when the workflow is undeployed. The draft is unchanged. Poll Get workflow deployment for the accepted `latestDeploymentAttempt`; `isDeployed` alone can describe an older live version. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.versions.activate", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": {} } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 } } } } } } }, "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 a deployment version, discarding current draft edits. Requires workspace Admin access. Use `active` for the live version. The live deployment is unchanged; use Activate workflow version or Rollback workflow to change it. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.versions.revert", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": {} } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "version": 3, "lastSaved": 1765535400000 } } } } } } }, "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 live deployment status, the latest attempt's readiness or failure, and draft divergence (`needsRedeployment`). Requires workspace read access. `isPublicApi` reports anonymous billed execution; `webhooks` lists registered delivery URLs.\n\n`/workflows/{workflowId}/deployment` controls overall API executability; `/deployments/chat` controls only the hosted-chat surface. A workflow can remain deployed without a chat.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 }, "webhooks": [ { "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V3", "provider": "generic", "url": "https://www.sim.ai/api/webhooks/trigger/leads" } ] } } } } } } }, "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 execution of the deployed workflow. Requires workspace Admin access. Enabling lets anyone with the execution URL consume billed usage. Organization sharing restrictions return `403` with `PUBLIC_SHARING_NOT_ALLOWED`. Hosted chat is managed separately. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.public_api.update", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "isPublicApi": true } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "isPublicApi": true } } } } } } }, "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}/triggers": { "get": { "operationId": "listWorkflowTriggers", "summary": "List workflow triggers", "description": "List the schedules, polling triggers, internal-event triggers, and webhooks the live deployment serves, including disabled ones, with their failure counts. Requires workspace read access. Schedules and polling triggers disable themselves after 100 consecutive failures; a `webhook` trigger's failures happen at the sender, so its `failedCount` stays 0. Empty while the workflow is not deployed. Returns one page; `nextCursor` is always null.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.triggers.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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 live deployment's triggers.", "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/WorkflowTriggerListResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": [ { "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V4", "kind": "schedule", "provider": null, "enabled": false, "status": "disabled", "failedCount": 100, "lastFailedAt": "2026-08-09T18:04:11.000Z", "nextRunAt": null, "lastRanAt": "2026-08-09T18:04:00.000Z", "cronExpression": "0 * * * *", "timezone": "UTC", "url": null } ], "nextCursor": null } } } } } }, "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}/triggers/{blockId}": { "patch": { "operationId": "updateWorkflowTrigger", "summary": "Update workflow trigger", "description": "Enable or disable one trigger of the live deployment without redeploying. Requires workspace write access. Enabling resets `failedCount`, schedules the next run, and clears any polling backoff; a schedule whose cron expression is invalid or has no future runs returns `400`. A permission group that blocks webhook triggers returns `403` when a member it governs enables a polling, internal-event, or webhook trigger; a workspace API key is not governed by permission groups, as with every other capability. Disabling a completed schedule marks it disabled. A block with several live rows switches them together. Requesting the current state changes nothing.\n\nDisabling only stops Sim from accepting the trigger; nothing is removed at the provider. A disable lasts until the next deploy or version activation, which re-enables every trigger, the same way it clears a trigger that disabled itself after repeated failures. Deliveries to a disabled webhook receive `404`, and some providers disable their subscription after repeated failures, which requires a redeploy to restore.\n\nA schedule's cron expression and timezone cannot be changed here: deploy computes them from the schedule block, and a deployed version is never edited. Change the block's schedule fields in the draft with Apply workflow operations, then deploy.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.triggers.set_enabled", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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": "blockId", "in": "path", "required": true, "description": "Trigger block in the deployed workflow.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Trigger block in the deployed workflow." } } ], "requestBody": { "required": true, "description": "Enable or disable one trigger of the live deployment. A schedule's timing is not set here: it comes from the deployed schedule block, so edit that block in the draft and deploy.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkflowTriggerRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "enabled": true } } } } } }, "responses": { "200": { "description": "The trigger after the update.", "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/UpdateWorkflowTriggerResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V4", "kind": "schedule", "provider": null, "enabled": true, "status": "active", "failedCount": 0, "lastFailedAt": "2026-08-09T18:04:11.000Z", "nextRunAt": "2026-08-10T09:00:00.000Z", "lastRanAt": "2026-08-09T18:04:00.000Z", "cronExpression": "0 * * * *", "timezone": "UTC", "url": null } } } } } } }, "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/schedules": { "get": { "operationId": "listWorkspaceSchedules", "summary": "List workspace schedules", "description": "List the schedules every deployed workflow in a workspace runs, including disabled ones, with their timing and failure counts. Requires workspace read access. These are the same schedules List workflow triggers reports for each workflow; a workflow that is not deployed has none. To change a schedule's timing, edit its schedule block in the draft and deploy; to pause or resume one, use Update workflow trigger.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.triggers.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "query", "required": true, "description": "Workspace whose schedules should be listed.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace whose schedules should be listed." } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum schedules to return per page. Must be a whole number from 1 to 100. Defaults to 50.", "schema": { "default": 50, "description": "Maximum schedules 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": "sortBy", "in": "query", "required": false, "description": "Field used to sort the result. `createdAt` is when the schedule was created for the deployment version that runs it: each deploy creates new schedule rows, so a redeployed workflow's schedules move to the newest end.", "schema": { "default": "createdAt", "description": "Field used to sort the result. `createdAt` is when the schedule was created for the deployment version that runs it: each deploy creates new schedule rows, so a redeployed workflow's schedules move to the newest end.", "type": "string", "enum": ["createdAt"] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "Sort direction.", "schema": { "default": "desc", "description": "Sort direction.", "type": "string", "enum": ["asc", "desc"] } } ], "responses": { "200": { "description": "A page of schedules.", "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/WorkspaceScheduleListResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": [ { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workflowName": "Customer support triage", "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V4", "enabled": true, "status": "active", "failedCount": 0, "lastFailedAt": null, "nextRunAt": "2026-08-10T09:00:00.000Z", "lastRanAt": "2026-08-10T08:00:00.000Z", "cronExpression": "0 * * * *", "timezone": "UTC" } ], "nextCursor": null } } } } } }, "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}/deploy": { "post": { "operationId": "deployWorkflow", "summary": "Deploy workflow", "description": "Create a deployment version and activate it asynchronously. Requires workspace Admin access. Each accepted deploy creates a new version; retrying after a timeout can create a duplicate. Poll Get workflow deployment for the accepted `latestDeploymentAttempt` before treating the version as live.\n\n`lint` reports advisory findings for this version and never blocks deployment. A conflicting webhook path returns `409`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.deploy", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "name": "Escalation routing", "description": "Adds the priority escalation branch." } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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, "lint": { "sources": [], "sinks": [], "orphanBlocks": [], "emptyOutgoingPorts": [], "invalidBranchPorts": [], "invalidConnectionTargets": [], "fieldIssues": [], "unresolvedReferences": [], "tableFieldIssues": [], "manualRunIssue": null, "notes": [] } } } } } } } }, "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 live workflow version and stop its scheduled and webhook triggers. Requires workspace Admin access and a deployed workflow. Deployed MCP tools become inactive; `archivedMcpTools` identifies them. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.undeploy", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "isDeployed": false, "deployedAt": null, "warnings": [], "activeDeployment": null, "latestDeploymentAttempt": null, "archivedMcpTools": [] } } } } } } }, "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": "Activate a previous deployment version asynchronously, defaulting to the preceding active version. Requires workspace Admin access and a deployed workflow. The draft is unchanged. Poll the accepted `latestDeploymentAttempt`. To select a version while undeployed, use Activate workflow version. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.versions.activate", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "version": 2 } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 } } } } } } }, "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 the saved draft as portable workflow data with workspace read access. Registered credential fields and opaque table/tool values are cleared; environment references and ordinary workflow variables remain included. Review other configuration before sharing.\n\nDefault exports clear workspace bindings. Use `includeWorkspaceBindings=true` to retain non-secret bindings for a same-workspace import, or `includeReferences=true` for source identities and field occurrences used by mapped imports. Exporting records an audit event. `HEAD` checks access with the same authorization as `GET` but skips side effects, returning an empty `200` without payload headers on success. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.export", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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": "includeReferences", "in": "query", "required": false, "description": "Include non-secret resource identifiers and source field occurrences for mapped imports.", "schema": { "description": "Include non-secret resource identifiers and source field occurrences for mapped imports.", "type": "boolean" } }, { "name": "includeWorkspaceBindings", "in": "query", "required": false, "description": "Keep non-secret table, knowledge base, document, folder, channel, and other workspace bindings for a same-workspace import. Defaults to false, which clears these IDs. Registered credential fields and opaque table/tool values are cleared either way; environment references and ordinary workflow variables remain included.", "schema": { "description": "Keep non-secret table, knowledge base, document, folder, channel, and other workspace bindings for a same-workspace import. Defaults to false, which clears these IDs. Registered credential fields and opaque table/tool values are cleared either way; environment references and ordinary workflow variables remain included.", "type": "boolean" } } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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": [] } } } } } } } }, "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 an undeployed workflow from a portable export object, bare draft state, or JSON string. Requires workspace write access. The empty-state example creates a draft that needs runnable blocks before execution.\n\nMapped imports require a preview with the same choices, its `previewFingerprint`, and a stable `requestId`. Unresolved required configuration creates nothing. Identical retries return the committed result; reusing the ID with changed inputs returns `409`. The result includes regenerated graph IDs and an operation receipt. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.import", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "requestBody": { "required": true, "description": "Workflow document, destination, and optional reviewed mappings. This example creates an empty draft.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportWorkflowBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "name": "Support draft", "workflow": { "blocks": {}, "edges": [] } } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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", "blocks": [ { "id": "block_start", "type": "starter", "name": "Start" }, { "id": "block_triage", "type": "agent", "name": "Triage" }, { "id": "block_reply", "type": "response", "name": "Reply" } ], "warnings": [ "Triage: knowledgeBaseId was stripped by export; set it before running" ] } } } } } } }, "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 hosted chats and their URLs with workspace read access and cursor pagination. Filter by `workflowId` for one workflow's chat. The admin-only detail read also includes visitor access settings and customizations. Passwords are never returned; organization permission groups can restrict chat deployment access.\n\nOAuth scope: `api:read`.", "x-sim-operation": "chat_deployments.list", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 } } } } } }, "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": "Get a workflow's hosted chat and visitor access settings with workspace Admin access. A missing chat returns `404`. Passwords are never returned; `hasPassword` reports whether one is set. Hosted chat and workflow API deployment are managed separately. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "chat_deployments.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } } } } } } }, "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": "Create or replace a workflow's hosted chat and deploy its saved draft. Requires workspace Admin access. Omitted fields use defaults; customization exceptions are described on their fields.\n\nPassword authentication requires `password`; email or SSO requires non-empty `allowedEmails`. Public authentication lets anyone with the chat URL run it. A duplicate identifier or pending deployment returns `409`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "chat_deployments.replace", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "identifier": "support", "title": "Support chat" } } } } } }, "responses": { "200": { "description": "The saved 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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } } } } } } }, "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": "Remove the hosted chat and release its URL identifier with workspace Admin access. The workflow API deployment remains active; use Undeploy workflow to stop it. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "chat_deployments.delete", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "id": "chat_01J8ZK3QW4M6X2R9T7B5C0V2", "deleted": true } } } } } } }, "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": "Run the active deployment, set `run: { source: \"deployment\", version }` to run an earlier deployment version, or set `run.source: \"manual\"` to run the saved draft. Deployed execution requires workspace read access and OAuth `api:write` scope or a full-access API key; public deployments also allow anonymous synchronous or streamed runs. Running a chosen version requires workspace write access and a full-access API key or OAuth `api:write` scope; an unknown version returns `404`. Manual runs require a full-access personal API key or OAuth `api:write` scope, and workspace write access; workspace API keys are refused, and manual runs cannot be async.\n\nUse `async: true` for a queue receipt, or `stream: true` for SSE. For a synchronous run with both flags false, send `Accept: application/x-ndjson` for heartbeat frames and a final frame containing `data`. With `waitTimeoutSeconds`, a synchronous run still going when the wait elapses continues in the background and answers with its run receipt instead: `202` on a JSON response, or a closing `detached` frame on an NDJSON stream, which keeps its `200`. Timeouts return `200` with `status: \"failed\"` and `error.code: \"TIMEOUT\"`; inspect run status. See [Streaming](/workflows/deployment/api#streaming) for event formats. Input descriptions specify compatible modes; invalid combinations return `400`.\n\nSupply `X-Run-Id` to prevent duplicate execution. Reuse returns `409`, without replaying results. A `503` with `error.details.code: \"ASYNC_ENQUEUE_AMBIGUOUS\"` omits `Retry-After` because the run may already have started. Reconcile using the returned run ID; do not start another run with a new or omitted ID.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.execute", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] }, {} ], "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": "Run ID for API-key or OAuth callers; ignored for anonymous requests. Reuse it after an uncertain response: a claimed ID returns `409` with `RUN_ID_CONFLICT`, without replaying results. Check Get workflow run, but `404` can persist while the ID remains claimed and does not establish whether execution started. Do not automatically restart with a fresh or omitted ID; either can start another run.", "schema": { "description": "Run ID for API-key or OAuth callers; ignored for anonymous requests. Reuse it after an uncertain response: a claimed ID returns `409` with `RUN_ID_CONFLICT`, without replaying results. Check Get workflow run, but `404` can persist while the ID remains claimed and does not establish whether execution started. Do not automatically restart with a fresh or omitted ID; either can start another run.", "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. Input descriptions specify compatible modes; invalid combinations return `400`.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExecuteWorkflowRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "input": { "ticketId": "ticket_123" } } }, "example2": { "summary": "Request example 2", "value": { "input": { "ticketId": "ticket_123" }, "async": true } }, "example3": { "summary": "Request example 3", "value": { "input": { "ticketId": "ticket_123" }, "stream": true } }, "example4": { "summary": "Request example 4", "value": { "run": { "source": "manual" } } }, "example5": { "summary": "Request example 5", "value": { "run": { "source": "manual" }, "waitTimeoutSeconds": 240 } }, "example6": { "summary": "Request example 6", "value": { "run": { "source": "manual", "entry": { "type": "block", "blockId": "block_123", "sourceRunId": "run_123" } } } }, "example7": { "summary": "Request example 7", "value": { "run": { "source": "manual", "entry": { "type": "block", "blockId": "block_123", "sourceRunId": "run_123" }, "stopAfterBlockId": "block_123" } } } } } } }, "responses": { "200": { "description": "A synchronous run result, heartbeat-delimited NDJSON result stream, 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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "runId": "run_8f14e45f-ceea-467f-a", "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "status": "completed", "output": { "result": "Ticket routed to Support" }, "blockOutputs": null, "error": null, "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", "durationMs": 1000, "executionTimeoutSeconds": 3000 } } } } }, "application/x-ndjson": { "schema": { "type": "string" } }, "text/event-stream": { "schema": { "type": "string" } } } }, "202": { "description": "The asynchronous run was queued, or the synchronous run was still running when `waitTimeoutSeconds` elapsed and continues in the background.", "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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", "executionTimeoutSeconds": 5400 } } } } } } }, "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 workflow runs with workspace read access, filters, and cursor pagination. Cost can be hidden by organization permission groups. Expired runs are permanently deleted by retention cleanup. Sim Cloud Free defaults to 30 days from run start; paid plans and billing-disabled deployments have no default expiry. Organization policies and workspace overrides can set an effective window. Billing-disabled cleanup requires enabled data retention. Runs referenced by active pauses are protected from cleanup.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.runs.list", "x-oauth-scope": "api:read", "tags": ["Workflow Runs"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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 } } } } } }, "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/runs/paused": { "get": { "operationId": "listPausedWorkflowRunsV2", "summary": "List paused workflow runs", "description": "List a workspace's runs waiting on human input, with workspace read access. Each run lists the human pause points it still waits at, exactly as Get workflow run shows them; resume one with Resume workflow run. Request each point's reviewer content with `includeOutput`. Organization permission groups can hide pause fields. A page ends early, with a cursor, once it holds 100 pause points.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.runs.list_paused", "x-oauth-scope": "api:read", "tags": ["Workflow Runs"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "query", "required": true, "description": "Workspace whose paused runs should be listed.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace whose paused runs should be listed." } }, { "name": "includeOutput", "in": "query", "required": false, "description": "Include each pause point's reviewer `display` content when true.", "schema": { "description": "Include each pause point's reviewer `display` content when true.", "type": "boolean" } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum runs to return per page. A page also ends early once it holds 100 pause points, so it can return fewer runs while `nextCursor` is set. Must be a whole number from 1 to 25. Defaults to 10.", "schema": { "default": 10, "description": "Maximum runs to return per page. A page also ends early once it holds 100 pause points, so it can return fewer runs while `nextCursor` is set. Must be a whole number from 1 to 25. Defaults to 10.", "type": "integer", "minimum": 1, "maximum": 25 } }, { "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": "sortBy", "in": "query", "required": false, "description": "Field used to sort the result.", "schema": { "default": "pausedAt", "description": "Field used to sort the result.", "type": "string", "enum": ["pausedAt"] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "Sort direction.", "schema": { "default": "desc", "description": "Sort direction.", "type": "string", "enum": ["asc", "desc"] } } ], "responses": { "200": { "description": "A page of paused 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/PausedRunListResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": [ { "runId": "run_8f14e45f-ceea-467f-a", "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workflowName": "Customer support triage", "pausedAt": "2026-08-09T18:04:11.000Z", "points": [ { "contextId": "blk_approval", "blockId": "blk_approval", "blockName": "Manager approval", "kind": "human", "status": "paused", "registeredAt": "2026-08-09T18:04:11.000Z", "resumeAt": null, "parallel": null, "loop": null, "inputFields": [ { "name": "approved", "label": "Approved", "type": "boolean", "required": true } ], "display": null, "queuePosition": null } ] } ], "nextCursor": null } } } } } }, "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": "Read current run state with workspace read access. Request final output and files with `includeOutput`, or block outputs with `selectedOutputs`. Organization permission groups can hide output, files, or cost. A paused run lists every pause point in `paused.points`, with the fields a human pause asks for and its content with resolved secrets redacted; resume one with Resume workflow run.\n\n`includeFileBase64` inlines file bytes. A file or the total above 16 MiB returns `413` naming a download path; download large files individually. `HEAD` checks access with the same authorization as `GET` but skips side effects, returning an empty `200` without payload headers on success.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.runs.read", "x-oauth-scope": "api:read", "tags": ["Workflow Runs"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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 selector that is not headed by a block id answers `400` instead of 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 selector that is not headed by a block id answers `400` instead of 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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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, "version": 3, "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 } ] } } } } } } }, "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 run-produced file by its reported ID with workspace read access. Downloads record an audit event. Expired runs are permanently deleted by retention cleanup. Sim Cloud Free defaults to 30 days from run start; paid plans and billing-disabled deployments have no default expiry. Organization policies and workspace overrides can set an effective window. Billing-disabled cleanup requires enabled data retention. Runs referenced by active pauses are protected from cleanup. `HEAD` checks access with the same authorization as `GET` but skips side effects, returning an empty `200` without payload headers on success. `HEAD` does not provide byte length; use the file's size in Get workflow run when available.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.download_run_file", "x-oauth-scope": "api:read", "tags": ["Workflow Runs"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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 with workspace write access, naming a `contextId` from the run's `paused.points`. The resumed attempt receives a new run ID and returns a synchronous result or queue receipt. A run that originally streamed resumes asynchronously through v2; this endpoint returns no SSE stream.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.runs.resume", "x-oauth-scope": "api:write", "tags": ["Workflow Runs"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Request example 1", "value": { "contextId": "ctx_123", "input": { "approved": true } } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "runId": "run_8f14e45f-ceea-467f-a", "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "status": "completed", "output": { "result": "Ticket routed to Support" }, "blockOutputs": null, "error": null, "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", "durationMs": 1000 } } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "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" } } } } } } }, "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 with workspace write access. Cancellation is best effort; inspect the outcome flags and `reason`. A terminal run returns `200` with `success: false` and an `already_*` reason. A table workflow-group run returns `409` when its cell can no longer accept cancellation.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.runs.cancel", "x-oauth-scope": "api:write", "tags": ["Workflow Runs"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "success": true, "runId": "run_8f14e45f-ceea-467f-a", "redisAvailable": true, "durablyRecorded": true, "locallyAborted": true, "pausedCancelled": false, "reason": "recorded" } } } } } } }, "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 workflow folders with workspace read access, optional parent/name filters, and sorting. Returns one page; `nextCursor` is always null. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.folders.list", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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. Unknown folder paths contribute no matches.", "schema": { "description": "Restrict results to direct children of this parent path. Unknown folder paths contribute no matches.", "$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. Do not rely on case-insensitive ordering when sorting by `name`.", "schema": { "default": "name", "description": "Field used to sort the result. Do not rely on case-insensitive ordering when sorting by `name`.", "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": [ { "name": "Operations", "path": "/Operations", "parentPath": "/", "createdAt": "2026-05-01T09:00:00.000Z", "updatedAt": "2026-05-01T09:00:00.000Z", "locked": false } ], "nextCursor": null } } } } } }, "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 workflow folder at a non-root path with workspace write access. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.folders.create", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "requestBody": { "required": true, "description": "Workspace and canonical path for a new workflow folder.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowFolderRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "path": "/Operations" } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "name": "Operations", "path": "/Operations", "parentPath": "/", "createdAt": "2026-05-01T09:00:00.000Z", "updatedAt": "2026-05-01T09:00:00.000Z", "locked": false } } } } } } }, "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 update descendant paths with workspace write access. An existing destination receives the folder as a child; otherwise the destination is its new full path. Workspace folder trees exceeding 10,000 folders return `413`.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.folders.relocate", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "requestBody": { "required": true, "description": "Current and destination paths for a workflow folder.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RelocateWorkflowFolderRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "path": "/Operations", "destinationPath": "/Support" } } } } } }, "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "name": "Support", "path": "/Support", "parentPath": "/", "createdAt": "2026-05-01T09:00:00.000Z", "updatedAt": "2026-05-01T09:00:00.000Z", "locked": false } } } } } } }, "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": "Archive an empty workflow folder with workspace write access. `recursive=true` also archives its subfolders and workflows, stopping the archived workflows' triggers and hosted surfaces. Use Restore workflow to recover workflows.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.folders.delete", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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 contents and nested folders too. Required for a non-empty folder. Only the listed case-sensitive spellings are accepted.", "schema": { "description": "Delete the folder's contents and nested folders too. Required for a non-empty folder. Only the listed case-sensitive spellings are accepted.", "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" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "path": "/Operations", "deleted": true, "deletedItems": { "folders": 1, "workflows": 0 } } } } } } } }, "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/{workflowId}/source": { "get": { "operationId": "getWorkflowSource", "summary": "Get workflow source", "description": "Read the saved draft as TypeScript source written against the workflow SDK, with its identity lock and its `base`. The lock binds each block key in the source to its stored id; `base` records the workflow, workspace, freshness fingerprint and block catalog the source was read at. The fingerprint ignores canvas positions, so moving blocks does not change it. Workspace resources such as tables and knowledge bases appear by their resource key: allocated from the resource's name the first time source names it, then never changed, so renaming the resource keeps its key. An id that matches no resource in the workspace prints as an unresolved reference. Function-block code goes to `functions/*` files unless `functionCode` is `inline`. A workflow too large to apply back as source (more than 2000 blocks or 2000 variables, over 4000000 bytes of files in all, or nested deeper than 200 levels) returns `413` naming the measured size. This read records no audit event. `HEAD` checks access as `GET` does and answers with no body, without reading the draft, so it never reports a too-large workflow. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.source.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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": "functionCode", "in": "query", "required": false, "description": "Where function-block code goes: `files` (default) writes it to `functions/*` files referenced with `codeFile()`; `inline` prints it in tagged templates.", "schema": { "description": "Where function-block code goes: `files` (default) writes it to `functions/*` files referenced with `codeFile()`; `inline` prints it in tagged templates.", "type": "string", "enum": ["inline", "files"] } } ], "responses": { "200": { "description": "The workflow draft as source.", "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/GetWorkflowSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "canonicalHash": "0d6e2b8a4c1f7e3d9b5a2c8f4e1d7b3a9c6f2e8d4b1a7c3e9f5d2b8a4c1e7f3d", "sdkMajor": 1, "blockTypes": ["start_trigger"], "diagnostics": [] } } } } } } }, "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": "applyWorkflowSource", "summary": "Apply workflow source", "description": "Write TypeScript workflow source to the saved draft in one all-or-nothing write. Send the files, lock and `base` from Get Workflow Source with your edits. Requires workspace write access. The live deployment is unchanged.\n\nThe server compiles the files and checks them against the same rules as canvas and operation edits. Any error returns `400` with `details.code` `SOURCE_REJECTED` and `details.diagnostics` (each with a file, line and column), and nothing is saved; a source over a size limit (`E_LIMIT_EXCEEDED`) gets the same body with `413`. A `409` means the draft changed since the source was read (`details.currentFingerprint`): get the source again, reapply the edit and retry. A rename onto a name another workflow in the folder took meanwhile returns `409` with `details.code` `SOURCE_NAME_TAKEN`. A `base.workflowId` that names another workflow is refused with `400` (`E_APPLY_WORKFLOW_MISMATCH`). Locked blocks cannot be changed from source. Unchanged blocks keep their ids and stored values, renamed blocks keep their ids, and existing blocks keep their canvas positions. Source that matches the draft returns `applied: false` without saving. The response re-prints the saved source with its new lock and `base`. `dryRun=true` runs every check without saving and answers `200` with the findings in `diagnostics`, a stale `base` included (`E_APPLY_STALE`). A request refused before the source is evaluated is refused on a dry run too: `400` for an invalid body, `413` for a body over the size limit, and `423` for a locked workflow or folder. Returns `403` while workflows as code is not enabled. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.source.apply", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "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": "Run every check without writing, auditing, or notifying collaborators. Findings, errors included, come back in `diagnostics` with `applied: false` and a `200`, and the files, lock and fingerprint show what a committed apply would store. A request refused before the source is evaluated (an invalid or oversized body, a locked workflow or folder) gets the same status as without `dryRun`, and a create under a taken name answers `409`.", "schema": { "description": "Run every check without writing, auditing, or notifying collaborators. Findings, errors included, come back in `diagnostics` with `applied: false` and a `200`, and the files, lock and fingerprint show what a committed apply would store. A request refused before the source is evaluated (an invalid or oversized body, a locked workflow or folder) gets the same status as without `dryRun`, and a create under a taken name answers `409`.", "type": "boolean" } }, { "name": "allowDelete", "in": "query", "required": false, "description": "Allow the apply to delete blocks and variables the source no longer declares. Without it, an apply that would delete any block is refused with `E_APPLY_BLOCK_DELETE`, and one that would delete any variable with `E_APPLY_VARIABLE_DELETE`, naming them. Ignored when creating a workflow.", "schema": { "description": "Allow the apply to delete blocks and variables the source no longer declares. Without it, an apply that would delete any block is refused with `E_APPLY_BLOCK_DELETE`, and one that would delete any variable with `E_APPLY_VARIABLE_DELETE`, naming them. Ignored when creating a workflow.", "type": "boolean" } } ], "requestBody": { "required": true, "description": "Edited source files with the lock and base they were read with.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplyWorkflowSourceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" } } } } } } }, "responses": { "200": { "description": "The applied (or evaluated) source.", "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/ApplyWorkflowSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": false, "applied": false, "diff": { "noop": true, "blocks": { "added": [], "removed": [], "renamed": [], "modified": [] }, "edges": { "added": 0, "removed": 0 }, "variables": { "added": [], "removed": [], "renamed": [], "modified": [] } }, "diagnostics": [], "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "mintedIds": {}, "notes": [], "needsRedeployment": false } } } } } } }, "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}/source/plan": { "post": { "operationId": "planWorkflowSource", "summary": "Plan workflow source", "description": "Report what Apply Workflow Source would do with this source, without writing: whether the draft changed since `base` (`E_APPLY_STALE`), the diff, and every finding, exactly as `dryRun=true` reports them, with `200`. A read: it needs only workspace read access, draws on the source-plan budget rather than the source-write budget (a server already running as many plans as it allows answers `429`), and records no audit or analytics event, so `sim workflows source status` never spends what an apply needs. `allowDelete=true` plans block and variable deletes instead of reporting `E_APPLY_BLOCK_DELETE` or `E_APPLY_VARIABLE_DELETE`. Returns `403` while workflows as code is not enabled. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.source.plan", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "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": "allowDelete", "in": "query", "required": false, "description": "Plan the deletes of blocks and variables the source no longer declares as an apply with `allowDelete` would, listing them in the diff, instead of reporting `E_APPLY_BLOCK_DELETE` or `E_APPLY_VARIABLE_DELETE`.", "schema": { "description": "Plan the deletes of blocks and variables the source no longer declares as an apply with `allowDelete` would, listing them in the diff, instead of reporting `E_APPLY_BLOCK_DELETE` or `E_APPLY_VARIABLE_DELETE`.", "type": "boolean" } } ], "requestBody": { "required": true, "description": "Edited source files with the lock and base they were read with.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlanWorkflowSourceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" } } } } } } }, "responses": { "200": { "description": "The evaluated source.", "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/PlanWorkflowSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": true, "applied": false, "diff": { "noop": true, "blocks": { "added": [], "removed": [], "renamed": [], "modified": [] }, "edges": { "added": 0, "removed": 0 }, "variables": { "added": [], "removed": [], "renamed": [], "modified": [] } }, "diagnostics": [], "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "mintedIds": {}, "notes": [], "needsRedeployment": false } } } } } } }, "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/workspaces/{workspaceId}/workflows/source": { "post": { "operationId": "createWorkflowFromSource", "summary": "Create workflow from source", "description": "Create a workflow from TypeScript workflow source in one all-or-nothing write. Requires workspace write access. The source is compiled and checked against the same rules as Apply Workflow Source; every block is new. Any error returns `400` with `details.code` `SOURCE_REJECTED` and `details.diagnostics` (each with a file, line and column), and nothing is created; a source over a size limit (`E_LIMIT_EXCEEDED`) gets the same body with `413`. The name defaults to the one in the source's `workflow('…')` call; a name already used in the folder returns `409` with `details.code` `SOURCE_NAME_TAKEN`. The response carries the new `workflowId` and the source re-printed from what was saved, with its lock and `base`, ready for the next apply. The workflow is not deployed. `dryRun=true` runs every check without creating anything and answers `200` with the findings in `diagnostics`. A request refused before the source is evaluated is refused on a dry run too: `400` for an invalid body, `404` for a missing folder, `413` for a body over the size limit, and `423` for a locked folder. A taken name is checked after the source compiles and answers `409` (`SOURCE_NAME_TAKEN`) on a dry run as on a create. Returns `403` while workflows as code is not enabled. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.source.create", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace in which to create the workflow.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace in which to create the workflow." } }, { "name": "dryRun", "in": "query", "required": false, "description": "Run every check without writing, auditing, or notifying collaborators. Findings, errors included, come back in `diagnostics` with `applied: false` and a `200`, and the files, lock and fingerprint show what a committed apply would store. A request refused before the source is evaluated (an invalid or oversized body, a locked workflow or folder) gets the same status as without `dryRun`, and a create under a taken name answers `409`.", "schema": { "description": "Run every check without writing, auditing, or notifying collaborators. Findings, errors included, come back in `diagnostics` with `applied: false` and a `200`, and the files, lock and fingerprint show what a committed apply would store. A request refused before the source is evaluated (an invalid or oversized body, a locked workflow or folder) gets the same status as without `dryRun`, and a create under a taken name answers `409`.", "type": "boolean" } }, { "name": "allowDelete", "in": "query", "required": false, "description": "Allow the apply to delete blocks and variables the source no longer declares. Without it, an apply that would delete any block is refused with `E_APPLY_BLOCK_DELETE`, and one that would delete any variable with `E_APPLY_VARIABLE_DELETE`, naming them. Ignored when creating a workflow.", "schema": { "description": "Allow the apply to delete blocks and variables the source no longer declares. Without it, an apply that would delete any block is refused with `E_APPLY_BLOCK_DELETE`, and one that would delete any variable with `E_APPLY_VARIABLE_DELETE`, naming them. Ignored when creating a workflow.", "type": "boolean" } } ], "requestBody": { "required": true, "description": "Source files and where to create the workflow.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowFromSourceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "folderPath": "/Operations" } } } } } }, "responses": { "200": { "description": "The created (or evaluated) 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/CreateWorkflowFromSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": false, "applied": true, "diff": { "noop": false, "blocks": { "added": [ { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "key": "start", "type": "start_trigger" } ], "removed": [], "renamed": [], "modified": [] }, "edges": { "added": 0, "removed": 0 }, "variables": { "added": [], "removed": [], "renamed": [], "modified": [] } }, "diagnostics": [], "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "mintedIds": { "start": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77" }, "notes": [], "needsRedeployment": false } } } } } } }, "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/workspaces/{workspaceId}/workflows/source/resources": { "get": { "operationId": "getSourceResources", "summary": "Get source resources", "description": "List the workspace resources workflow source can name, each with the key source uses for it: tables with their columns, knowledge bases, saved credentials with their provider, workflows with their start-block inputs, workspace skills and custom tools, MCP servers with the tool names they list, and the names (never values) of the environment variables a run can read. A resource keeps its key when renamed; one that no source has named yet is given its key by this call. Each kind lists its oldest 1000 resources, and `truncated` says when there were more. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workflows.source.resources.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace whose resources to list.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace whose resources to list." } } ], "responses": { "200": { "description": "The resources workflow source can name.", "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/GetSourceResourcesResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "tables": [ { "key": "tickets", "id": "tbl_4f1c2a9e", "name": "Tickets", "columns": [ { "name": "subject", "type": "string" }, { "name": "status", "type": "select", "options": ["open", "closed"] } ] } ], "knowledgeBases": [ { "key": "docs", "id": "kb_93a1e7c2", "name": "Docs" } ], "credentials": [ { "key": "support-slack", "id": "cred_51d0b8f4", "name": "Support Slack", "provider": "slack" } ], "workflows": [ { "key": "assign-owner", "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "name": "Assign owner", "inputs": [ { "name": "leads", "type": "array" } ] } ], "skills": [ { "key": "triage", "id": "skl_7e2a4c19", "name": "Triage" } ], "customTools": [ { "key": "lookup-order", "id": "ctl_2b8d6f03", "name": "lookup_order" } ], "mcpServers": [ { "key": "github", "id": "mcp-1a2b3c4d", "name": "GitHub", "tools": ["create_issue", "list_issues"] } ], "env": ["CRM_KEY"], "truncated": false } } } } } } }, "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/workspaces/{workspaceId}/fork/preview": { "post": { "operationId": "previewWorkspaceFork", "summary": "Preview workspace fork", "description": "Preview deployed workflows and explicitly selected resources for a new child workspace. Requires source workspace Admin access and permission to create a workspace in its organization. The read-only result supplies the fingerprint for Fork workspace with the same choices. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.preview", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Optional child name and explicitly selected resource copies.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkspaceForkBody" } } } }, "responses": { "200": { "description": "Deployed source workflows, selected-copy count, and a preview fingerprint.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkspaceForkResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "sourceWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "workflows": [], "selectedResourceCount": 0, "draftOnly": true } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork": { "post": { "operationId": "forkWorkspace", "summary": "Fork workspace", "description": "Create a child workspace with undeployed drafts of the source's deployed workflows. Requires source workspace Admin access and permission to create a workspace in its organization. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`.\n\nFirst preview the same name and copy choices, then send the returned fingerprint and a stable request ID. The example fingerprint is illustrative. Identical retries return the same committed operation; changed inputs with that ID return `409`. Poll Get workspace operation until selected resource copies finish. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.create", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Child name and copy choices, with the actual preview fingerprint and a stable request ID.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForkWorkspaceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "name": "Support sandbox", "requestId": "fork-support-2026-10-13", "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a" } } } } } }, "responses": { "200": { "description": "Committed fork receipt and resource-copy progress.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForkWorkspaceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "operationId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "requestId": "fork-support-2026-10-13", "workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "kind": "workspace_fork", "applied": true, "status": "processing", "resourceIds": ["destination_workflow_id"], "issues": [] } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/push/preview": { "post": { "operationId": "previewWorkspacePush", "summary": "Preview workspace push", "description": "Preview changes from this workspace into the other workspace along a direct fork edge. Requires Admin access to both workspaces. The plan lists workflows to create, replace, or archive; replacements overwrite target drafts with the source deployment. Proposed mappings are not saved. Dependent choices use source workflow, block, and field IDs. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.sync.preview", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Other workspace and proposed source-to-target sync choices.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkspacePushBody" } } } }, "responses": { "200": { "description": "Current-to-other workflow actions, required choices, and preview fingerprint.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkspacePushResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "sourceWorkspaceId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "targetWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "ready": true, "workflows": [], "unresolvedBindings": [], "configuration": [], "excludedTargets": [], "triggerSlots": [], "triggerUrlChanges": [] } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/push": { "post": { "operationId": "pushWorkspace", "summary": "Push workspace", "description": "Apply a reviewed sync from this workspace into the other workspace along a direct fork edge. Requires Admin access to both workspaces. Creates unmatched deployed workflows, overwrites mapped target drafts, and archives mapped targets whose sources were deleted or archived. Undeployed sources alone do not archive targets. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`.\n\nSend `confirm: true`, the fingerprint from a preview with identical choices, and a stable request ID. The example hash is illustrative. Changed or unresolved plans return `409` without applying. Identical retries return the committed operation; changed inputs with that ID return `409`. Copies and deployment activation can finish after the transaction commits. Poll Get workspace operation before treating the target as ready. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.sync", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Confirmed current-to-other choices, actual preview fingerprint, and stable request ID.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PushWorkspaceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "otherWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "requestId": "push-support-2026-10-13", "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "confirm": true } } } } } }, "responses": { "200": { "description": "Committed push receipt with copy and deployment readiness.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PushWorkspaceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "operationId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "requestId": "push-support-2026-10-13", "workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "kind": "workspace_push", "applied": true, "status": "processing", "resourceIds": ["destination_workflow_id"], "issues": [] } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/pull/preview": { "post": { "operationId": "previewWorkspacePull", "summary": "Preview workspace pull", "description": "Preview changes from the other workspace into this workspace along a direct fork edge. Requires Admin access to both workspaces. The plan lists workflows to create, replace, or archive; replacements overwrite target drafts with the source deployment. Proposed mappings are not saved. Dependent choices use source workflow, block, and field IDs. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.sync.preview", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Other workspace and proposed source-to-target sync choices.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkspacePullBody" } } } }, "responses": { "200": { "description": "Other-to-current workflow actions, required choices, and preview fingerprint.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkspacePullResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "sourceWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "targetWorkspaceId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "ready": true, "workflows": [], "unresolvedBindings": [], "configuration": [], "excludedTargets": [], "triggerSlots": [], "triggerUrlChanges": [] } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/pull": { "post": { "operationId": "pullWorkspace", "summary": "Pull workspace", "description": "Apply a reviewed sync from the other workspace into this workspace along a direct fork edge. Requires Admin access to both workspaces. Creates unmatched deployed workflows, overwrites mapped target drafts, and archives mapped targets whose sources were deleted or archived. Undeployed sources alone do not archive targets. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`.\n\nSend `confirm: true`, the fingerprint from a preview with identical choices, and a stable request ID. The example hash is illustrative. Changed or unresolved plans return `409` without applying. Identical retries return the committed operation; changed inputs with that ID return `409`. Copies and deployment activation can finish after the transaction commits. Poll Get workspace operation before treating the target as ready. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.sync", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Confirmed other-to-current choices, actual preview fingerprint, and stable request ID.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PullWorkspaceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "otherWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "requestId": "pull-support-2026-10-13", "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "confirm": true } } } } } }, "responses": { "200": { "description": "Committed pull receipt with copy and deployment readiness.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PullWorkspaceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "operationId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "requestId": "pull-support-2026-10-13", "workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "kind": "workspace_pull", "applied": true, "status": "processing", "resourceIds": ["destination_workflow_id"], "issues": [] } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/availability": { "get": { "operationId": "getWorkspaceForkAvailability", "summary": "Get workspace fork availability", "description": "Check whether workspace forking is enabled for this deployment and workspace plan. Requires workspace Admin access. Returns `available: false` when the feature gate is unmet. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.fork.discover", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "responses": { "200": { "description": "Whether forking is enabled for this deployment and workspace plan.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWorkspaceForkAvailabilityResponse" } } } }, "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/workspaces/{workspaceId}/fork/lineage": { "get": { "operationId": "getWorkspaceForkLineage", "summary": "Get workspace fork lineage", "description": "Read this workspace and its direct parent, or `parent: null` when it has no active parent. Requires workspace Admin access. The relationship does not grant access to the parent. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.fork.discover", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "responses": { "200": { "description": "Current workspace and its active direct parent, when present.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWorkspaceForkLineageResponse" } } } }, "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/workspaces/{workspaceId}/fork/children": { "get": { "operationId": "listWorkspaceForkChildren", "summary": "List workspace fork children", "description": "List this workspace's active direct children, newest first, with cursor pagination. Requires workspace Admin access. A fork relationship does not grant access to a child workspace. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.fork.discover", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum items to return per page. Must be a whole number from 1 to 100. Defaults to 50.", "schema": { "default": 50, "description": "Maximum items 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": "sortBy", "in": "query", "required": false, "description": "Supported stable sort key for this collection.", "schema": { "default": "createdAt", "description": "Supported stable sort key for this collection.", "type": "string", "enum": ["createdAt"] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "Sort direction.", "schema": { "default": "desc", "description": "Sort direction.", "type": "string", "enum": ["desc"] } } ], "responses": { "200": { "description": "A page of active direct child workspaces.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceForkChildrenResponse" } } } }, "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/workspaces/{workspaceId}/fork/resources": { "get": { "operationId": "listWorkspaceForkResources", "summary": "List workspace fork resources", "description": "List copyable resources of one kind in this workspace with cursor pagination. Requires workspace Admin access. Fork creation uses file IDs; sync copy choices use file storage keys from source references or file resource reads. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.fork.discover", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum items to return per page. Must be a whole number from 1 to 100. Defaults to 50.", "schema": { "default": 50, "description": "Maximum items 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": "kind", "in": "query", "required": true, "description": "Kind of source resource to list for copy selection.", "schema": { "type": "string", "enum": [ "files", "tables", "knowledgeBases", "customTools", "skills", "mcpServers", "workflowMcpServers" ], "description": "Kind of source resource to list for copy selection." } }, { "name": "sortBy", "in": "query", "required": false, "description": "Supported stable sort key for this collection.", "schema": { "default": "id", "description": "Supported stable sort key for this collection.", "type": "string", "enum": ["id"] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "Sort direction.", "schema": { "default": "asc", "description": "Sort direction.", "type": "string", "enum": ["asc"] } } ], "responses": { "200": { "description": "A page of copyable resource candidates.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceForkResourcesResponse" } } } }, "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/workspaces/{workspaceId}/fork/mappings": { "get": { "operationId": "getWorkspaceForkMappings", "summary": "Get workspace fork mappings", "description": "Read persisted resource mappings in the requested source-to-target direction along a direct fork edge. Requires Admin access to both workspaces. Discover candidates with destination resource reads and selector operations. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.fork.mappings.read", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } }, { "name": "otherWorkspaceId", "in": "query", "required": true, "description": "Workspace on the other side of the direct fork edge.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." } }, { "name": "direction", "in": "query", "required": true, "description": "Push means current to other; pull means other to current, independent of parent/child orientation.", "schema": { "type": "string", "enum": ["push", "pull"], "description": "Push means current to other; pull means other to current, independent of parent/child orientation." } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum items to return per page. Must be a whole number from 1 to 100. Defaults to 50.", "schema": { "default": 50, "description": "Maximum items 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": "sortBy", "in": "query", "required": false, "description": "Supported stable sort key for this collection.", "schema": { "default": "id", "description": "Supported stable sort key for this collection.", "type": "string", "enum": ["id"] } }, { "name": "sortOrder", "in": "query", "required": false, "description": "Sort direction.", "schema": { "default": "asc", "description": "Sort direction.", "type": "string", "enum": ["asc"] } } ], "responses": { "200": { "description": "A page of persisted source-to-target mapping entries.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWorkspaceForkMappingsResponse" } } } }, "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" } } }, "put": { "operationId": "updateWorkspaceForkMappings", "summary": "Update workspace fork mappings", "description": "Update mappings along a direct fork edge with Admin access to both workspaces. Destination resource membership and credential provider compatibility are validated. Push maps current-to-other; pull maps other-to-current. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.mappings.update", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Other workspace, direction, and mapping entries to update.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkspaceForkMappingsBody" } } } }, "responses": { "200": { "description": "Number of mapping records changed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkspaceForkMappingsResponse" } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/rollback": { "post": { "operationId": "rollbackWorkspaceFork", "summary": "Rollback workspace fork", "description": "Restore the latest sync into this workspace from the named other workspace using prior deployed versions. Requires target workspace Admin access. A newer sync from another fork edge returns `409`. Arbitrary draft edits and copied resources are not restored or removed. Inspect `pendingActivations`; retry rollback if activation remains unfinished. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.rollback", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Other workspace whose latest inbound sync should be undone.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RollbackWorkspaceForkBody" } } } }, "responses": { "200": { "description": "Restored, archived, skipped, and still-activating workflow counts.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RollbackWorkspaceForkResponse" } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/unlink": { "post": { "operationId": "unlinkWorkspaceFork", "summary": "Unlink workspace fork", "description": "Remove the direct fork relationship and its mappings with Admin access to the acting workspace. Existing workflows and resources remain available. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.unlink", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Other workspace on the direct fork edge to remove.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnlinkWorkspaceForkBody" } } } }, "responses": { "200": { "description": "Confirmation that the relationship was removed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnlinkWorkspaceForkResponse" } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/fork/exclusions": { "put": { "operationId": "updateWorkspaceForkExclusions", "summary": "Update workspace fork exclusions", "description": "Include or exclude selected workflows from fork sync with workspace Admin access. Excluded workflows are skipped as sources and targets. Missing, archived, and unchanged workflow IDs are skipped. Billing-enabled deployments require Enterprise. Billing-disabled deployments require forking to be enabled by deployment feature configuration, such as `FORKING_ENABLED`. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.fork.exclusions", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } } ], "requestBody": { "required": true, "description": "Workflow IDs and whether to exclude them from sync.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkspaceForkExclusionsBody" } } } }, "responses": { "200": { "description": "Number of workflow exclusion flags changed.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkspaceForkExclusionsResponse" } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workflows/import/preview": { "post": { "operationId": "previewWorkflowImport", "summary": "Preview workflow import", "description": "Validate destination mappings and configuration with workspace write access, without creating a workflow. The result reports readiness, unresolved fields, discovery instructions, and a fingerprint for mapped import with the same choices. Imported provenance never authorizes or queries a source workspace.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workflows.import.preview", "x-oauth-scope": "api:write", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "requestBody": { "required": true, "description": "Portable workflow data and destination metadata for an import.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ImportWorkflowRequest" }, "examples": { "example1": { "summary": "Request example 1", "value": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "folderPath": "/Operations", "workflow": { "blocks": {}, "edges": [] } } } } } } }, "responses": { "200": { "description": "Import readiness, unresolved bindings, and destination discovery instructions.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewWorkflowImportResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "ready": true, "bindings": [], "unresolvedBindings": [], "configuration": [], "unresolvedConfiguration": [], "discovery": [] } } } } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/selectors/list": { "post": { "operationId": "listSelector", "summary": "List selector options", "description": "List authorized workspace configuration choices using the selector key and context from an import or sync preview. Requires workspace read access. Missing OAuth connections require human authorization. Keep workspace, selector, context, and search unchanged while paging; a changed provider page returns `409` and requires restarting without a cursor. Provider pages above 8 MiB return `413`; narrow the search. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "selectors.execute", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "requestBody": { "required": true, "description": "Workspace, registered selector key, context, and optional search/cursor.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSelectorBody" } } } }, "responses": { "200": { "description": "A page of authorized options, continuation cursor, and truncation status.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListSelectorResponse" } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/selectors/get": { "post": { "operationId": "getSelector", "summary": "Get selector option", "description": "Get an authorized configuration choice by provider ID and declared context with workspace read access. Returns `data: null` when the option is absent from complete results. Truncated results or pagination limits that prevent verification return `413`; a list-only lookup checks at most 100 pages or 10,000 options. Workspace API keys return `403`; use a personal API key or scoped OAuth token.\n\nOAuth scope: `api:read`.", "x-sim-operation": "selectors.execute", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "requestBody": { "required": true, "description": "Workspace, registered selector key, context, and provider option ID.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetSelectorBody" } } } }, "responses": { "200": { "description": "The authorized option, or data:null when absent from complete results.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetSelectorResponse" } } } }, "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" }, "429": { "$ref": "#/components/responses/RateLimited" }, "500": { "$ref": "#/components/responses/InternalError" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } } }, "/api/v2/workspaces/{workspaceId}/operations/{operationId}": { "get": { "operationId": "getWorkspaceOperation", "summary": "Get workspace operation", "description": "Read a committed operation and refresh its copy progress, exact admitted deployment readiness, and structured issues with workspace read access. `applied: true` means the transaction committed even if follow-up work failed. This read does not require the fork-specific Admin role or feature gate.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.operations.read", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } }, { "name": "operationId", "in": "path", "required": true, "description": "Durable operation identifier to use for polling.", "schema": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Durable operation identifier to use for polling." } } ], "responses": { "200": { "description": "Refreshed commit, copy progress, and exact deployment readiness.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWorkspaceOperationResponse" } } } }, "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/workspaces/{workspaceId}/operations": { "get": { "operationId": "listWorkspaceOperations", "summary": "List workspace operations", "description": "List stored operation receipts newest first with workspace read access. Filter by the original `requestId` to reconcile an uncertain mutation response. Read an individual operation to refresh its copy and deployment readiness. This list does not require the fork-specific Admin role or feature gate.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.operations.read", "x-oauth-scope": "api:read", "tags": ["Workspace Sync"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Explicit current workspace scope.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." } }, { "name": "limit", "in": "query", "required": false, "description": "Maximum items to return per page. Must be a whole number from 1 to 100. Defaults to 50.", "schema": { "default": 50, "description": "Maximum items 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": "requestId", "in": "query", "required": false, "description": "Find an uncertain mutation by the original client request ID; keep the same filter while paging.", "schema": { "description": "Find an uncertain mutation by the original client request ID; keep the same filter while paging.", "type": "string", "minLength": 1, "maxLength": 128 } } ], "responses": { "200": { "description": "A page of stored operation receipts.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkspaceOperationsResponse" } } } }, "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/workspaces/{workspaceId}/source": { "get": { "operationId": "getWorkspaceSource", "summary": "Get workspace source", "description": "Read the workspace as a source directory: `secrets.ts` (secret names, never values) and `credentials.ts` (credential keys, never tokens), one declaration file per MCP server (`mcp/.ts`), per deployment (`deployments/.ts`), per table (`tables/.ts`), per custom tool (`tools/.ts`, its code in `tools/.js`) and per skill (`skills/.md`), one folder per knowledge base (`knowledge//`, its settings beside its documents in `docs/`) and per workflow (`workflows//`, exactly as Get Workflow Source prints it, with its lock and base), every workspace file under `files/`, the binary files (workspace files and knowledge documents) listed by hash with an `href` to download each, and `base`, which binds each resource key to its id and records each resource's fingerprint. Each resource appears by its resource key: allocated from its name the first time source names it, then never changed. `kinds` narrows the read; the directory then manages only those kinds. A resource left out (too large to read as source, not readable by the caller, or past the directory's declaration or binary-file budget) is listed in `skipped` with why, and a kind holding more than 500 resources is left out with `E_LIMIT_EXCEEDED`. A table's rows are part of source only when its declaration opts in with `rows` (`tables/.rows.jsonl`, at most 10000 rows each); environment values and credentials never are. This read records no audit event. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.source.read", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace to read or apply.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace to read or apply." } }, { "name": "kinds", "in": "query", "required": false, "description": "Comma-separated kinds to read; every kind the server supports when omitted.", "schema": { "description": "Comma-separated kinds to read; every kind the server supports when omitted.", "type": "string", "minLength": 1 } } ], "responses": { "200": { "description": "The workspace as source.", "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/GetWorkspaceSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "kinds": ["table", "workflow"], "files": { "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n name: 'leads',\n columns: {\n email: column.string({ required: true, unique: true }),\n status: column.select({ options: ['new', 'won'] }),\n },\n})\n" }, "blobs": [], "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } }, "skipped": [], "diagnostics": [] } } } } } } }, "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": "applyWorkspaceSource", "summary": "Apply workspace source", "description": "Apply a workspace source directory: create and update what it declares, in dependency order (custom tools, skills, tables, knowledge bases and files before the workflows that use them). Send the files of every managed kind, `kinds` (the kind folders the directory holds), the binary-file manifest (path, SHA-256 and size), and the `base` from Get Workspace Source. Binary bytes are staged first and the apply names them by hash: `sim workspaces source apply` stages them itself, and other clients find the ones the server lacks (Find Missing Workspace Source Blobs) and upload them to `POST /api/v2/workspaces/{workspaceId}/source/blobs`, a binary upload MCP clients cannot send. A directory without binary files needs no staging; a write whose bytes are not staged refuses the whole apply with `E_BLOB_MISSING` before anything is written, and a dry run lists those paths in `needBlobs`. Requires workspace write access.\n\nThe whole plan is checked and authorized before anything is written: any error returns `400` with `details.code` `SOURCE_REJECTED` and `details.diagnostics` (each with a file, line and column), and nothing is written. A resource changed on the server since the directory was read returns `409` (`SOURCE_STALE`); another apply still writing the workspace `409` (`SOURCE_BUSY`: nothing was written, apply again once it finished; a dry run never waits on one); a schema-locked table `423`; a directory over a size limit `413` (at most 500 resources per kind, 100 workflows and 1000 changes per apply). A resource, table column or option the directory no longer declares is deleted only with `options.allowDelete`; without it, deleting one the base records is refused, and a server resource the base never recorded is kept with a warning. Each change is written by the operation that owns it and audited by it; workflow, skill, secret and deployment changes follow use cases a workspace API key cannot call, so a workspace API key gets `E_APPLY_FORBIDDEN` for those kinds (narrow the apply with `options.only`). Writes commit one by one: a write that fails mid-apply answers `200` with `failed` and the changes written before it, and applying the same directory again continues. The response carries the files re-printed from what was saved and the next `base`. `dryRun=true` plans, checks and authorizes without writing and answers `200` with the findings in `diagnostics`. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.source.apply", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace to read or apply.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace to read or apply." } }, { "name": "dryRun", "in": "query", "required": false, "description": "Plan, check and authorize every change without writing. Findings, errors included, come back in `diagnostics` with a `200`.", "schema": { "description": "Plan, check and authorize every change without writing. Findings, errors included, come back in `diagnostics` with a `200`.", "type": "boolean" } } ], "requestBody": { "required": true, "description": "The directory files, its managed kinds and the base they were read with.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApplyWorkspaceSourceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "files": { "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n name: 'leads',\n columns: {\n email: column.string({ required: true, unique: true }),\n status: column.select({ options: ['new', 'won'] }),\n },\n})\n" }, "kinds": ["table"], "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } } } } } } } }, "responses": { "200": { "description": "The applied (or planned) changes.", "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/ApplyWorkspaceSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": false, "plan": [ { "kind": "table", "key": "leads", "action": "noop", "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c" } ], "applied": [], "needBlobs": [], "files": {}, "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } }, "diagnostics": [] } } } } } } }, "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/workspaces/{workspaceId}/source/plan": { "post": { "operationId": "planWorkspaceSource", "summary": "Plan workspace source", "description": "Report what Apply Workspace Source would do with this directory, without writing: every planned change and finding, exactly as `dryRun=true` reports them (a resource changed on the server since the directory was read included). A read: it needs only workspace read access, draws on the source-plan budget, one unit per workflow folder it evaluates as an apply does, takes no apply lease or apply slot and records no audit event, so `sim workspaces source status` never spends the source-write budget or holds up an apply. A server already running as many plans as it allows answers `429`. Each change is still checked by the operation that owns it, so a change the caller may not write is reported as refused. The body is an apply body without `provenance`. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:read`.", "x-sim-operation": "workspaces.source.plan", "x-oauth-scope": "api:read", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:read"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace to read or apply.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace to read or apply." } } ], "requestBody": { "required": true, "description": "The directory files, its managed kinds and the base they were read with.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlanWorkspaceSourceBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "files": { "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n name: 'leads',\n columns: {\n email: column.string({ required: true, unique: true }),\n status: column.select({ options: ['new', 'won'] }),\n },\n})\n" }, "kinds": ["table"], "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } } } } } } } }, "responses": { "200": { "description": "The planned changes.", "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/PlanWorkspaceSourceResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": true, "plan": [ { "kind": "table", "key": "leads", "action": "noop", "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c" } ], "applied": [], "needBlobs": [], "files": {}, "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } }, "diagnostics": [] } } } } } } }, "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/workspaces/{workspaceId}/source/blobs/missing": { "post": { "operationId": "findMissingWorkspaceSourceBlobs", "summary": "Find missing workspace source blobs", "description": "List which binary files of a workspace source directory the caller has not staged in this workspace, by SHA-256, so a client stages only those; an interrupted upload resumes without resending what is already staged. Asking renews nothing: staged bytes expire a day after they were last staged, and one that expires within the hour is listed as missing, so the client stages it again before applying. Staging is per caller (a person, or one workspace API key). Requires workspace write access. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.source.blobs.missing", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace to read or apply.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace to read or apply." } } ], "requestBody": { "required": true, "description": "The binary files an apply will need.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FindMissingWorkspaceSourceBlobsBody" }, "examples": { "example1": { "summary": "Request example 1", "value": { "blobs": [ { "sha256": "9f2c4e6a8b0d1f3e5a7c9b2d4f6e8a0c1b3d5f7e9a2c4b6d8f0e1a3c5b7d9f2e", "size": 18432 } ] } } } } } }, "responses": { "200": { "description": "The binary files still to stage.", "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/FindMissingWorkspaceSourceBlobsResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "missing": [ "9f2c4e6a8b0d1f3e5a7c9b2d4f6e8a0c1b3d5f7e9a2c4b6d8f0e1a3c5b7d9f2e" ] } } } } } } }, "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/workspaces/{workspaceId}/source/blobs": { "post": { "operationId": "stageWorkspaceSourceBlobs", "summary": "Stage workspace source blobs", "description": "Stage the bytes of binary files (workspace files, knowledge documents) for a workspace source apply, as multipart form data: one file part per blob, its field name the SHA-256 of its bytes. At most 1000 files and 8000000 bytes per request, 10000000 bytes per file; a larger file goes in a request of its own. A body over 10001024 bytes answers `413` (`PAYLOAD_TOO_LARGE`) before it is read. A part whose bytes hash to another SHA-256 refuses the whole request (`400`), nothing staged. Staged files are scoped to the workspace and the caller, capped at 20000 files and 4000000000 bytes (`413` with `details.code` `SOURCE_STAGING_FULL` past either), count against the workspace payer's storage quota while held (`413` with `SOURCE_STAGING_FULL` past it) until an apply writes them into the workspace, and expire a day after they were last staged; asking for them or applying with them never renews them, and an apply does not remove them. Staging the same bytes again renews them, and once an apply wrote them makes them count against the quota again, so it can answer `SOURCE_STAGING_FULL` too. Requires workspace write access. Returns `403` while workflows as code is not enabled.\n\nOAuth scope: `api:write`.", "x-sim-operation": "workspaces.source.blobs.stage", "x-oauth-scope": "api:write", "tags": ["Workflows"], "security": [ { "apiKey": [] }, { "oauthBearer": ["api:write"] } ], "parameters": [ { "name": "workspaceId", "in": "path", "required": true, "description": "Workspace to read or apply.", "schema": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace to read or apply." } } ], "requestBody": { "required": true, "description": "One file part per binary file, named by its SHA-256.", "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/StageWorkspaceSourceBlobsForm" } } } }, "responses": { "200": { "description": "The binary files staged.", "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/StageWorkspaceSourceBlobsResponse" }, "examples": { "example1": { "summary": "Response example 1", "value": { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "staged": [ { "sha256": "9f2c4e6a8b0d1f3e5a7c9b2d4f6e8a0c1b3d5f7e9a2c4b6d8f0e1a3c5b7d9f2e", "size": 18432 } ] } } } } } } }, "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": "Send a personal or workspace API key in `X-API-Key`. See [key types and access](https://docs.sim.ai/api-reference/authentication#key-types); operations that reject workspace keys say so in their description." }, "oauthBearer": { "type": "oauth2", "description": "Send a Sim OAuth access token in `Authorization: Bearer`. See [OAuth authentication and scopes](https://docs.sim.ai/api-reference/authentication#oauth-access-tokens).", "flows": { "authorizationCode": { "authorizationUrl": "https://www.sim.ai/api/auth/oauth2/authorize", "tokenUrl": "https://www.sim.ai/api/auth/oauth2/token", "refreshUrl": "https://www.sim.ai/api/auth/oauth2/token", "scopes": { "api:read": "Read your workspaces, workflows, files, tables, and logs", "api:write": "Read, create, change, run, and delete resources in your workspaces", "offline_access": "Stay signed in without asking again" } } } } }, "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 credential is missing or invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/V2Error" }, "example": { "error": { "code": "UNAUTHORIZED", "message": "Authentication 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": "The request conflicts with current resource state" } } } } }, "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 temporarily locked or unavailable; retry the request.", "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. When present, `Retry-After` gives the minimum seconds to wait; add jitter before retrying. Check operation-specific guidance before repeating a change after an uncertain response.", "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": { "V2ActionableForbiddenDetails": { "type": "object", "properties": { "code": { "$ref": "#/components/schemas/V2ForbiddenDetailCode" } }, "required": ["code"], "additionalProperties": { "description": "Additional context for this refusal." }, "title": "Actionable forbidden details", "description": "Machine-readable cause and optional context for an actionable `403` response." }, "V2ForbiddenDetailCode": { "type": "string", "enum": [ "INSUFFICIENT_WORKSPACE_ROLE", "PERSONAL_API_KEYS_DISABLED", "WORKSPACE_KEY_OPERATION_NOT_PERMITTED", "PRINCIPAL_KIND_NOT_PERMITTED", "ORGANIZATION_MEMBERSHIP_REQUIRED", "ORGANIZATION_ADMIN_REQUIRED", "ENTERPRISE_PLAN_REQUIRED", "SSO_DISABLED", "SSO_DOMAIN_NOT_VERIFIED", "SSO_PROVIDER_LIMIT_REACHED", "ORGANIZATION_PLAN_REQUIRED", "AUDIT_LOGS_DISABLED", "ACCESS_REQUESTS_DISABLED", "ACCESS_REQUEST_ORGANIZATION_REQUIRED", "SKILL_EDITOR_ACCESS_REQUIRED", "SECRET_ADMIN_ACCESS_REQUIRED", "WORKSPACE_RESOURCE_LIMIT_REACHED", "PUBLIC_SHARING_NOT_ALLOWED", "CREDENTIAL_ADMIN_ACCESS_REQUIRED", "MCP_SERVER_URL_NOT_ALLOWED", "WORKSPACE_PLAN_CAPABILITY_REQUIRED", "CHAT_AUTH_MODE_NOT_PERMITTED", "CONNECTOR_MANAGED_RESOURCE_READ_ONLY", "PERMISSION_GROUP_CAPABILITY_BLOCKED", "INTEGRATION_NOT_ALLOWED", "INSUFFICIENT_SCOPE", "READ_ONLY_API_KEY", "SCIM_MANAGED_MEMBERSHIP", "FEATURE_NOT_ENABLED" ], "title": "Forbidden detail code", "description": "Stable cause code for an actionable `403` response." }, "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 context whose keys depend on the error. Actionable `403` responses use the `V2ActionableForbiddenDetails` shape; validation failures may return issue arrays instead.", "anyOf": [ { "$ref": "#/components/schemas/V2ActionableForbiddenDetails" }, { "description": "Other structured context defined by the specific error." } ] }, "requestId": { "description": "Identifier of this request, the same id as the `x-request-id` response header. Quote it when contacting support.", "type": "string" } }, "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": "Settled runs — completed, failed, or cancelled — counted as each one finishes; a paused run is counted once it settles. The counter is never reduced when a run ages out of log retention, so it can exceed the results returned by List workflow runs." }, "lastRunAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the latest settled run, whatever its outcome, or null when the workflow has never run.", "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 are no more pages. Do not construct a cursor 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": "Settled runs — completed, failed, or cancelled — counted as each one finishes; a paused run is counted once it settles. The counter is never reduced when a run ages out of log retention, so it can exceed the results returned by List workflow runs." }, "lastRunAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the latest settled run, whatever its outcome, or null when the workflow has never run.", "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": {} } } ] }, "WorkflowOutlineBlock": { "type": "object", "properties": { "type": { "type": "string", "description": "Block type, e.g. `agent` or `slack`." }, "name": { "type": "string", "description": "Display name; references to this block's outputs use it." }, "enabled": { "type": "boolean", "description": "Whether the block runs." }, "inputs": { "description": "Configured values keyed by field id, with null values omitted. Fields hidden from agents are omitted as well, and some of them are real configuration, so read Get workflow state for the full set. Loop and parallel containers report their iteration settings here. A webhook trigger also carries a derived `triggerWebhookUrl`, and a credential-routed trigger a derived `triggerRouting`; both are read-only.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "Configured value; shape depends on the field." } }, "connections": { "description": "Outgoing connections keyed by source handle: `source`, `error`, `if` / `else-if-0` / `else` for a Condition, or `route-0`, `route-1`, ... for a Router.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ], "description": "Target block id, or ids when the handle fans out." } }, "nestedNodes": { "description": "Blocks inside this loop or parallel container, keyed by block id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "Child block in this same outline shape." } }, "advancedMode": { "description": "Whether the block shows its advanced fields.", "type": "boolean" }, "errorEnabled": { "description": "Whether the block has an error output path.", "type": "boolean" }, "retry": { "description": "Per-block retry configuration.", "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Whether the block retries on failure." }, "maxTries": { "type": "number", "description": "Total attempts, including the first." }, "waitBetweenTriesMs": { "type": "number", "description": "Delay between attempts, in milliseconds." } }, "required": ["enabled", "maxTries", "waitBetweenTriesMs"], "additionalProperties": false }, "triggerMode": { "description": "Whether the block acts as the workflow trigger.", "type": "boolean" } }, "required": ["type", "name", "enabled"], "additionalProperties": false, "title": "Workflow outline block", "description": "One block of a workflow outline, with its connections embedded." }, "WorkflowOutline": { "type": "object", "properties": { "blocks": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "$ref": "#/components/schemas/WorkflowOutlineBlock" }, "description": "Top-level blocks keyed by block id. Blocks inside a loop or parallel appear under their container's `nestedNodes`." } }, "required": ["blocks"], "additionalProperties": false, "title": "Workflow outline", "description": "Compact read-only view of a workflow draft. Not a valid Replace workflow state body." }, "WorkflowOutlineResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkflowOutline" } }, "required": ["data"], "additionalProperties": false, "title": "Workflow outline response", "description": "The compact read-only outline of a workflow draft.", "examples": [ { "data": { "blocks": { "start-1": { "type": "starter", "name": "Start", "enabled": true, "connections": { "source": "agent-1" } }, "agent-1": { "type": "agent", "name": "Agent 1", "enabled": true, "inputs": { "systemPrompt": "Route the ticket to the right team." } } } } } ] }, "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", "block-output", "child-result" ], "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; `block-output` references that will not work as written: a block that does not exist, or an output field the block does not have (reason `unknown-field`); and text outputs written unquoted in a JSON field (reason `unquoted-json-string`), which leave the field invalid JSON at run time unless the text is itself JSON; `child-result` references to the `result.` of a Workflow block whose child responds, so its result is the Response output (`{ data, status, headers }`) and the key reads nothing (the value meant is `result.data.`). A deploy also reports, as `resource`, a called child workflow that is not deployed, which a deployed run cannot call. These values are still persisted; they are reported, not dropped." }, "tableFieldIssues": { "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": "The filter or sort field that names no column." }, "tableName": { "type": "string", "description": "Display name of the table the block is bound to." } }, "required": ["blockId", "blockName", "blockType", "field", "tableName"], "additionalProperties": false }, "description": "Table block `filter` and `order` fields checked against the bound table's live schema that name no column (nor the implicit `id`, `createdAt`, `updatedAt`). Such a run fails inside the block's error edge. A filter holding a `` reference, or one that is not JSON, is not checked." }, "manualRunIssue": { "anyOf": [ { "type": "object", "properties": { "reason": { "type": "string", "enum": ["no-trigger", "multiple-api-triggers", "trigger-not-connected"], "description": "Why the run is refused." }, "message": { "type": "string", "description": "The error the manual run raises." }, "blockId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Trigger the run would start from, when the problem is that trigger." }, "blockName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Display name of that trigger." }, "blockType": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Registered type of that trigger." } }, "required": ["reason", "message", "blockId", "blockName", "blockType"], "additionalProperties": false }, { "type": "null" } ], "description": "Why a manual run from the editor's Run button would be refused before it starts: no enabled trigger it can start from, more than one API trigger, or a selected trigger with no outgoing connection. The API run endpoints do not apply these checks. `null` when no manual-run issue is reported: the run can begin, only a chat trigger can start the workflow, or the graph is empty (reported in `notes` instead)." }, "notes": { "type": "array", "items": { "type": "string" }, "description": "Advisory notes about the report itself." } }, "required": [ "sources", "sinks", "orphanBlocks", "emptyOutgoingPorts", "invalidBranchPorts", "invalidConnectionTargets", "fieldIssues", "unresolvedReferences", "tableFieldIssues", "manualRunIssue", "notes" ], "additionalProperties": false, "title": "Workflow lint report", "description": "Advisory findings about a saved graph. Findings never block a write or a deploy; 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 differs from the draft. A graph write never changes what the deployed endpoint serves; deploy to publish it. On a dry run, this describes the state before the proposed write." }, "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": [], "tableFieldIssues": [], "manualRunIssue": null, "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", "edge_cycle", "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 and, when `lint` has findings, one line counting them by category, so a caller that reads only `warnings` still learns they exist. The findings themselves are in `lint`. Empty when there is nothing to report." }, "needsRedeployment": { "type": "boolean", "description": "Whether the live deployment differs from the draft. A graph write never changes what the deployed endpoint serves; deploy to publish it. On a dry run, this describes the state before the proposed write." }, "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": "Edges waiting for target blocks. They apply automatically when their targets exist, in this batch or a later one. Do not resubmit 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": "Assigned IDs keyed by requested `block_id`, including only changed IDs. `add` and `insert_into_subflow` replace non-UUID labels with minted UUIDs. References within the batch are remapped automatically; later requests must use the minted IDs. Supply UUIDs to preserve your chosen IDs. Empty on dry runs, which return provisional IDs in `previewBlockIds` instead." }, "previewBlockIds": { "description": "Dry run only: the provisional id the evaluation assigned to each block whose `block_id` was not already a UUID, keyed by the `block_id` you asked for. These are not the ids a committed apply produces — the real apply mints new ones — so never wire a later request against them. Wire edges by `block_id` within one batch, or by the `mintedBlockIds` the real apply returns.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string", "description": "The provisional id the dry run assigned." } }, "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": { "agent-1": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77" }, "lint": { "sources": [ { "blockId": "start-1", "blockName": "Start", "blockType": "start_trigger" } ], "sinks": [ { "blockId": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "blockName": "Triage", "blockType": "agent" } ], "orphanBlocks": [], "emptyOutgoingPorts": [], "invalidBranchPorts": [], "invalidConnectionTargets": [], "fieldIssues": [ { "blockId": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "blockName": "Triage", "blockType": "agent", "missingRequiredFields": ["systemPrompt"], "inactiveModeValues": [] } ], "unresolvedReferences": [], "tableFieldIssues": [], "manualRunIssue": null, "notes": [] }, "warnings": [ "Workflow lint found issues (Blocks missing required fields: 1). The findings are in `lint`." ], "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." }, "inputs": { "allOf": [ { "type": "object", "properties": { "tools": { "description": "Agent tools configuration. Applies to a `tool-input` field; other block inputs remain catalog-defined.", "$ref": "#/components/schemas/AgentToolInput" } }, "additionalProperties": { "description": "One block-specific input whose accepted shape is published by the block catalog." } }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One block-specific input whose accepted shape is published by the block catalog." } } ], "description": "Block configuration keyed by sub-block id." } }, "required": ["type", "name"], "additionalProperties": { "description": "One block-specific input or connection descriptor." }, "description": "Block `type`, `name`, and optional `inputs`, `connections`, `retry`, `triggerMode`, or `advancedMode`. `inputs` maps sub-block ids directly to values, never through `subBlocks`. Keep `retry`, `triggerMode`, and `advancedMode` beside `inputs`. `connections` maps source handles to target ids, `{ block, handle }`, or arrays; `success` aliases `source`." } }, "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": { "allOf": [ { "type": "object", "properties": { "inputs": { "allOf": [ { "type": "object", "properties": { "tools": { "description": "Agent tools configuration. Applies to a `tool-input` field; other block inputs remain catalog-defined.", "$ref": "#/components/schemas/AgentToolInput" } }, "additionalProperties": { "description": "One block-specific input whose accepted shape is published by the block catalog." } }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One block-specific input whose accepted shape is published by the block catalog." } } ], "description": "Block configuration keyed by sub-block id." } }, "additionalProperties": { "description": "One operation parameter; see the description for the accepted keys." } }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One operation parameter; see the description for the accepted keys." } } ], "description": "Patch only supplied fields: `inputs`, `name`, `connections`, `removeEdges`, `nestedNodes`, `retry`, `triggerMode`, `advancedMode`, and `parentId`. `inputs` maps sub-block ids directly to values, never through `subBlocks`. Keep `retry`, `triggerMode`, and `advancedMode` beside `inputs`. `connections` maps source handles to target ids, `{ block, handle }`, or arrays; `success` aliases `source`. Re-sending `connections` replaces outgoing edges; use `removeEdges` to delete selected edges. `parentId` moves the block, keeping its id, into the loop or parallel it names, or with `null` out of its container." } }, "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." }, "inputs": { "allOf": [ { "type": "object", "properties": { "tools": { "description": "Agent tools configuration. Applies to a `tool-input` field; other block inputs remain catalog-defined.", "$ref": "#/components/schemas/AgentToolInput" } }, "additionalProperties": { "description": "One block-specific input whose accepted shape is published by the block catalog." } }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One block-specific input whose accepted shape is published by the block catalog." } } ], "description": "Block configuration keyed by sub-block id." } }, "required": ["subflowId", "type", "name"], "additionalProperties": { "description": "One block-specific input or connection descriptor." }, "description": "Container, block `type`, `name`, and the same optional fields as `add`. `inputs` maps sub-block ids directly to values, never through `subBlocks`. Keep `retry`, `triggerMode`, and `advancedMode` beside `inputs`. `connections` maps source handles to target ids, `{ block, handle }`, or arrays; `success` aliases `source`." } }, "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." }, "AgentToolInput": { "maxItems": 100, "type": "array", "items": { "$ref": "#/components/schemas/AgentTool" }, "description": "The complete value stored in an Agent block’s `tools` input.", "title": "Agent tools input" }, "AgentTool": { "oneOf": [ { "$ref": "#/components/schemas/AgentIntegrationTool" }, { "$ref": "#/components/schemas/AgentCustomTool" }, { "$ref": "#/components/schemas/AgentMcpTool" }, { "$ref": "#/components/schemas/AgentMcpServerAdvanced" } ], "title": "Agent tool", "description": "A catalog integration operation, workspace custom tool, or MCP tool available to an Agent." }, "AgentIntegrationTool": { "type": "object", "properties": { "type": { "type": "string", "minLength": 1, "maxLength": 255, "pattern": "^(?!(?:custom-tool|mcp|mcp-server-advanced)$).+$", "description": "Catalog block id, such as `cloudwatch` or `slack`. Use the block id, never an underlying tool id." }, "operation": { "description": "Operation ID from Get Block. Required when the block exposes multiple operations; it may differ from the tool ID.", "type": "string", "minLength": 1, "maxLength": 255 }, "usageControl": { "type": "string", "enum": ["auto", "force", "none"], "description": "Selector Permission Mode: `auto` lets the model decide, `force` requires a call, and `none` disables it. Supply this property and omit `usageControlExpression` to select or switch to Selector mode; do not send null or set `canonicalModes` or block-level `advancedMode`. With neither property, the default is `auto`." }, "usageControlExpression": { "type": "string", "maxLength": 2048, "description": "Variable Permission Mode: a reference such as `` or a literal such as `none`, resolving to `auto`, `force`, or `none` at execution time. Supply this property and omit `usageControl` to select or switch to Variable mode; do not send null or set `canonicalModes` or block-level `advancedMode`." }, "params": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One tool parameter value." }, "description": "Parameters fixed by the workflow author. Parameters left out remain available for the model to supply when the tool declares them." } }, "required": ["type"], "additionalProperties": { "description": "Forward-compatible integration tool metadata preserved by the workflow editor." }, "title": "Agent integration tool", "description": "A catalog integration operation the Agent may call. Resolve valid block and operation ids through the block catalog.", "examples": [ { "type": "cloudwatch", "operation": "describe_alarm_history", "usageControl": "auto", "params": {} } ] }, "AgentCustomTool": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "custom-tool", "description": "Custom-tool discriminator." }, "customToolId": { "type": "string", "minLength": 1, "maxLength": 255, "description": "Custom tool ID from List Custom Tools." }, "usageControl": { "type": "string", "enum": ["auto", "force", "none"], "description": "Selector Permission Mode: `auto` lets the model decide, `force` requires a call, and `none` disables it. Supply this property and omit `usageControlExpression` to select or switch to Selector mode; do not send null or set `canonicalModes` or block-level `advancedMode`. With neither property, the default is `auto`." }, "usageControlExpression": { "type": "string", "maxLength": 2048, "description": "Variable Permission Mode: a reference such as `` or a literal such as `none`, resolving to `auto`, `force`, or `none` at execution time. Supply this property and omit `usageControl` to select or switch to Variable mode; do not send null or set `canonicalModes` or block-level `advancedMode`." } }, "required": ["type", "customToolId"], "additionalProperties": { "description": "Forward-compatible custom tool metadata preserved by the workflow editor." } }, { "type": "object", "properties": { "type": { "type": "string", "const": "custom-tool", "description": "Custom-tool discriminator." }, "schema": { "type": "object", "properties": { "type": { "description": "Function declaration discriminator.", "type": "string", "const": "function" }, "function": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 64, "description": "Function name presented to the model." }, "description": { "description": "What the inline custom tool does.", "type": "string" }, "parameters": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One JSON Schema keyword on the function parameters." }, "description": "JSON Schema describing the function arguments." } }, "required": ["name", "parameters"], "additionalProperties": { "description": "Additional function declaration metadata." }, "description": "OpenAI-style function definition." } }, "required": ["function"], "additionalProperties": { "description": "Additional custom tool declaration metadata." }, "description": "Inline OpenAI-style function declaration." }, "code": { "type": "string", "description": "Inline tool implementation executed by the Function runtime." }, "usageControl": { "type": "string", "enum": ["auto", "force", "none"], "description": "Selector Permission Mode: `auto` lets the model decide, `force` requires a call, and `none` disables it. Supply this property and omit `usageControlExpression` to select or switch to Selector mode; do not send null or set `canonicalModes` or block-level `advancedMode`. With neither property, the default is `auto`." }, "usageControlExpression": { "type": "string", "maxLength": 2048, "description": "Variable Permission Mode: a reference such as `` or a literal such as `none`, resolving to `auto`, `force`, or `none` at execution time. Supply this property and omit `usageControl` to select or switch to Variable mode; do not send null or set `canonicalModes` or block-level `advancedMode`." } }, "required": ["type", "schema", "code"], "additionalProperties": { "description": "Forward-compatible custom tool metadata preserved by the workflow editor." } } ], "title": "Agent custom tool", "description": "A workspace custom tool. Prefer `customToolId`; inline declarations are also accepted.", "examples": [ { "type": "custom-tool", "customToolId": "cst_01J9X2ABCDEF", "usageControl": "auto" } ] }, "AgentMcpTool": { "type": "object", "properties": { "type": { "type": "string", "const": "mcp", "description": "MCP-tool discriminator." }, "params": { "allOf": [ { "type": "object", "properties": { "serverId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "MCP server id returned by `GET /api/v2/mcp-servers`." }, "toolName": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Tool name returned by the MCP server’s tools endpoint." } }, "required": ["serverId", "toolName"], "additionalProperties": { "description": "One parameter fixed by the workflow author." } }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "One parameter fixed by the workflow author." } } ], "description": "MCP server and tool identity plus any tool arguments fixed by the workflow author." }, "usageControl": { "type": "string", "enum": ["auto", "force", "none"], "description": "Selector Permission Mode: `auto` lets the model decide, `force` requires a call, and `none` disables it. Supply this property and omit `usageControlExpression` to select or switch to Selector mode; do not send null or set `canonicalModes` or block-level `advancedMode`. With neither property, the default is `auto`." }, "usageControlExpression": { "type": "string", "maxLength": 2048, "description": "Variable Permission Mode: a reference such as `` or a literal such as `none`, resolving to `auto`, `force`, or `none` at execution time. Supply this property and omit `usageControl` to select or switch to Variable mode; do not send null or set `canonicalModes` or block-level `advancedMode`." } }, "required": ["type", "params"], "additionalProperties": { "description": "Forward-compatible MCP tool metadata preserved by the workflow editor." }, "title": "Agent MCP tool", "description": "One tool discovered from a workspace MCP server.", "examples": [ { "type": "mcp", "params": { "serverId": "mcp_01J9X2ABCDEF", "toolName": "search_docs" }, "usageControl": "auto" } ] }, "AgentMcpServerAdvanced": { "type": "object", "properties": { "type": { "type": "string", "const": "mcp-server-advanced", "description": "Server-wide MCP binding discriminator." }, "operationPolicy": { "oneOf": [ { "type": "object", "properties": { "mode": { "type": "string", "const": "all", "description": "Allow all operations available to the authorized credential." } }, "required": ["mode"], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "const": "allow", "description": "Allow only the selected exact operations." }, "operations": { "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Exact MCP tool name on the resolved connection, without a Sim server prefix." }, "description": "Allowed exact MCP tool names; an empty list grants no access." } }, "required": ["mode", "operations"], "additionalProperties": false }, { "type": "object", "properties": { "mode": { "type": "string", "const": "deny", "description": "Exclude the selected exact operations." }, "operations": { "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Exact MCP tool name on the resolved connection, without a Sim server prefix." }, "description": "Denied exact MCP tool names; an empty list allows otherwise permitted tools." } }, "required": ["mode", "operations"], "additionalProperties": false } ], "description": "Saved workflow operation restrictions that can only narrow authorized credential access." }, "params": { "type": "object", "properties": { "serverId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace MCP server ID or explicit credential-group managed MCP connection ID." } }, "required": ["serverId"], "additionalProperties": false, "description": "Executable server or connection identity for authorized operation discovery and execution." }, "usageControl": { "type": "string", "enum": ["auto", "force", "none"], "description": "Selector Permission Mode: `auto` lets the model decide, `force` requires a call, and `none` disables it. Supply this property and omit `usageControlExpression` to select or switch to Selector mode; do not send null or set `canonicalModes` or block-level `advancedMode`. With neither property, the default is `auto`." }, "usageControlExpression": { "type": "string", "maxLength": 2048, "description": "Variable Permission Mode: a reference such as `` or a literal such as `none`, resolving to `auto`, `force`, or `none` at execution time. Supply this property and omit `usageControl` to select or switch to Variable mode; do not send null or set `canonicalModes` or block-level `advancedMode`." } }, "required": ["type", "params"], "additionalProperties": { "description": "Forward-compatible MCP server metadata preserved by the workflow editor." }, "title": "Agent MCP server (advanced)", "description": "Dynamically discovered operations permitted by the authorized credential and saved block policy.", "examples": [ { "type": "mcp-server-advanced", "params": { "serverId": "mcp_01J9X2ABCDEF" }, "usageControl": "auto" } ] }, "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", "inputs": { "tools": [ { "type": "cloudwatch", "operation": "describe_alarm_history", "usageControl": "auto", "params": {} } ] } } } ] } ] }, "ApplyWorkflowVariablesResult": { "type": "object", "properties": { "id": { "type": "string", "description": "Identifier of the workflow whose variables were updated." }, "variableCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of variables after the batch." }, "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": "An input field from an input-definition trigger in the saved draft." }, "WorkflowApiInputSchema": { "type": "object", "properties": { "type": { "type": "string", "description": "JSON Schema type of the `input` object; always `object`." }, "properties": { "description": "Input field schemas keyed by field name.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "JSON Schema for one input field." } }, "required": { "description": "Names of the input fields an API run requires.", "type": "array", "items": { "type": "string", "description": "Name of a required input field." } } }, "required": ["type"], "additionalProperties": { "description": "Additional JSON Schema keyword." }, "title": "Workflow API input schema", "description": "JSON Schema for the `input` an API run of the active deployment accepts." }, "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": "Settled runs — completed, failed, or cancelled — counted as each one finishes; a paused run is counted once it settles. The counter is never reduced when a run ages out of log retention, so it can exceed the results returned by List workflow runs." }, "lastRunAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the latest settled run, whatever its outcome, or null when the workflow has never run.", "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 from the saved draft's input-definition trigger; they may differ from the live deployment. Use `inputSchema` for what an API run accepts." }, "inputSchema": { "anyOf": [ { "$ref": "#/components/schemas/WorkflowApiInputSchema" }, { "type": "null" } ], "description": "JSON Schema for the `input` an API run of the active deployment accepts, including `required` fields. Null when the workflow is not deployed or its active deployment has no API entry point." } }, "required": [ "id", "webUrl", "name", "description", "folderPath", "workspaceId", "isDeployed", "deployedAt", "runCount", "lastRunAt", "createdAt", "updatedAt", "variables", "inputs", "inputSchema" ], "additionalProperties": false, "title": "Workflow detail", "description": "Workflow metadata, variables, saved draft trigger input fields, and the input schema of the active deployment." }, "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": [ { "name": "ticket", "type": "string" } ], "inputSchema": { "type": "object", "properties": { "ticket": { "type": "string" } }, "required": ["ticket"] } } } ] }, "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": "Whether the workflow was archived. Restore workflow recovers it and the schedules, webhooks, MCP tools, and chats archived with it." } }, "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 are no more pages. Do not construct a cursor 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 } ] }, "WorkflowVersionComparison": { "type": "object", "properties": { "workflowId": { "type": "string", "description": "Workflow compared." }, "base": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "Base deployment version." }, "target": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "Target deployment version." }, "diff": { "type": "object", "properties": { "addedBlocks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable block identifier." }, "type": { "type": "string", "description": "Block type." }, "name": { "description": "Block name.", "type": "string" } }, "required": ["id", "type"], "additionalProperties": false }, "description": "Blocks present only in the target." }, "removedBlocks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable block identifier." }, "type": { "type": "string", "description": "Block type." }, "name": { "description": "Block name.", "type": "string" } }, "required": ["id", "type"], "additionalProperties": false }, "description": "Blocks present only in the base." }, "modifiedBlocks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stable block identifier." }, "type": { "type": "string", "description": "Block type." }, "name": { "description": "Block name.", "type": "string" }, "changes": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string", "description": "Changed field identifier." }, "oldValue": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "unset", "description": "The field has no configured value." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "redacted", "description": "The value is withheld by the credential policy." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "value", "description": "The field value is included." }, "value": { "description": "The complete user-authored field value." } }, "required": ["kind", "value"], "additionalProperties": false } ], "description": "Base version value." }, "newValue": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "unset", "description": "The field has no configured value." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "redacted", "description": "The value is withheld by the credential policy." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "value", "description": "The field value is included." }, "value": { "description": "The complete user-authored field value." } }, "required": ["kind", "value"], "additionalProperties": false } ], "description": "Target version value." }, "scope": { "type": "string", "enum": ["block", "subblock"], "description": "Whether the field is a block setting or a subblock input." } }, "required": ["field", "oldValue", "newValue", "scope"], "additionalProperties": false }, "description": "Changed field values." } }, "required": ["id", "type", "changes"], "additionalProperties": false }, "description": "Blocks with changed fields." }, "edgeChanges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number removed." }, "addedDetails": { "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "description": "Stable source block identifier." }, "target": { "type": "string", "description": "Stable target block identifier." }, "sourceHandle": { "description": "Source port identifier; omitted for the default port.", "type": "string" }, "targetHandle": { "description": "Target port identifier; omitted for the default port.", "type": "string" }, "sourceName": { "type": "string", "description": "Source block name." }, "targetName": { "type": "string", "description": "Target block name." } }, "required": ["source", "target", "sourceName", "targetName"], "additionalProperties": false }, "description": "Added connections." }, "removedDetails": { "type": "array", "items": { "type": "object", "properties": { "source": { "type": "string", "description": "Stable source block identifier." }, "target": { "type": "string", "description": "Stable target block identifier." }, "sourceHandle": { "description": "Source port identifier; omitted for the default port.", "type": "string" }, "targetHandle": { "description": "Target port identifier; omitted for the default port.", "type": "string" }, "sourceName": { "type": "string", "description": "Source block name." }, "targetName": { "type": "string", "description": "Target block name." } }, "required": ["source", "target", "sourceName", "targetName"], "additionalProperties": false }, "description": "Removed connections." } }, "required": ["added", "removed", "addedDetails", "removedDetails"], "additionalProperties": false, "description": "Connection changes." }, "loopChanges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number removed." }, "modified": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number modified." } }, "required": ["added", "removed", "modified"], "additionalProperties": false, "description": "Loop change counts." }, "parallelChanges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number removed." }, "modified": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number modified." } }, "required": ["added", "removed", "modified"], "additionalProperties": false, "description": "Parallel change counts." }, "containerChanges": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Container block ID." }, "kind": { "type": "string", "enum": ["loop", "parallel"], "description": "Container type." }, "name": { "description": "Container name.", "type": "string" }, "changes": { "type": "array", "items": { "type": "object", "properties": { "field": { "type": "string", "description": "Changed field identifier." }, "oldValue": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "unset", "description": "The field has no configured value." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "redacted", "description": "The value is withheld by the credential policy." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "value", "description": "The field value is included." }, "value": { "description": "The complete user-authored field value." } }, "required": ["kind", "value"], "additionalProperties": false } ], "description": "Base version value." }, "newValue": { "oneOf": [ { "type": "object", "properties": { "kind": { "type": "string", "const": "unset", "description": "The field has no configured value." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "redacted", "description": "The value is withheld by the credential policy." } }, "required": ["kind"], "additionalProperties": false }, { "type": "object", "properties": { "kind": { "type": "string", "const": "value", "description": "The field value is included." }, "value": { "description": "The complete user-authored field value." } }, "required": ["kind", "value"], "additionalProperties": false } ], "description": "Target version value." } }, "required": ["field", "oldValue", "newValue"], "additionalProperties": false }, "description": "Changed field values." }, "nodesAdded": { "type": "array", "items": { "type": "string" }, "description": "Added member block IDs." }, "nodesRemoved": { "type": "array", "items": { "type": "string" }, "description": "Removed member block IDs." } }, "required": ["id", "kind", "changes", "nodesAdded", "nodesRemoved"], "additionalProperties": false }, "description": "Container configuration and membership changes." }, "variableChanges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number removed." }, "modified": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Number modified." }, "addedNames": { "type": "array", "items": { "type": "string" }, "description": "Names of added variables." }, "removedNames": { "type": "array", "items": { "type": "string" }, "description": "Names of removed variables." }, "modifiedNames": { "type": "array", "items": { "type": "string" }, "description": "Names of modified variables." } }, "required": [ "added", "removed", "modified", "addedNames", "removedNames", "modifiedNames" ], "additionalProperties": false, "description": "Variable change counts and names." }, "hasChanges": { "type": "boolean", "description": "Whether any semantic change was found." } }, "required": [ "addedBlocks", "removedBlocks", "modifiedBlocks", "edgeChanges", "loopChanges", "parallelChanges", "containerChanges", "variableChanges", "hasChanges" ], "additionalProperties": false, "description": "Changes from base to target." } }, "required": ["workflowId", "base", "target", "diff"], "additionalProperties": false, "title": "Workflow version comparison", "description": "Semantic changes from base to target within one workflow. Credential-bearing fields are redacted; changes to them are still reported. Canvas layout is excluded." }, "WorkflowVersionComparisonResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkflowVersionComparison" } }, "required": ["data"], "additionalProperties": false, "title": "Workflow version comparison response", "description": "Changes from base to target, with credential values withheld.", "examples": [ { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "base": 1, "target": 2, "diff": { "addedBlocks": [], "removedBlocks": [], "modifiedBlocks": [], "edgeChanges": { "added": 0, "removed": 0, "addedDetails": [], "removedDetails": [] }, "loopChanges": { "added": 0, "removed": 0, "modified": 0 }, "parallelChanges": { "added": 0, "removed": 0, "modified": 0 }, "containerChanges": [], "variableChanges": { "added": 0, "removed": 0, "modified": 0, "addedNames": [], "removedNames": [], "modifiedNames": [] }, "hasChanges": false } } } ] }, "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": "Graph pinned by this version, with registered credential fields and opaque table/tool values cleared. Environment references and ordinary workflow variables remain included; inspect other configuration before sharing.", "$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 warnings about deployment side effects, such as notifications that are still queued or failed. Empty when there is nothing to report. Lint findings are never reported here." }, "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 warnings about deployment side effects, such as notifications that are still queued or failed. Empty when there is nothing to report. Lint findings are never reported here." }, "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 }, "WorkflowDeploymentWebhook": { "type": "object", "properties": { "blockId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Trigger block the URL delivers to, or null for a legacy row that recorded none." }, "provider": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Webhook provider the endpoint verifies inbound requests against, e.g. `generic`, `github`, or `slack`." }, "url": { "type": "string", "format": "uri", "description": "Absolute URL for the external system to send events to.", "examples": ["https://www.sim.ai/api/webhooks/trigger/leads"] } }, "required": ["blockId", "provider", "url"], "additionalProperties": false, "title": "Deployed webhook", "description": "The public delivery URL of one webhook the live deployment registered." }, "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 warnings about deployment side effects, such as notifications that are still queued or failed. Empty when there is nothing to report. Lint findings are never reported here." }, "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 anyone with the execution URL can run the deployed workflow and consume billed usage without an API key. Change this with Update Workflow Public API Access." }, "webhooks": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowDeploymentWebhook" }, "description": "Public delivery URL of every webhook the live version registered, one per trigger block. Read URLs here: the editor computes the block URL field, which reads empty through the API. Empty while nothing is deployed; triggers using a shared endpoint without a per-workflow URL are omitted." } }, "required": [ "id", "isDeployed", "deployedAt", "warnings", "activeDeployment", "latestDeploymentAttempt", "needsRedeployment", "isPublicApi", "webhooks" ], "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 }, "webhooks": [ { "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V3", "provider": "generic", "url": "https://www.sim.ai/api/webhooks/trigger/leads" } ] } } ] }, "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 } ] }, "WorkflowTrigger": { "type": "object", "properties": { "blockId": { "type": "string", "description": "Trigger block in the deployed workflow." }, "kind": { "type": "string", "enum": ["schedule", "polling", "event", "webhook"], "description": "How the trigger fires: `schedule` on a cron, `polling` when Sim polls the source, `event` on an event raised inside Sim, `webhook` when an external sender delivers to its URL." }, "provider": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Trigger provider, e.g. `gmail` or `github`; null for schedules." }, "enabled": { "type": "boolean", "description": "Whether the trigger currently fires." }, "status": { "type": "string", "enum": ["active", "disabled", "completed"], "description": "`disabled` after a manual disable or an automatic one following repeated failures. `completed` applies only to schedules that have no runs left." }, "failedCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Consecutive failures since the last success; the trigger disables itself at 100. Always 0 for `webhook` and `event` triggers." }, "lastFailedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the most recent counted failure, or null.", "format": "date-time" }, "nextRunAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the next scheduled run; null when disabled and for non-schedules.", "format": "date-time" }, "lastRanAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the last scheduled run; null for non-schedules.", "format": "date-time" }, "cronExpression": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Cron expression the deployed schedule runs on; null for non-schedules. Read-only: it is computed at deploy from the schedule block, so change it by editing the block in the draft and deploying." }, "timezone": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "IANA timezone the cron expression runs in; null for non-schedules. Read-only, like `cronExpression`." }, "url": { "anyOf": [ { "type": "string", "format": "uri" }, { "type": "null" } ], "description": "Delivery URL of a `webhook` trigger; null for other kinds and for providers on a shared endpoint." } }, "required": [ "blockId", "kind", "provider", "enabled", "status", "failedCount", "lastFailedAt", "nextRunAt", "lastRanAt", "cronExpression", "timezone", "url" ], "additionalProperties": false, "title": "Workflow trigger", "description": "Health and enablement of one trigger the live deployment serves." }, "WorkflowTriggerListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowTrigger" }, "description": "Items in the current page." }, "nextCursor": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Always `null`. This list has no `cursor` or `limit` parameters; see the operation for inventory limits." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "Workflow trigger list response", "description": "Every trigger the live deployment serves.", "examples": [ { "data": [ { "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V4", "kind": "schedule", "provider": null, "enabled": false, "status": "disabled", "failedCount": 100, "lastFailedAt": "2026-08-09T18:04:11.000Z", "nextRunAt": null, "lastRanAt": "2026-08-09T18:04:00.000Z", "cronExpression": "0 * * * *", "timezone": "UTC", "url": null } ], "nextCursor": null } ] }, "UpdateWorkflowTriggerResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkflowTrigger" } }, "required": ["data"], "additionalProperties": false, "title": "Update workflow trigger response", "description": "The trigger after the update.", "examples": [ { "data": { "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V4", "kind": "schedule", "provider": null, "enabled": true, "status": "active", "failedCount": 0, "lastFailedAt": "2026-08-09T18:04:11.000Z", "nextRunAt": "2026-08-10T09:00:00.000Z", "lastRanAt": "2026-08-09T18:04:00.000Z", "cronExpression": "0 * * * *", "timezone": "UTC", "url": null } } ] }, "UpdateWorkflowTriggerRequest": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Whether the trigger should fire. A disable lasts until the next deploy or version activation, which re-enables every trigger." } }, "required": ["enabled"], "additionalProperties": false, "title": "Update workflow trigger request", "description": "Enable or disable one trigger of the live deployment. A schedule's timing is not set here: it comes from the deployed schedule block, so edit that block in the draft and deploy.", "examples": [ { "enabled": true } ] }, "WorkspaceSchedule": { "type": "object", "properties": { "blockId": { "type": "string", "description": "Trigger block in the deployed workflow." }, "enabled": { "type": "boolean", "description": "Whether the trigger currently fires." }, "status": { "type": "string", "enum": ["active", "disabled", "completed"], "description": "`disabled` after a manual disable or an automatic one following repeated failures. `completed` applies only to schedules that have no runs left." }, "failedCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Consecutive failures since the last success; the trigger disables itself at 100. Always 0 for `webhook` and `event` triggers." }, "lastFailedAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the most recent counted failure, or null.", "format": "date-time" }, "nextRunAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the next scheduled run; null when disabled and for non-schedules.", "format": "date-time" }, "lastRanAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp of the last scheduled run; null for non-schedules.", "format": "date-time" }, "cronExpression": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Cron expression the deployed schedule runs on; null for non-schedules. Read-only: it is computed at deploy from the schedule block, so change it by editing the block in the draft and deploying." }, "workflowId": { "type": "string", "description": "Workflow whose live deployment runs the schedule." }, "workflowName": { "type": "string", "description": "Name of that workflow." }, "timezone": { "type": "string", "description": "IANA timezone the cron expression runs in. Read-only, like `cronExpression`." } }, "required": [ "blockId", "enabled", "status", "failedCount", "lastFailedAt", "nextRunAt", "lastRanAt", "cronExpression", "workflowId", "workflowName", "timezone" ], "additionalProperties": false, "title": "Workspace schedule", "description": "Health and timing of one schedule a deployed workflow in the workspace runs." }, "WorkspaceScheduleListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WorkspaceSchedule" }, "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 are no more pages. Do not construct a cursor yourself." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "Workspace schedule list response", "description": "A cursor-paginated page of the schedules deployed workflows run.", "examples": [ { "data": [ { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workflowName": "Customer support triage", "blockId": "blk_01J8ZK3QW4M6X2R9T7B5C0V4", "enabled": true, "status": "active", "failedCount": 0, "lastFailedAt": null, "nextRunAt": "2026-08-10T09:00:00.000Z", "lastRanAt": "2026-08-10T08:00:00.000Z", "cronExpression": "0 * * * *", "timezone": "UTC" } ], "nextCursor": null } ] }, "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 warnings about deployment side effects, such as notifications that are still queued or failed. Empty when there is nothing to report. Lint findings are never reported here." }, "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 }, "lint": { "anyOf": [ { "$ref": "#/components/schemas/WorkflowLintReport" }, { "type": "null" } ], "description": "Advisory lint for the admitted version, checked as the deploying member. Findings never block deployment. Null when lint exceeds its time budget or cannot complete; the deployment proceeds." } }, "required": [ "id", "isDeployed", "deployedAt", "warnings", "activeDeployment", "latestDeploymentAttempt", "lint" ], "additionalProperties": false, "title": "Deploy result", "description": "Deployment accepted for asynchronous activation. Poll Get workflow deployment and match `latestDeploymentAttempt` to this attempt; an older version can remain live while it activates. List workflow versions reports `isActive`." }, "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, "lint": { "sources": [], "sinks": [], "orphanBlocks": [], "emptyOutgoingPorts": [], "invalidBranchPorts": [], "invalidConnectionTargets": [], "fieldIssues": [], "unresolvedReferences": [], "tableFieldIssues": [], "manualRunIssue": null, "notes": [] } } } ] }, "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" } ] }, "expectedDraftFingerprint": { "description": "Deploy only this draft: the `sf1:` fingerprint a source apply answered with (`base.fingerprint`). When the draft changed since, the deploy answers `409` and publishes nothing.", "type": "string", "pattern": "^sf1:[0-9a-f]{64}$" } }, "additionalProperties": false }, "ArchivedWorkflowMcpTool": { "type": "object", "properties": { "serverId": { "type": "string", "description": "Workflow-MCP server the tool is published on." }, "toolName": { "type": "string", "description": "Name MCP clients called the tool by." } }, "required": ["serverId", "toolName"], "additionalProperties": false, "title": "Archived workflow MCP tool", "description": "A workflow-MCP tool registration an undeploy took inactive." }, "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 warnings about deployment side effects, such as notifications that are still queued or failed. Empty when there is nothing to report. Lint findings are never reported here." }, "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." }, "archivedMcpTools": { "type": "array", "items": { "$ref": "#/components/schemas/ArchivedWorkflowMcpTool" }, "description": "MCP tool registrations this undeploy archived. Each appears in its server’s tool list with `status: \"inactive\"` until the workflow is deployed again, which restores it; unpublishing one while it is inactive removes it for good. Empty when no server published the workflow." } }, "required": [ "id", "isDeployed", "deployedAt", "warnings", "activeDeployment", "latestDeploymentAttempt", "archivedMcpTools" ], "additionalProperties": false, "title": "Undeploy result", "description": "Deployment state after a successful undeploy. `isDeployed` is false and no workflow version is active. Undeploying also takes every MCP tool that published the workflow inactive; `archivedMcpTools` names them so the effect is not silent." }, "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, "archivedMcpTools": [] } } ] }, "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": "Saved graph, edges, containers, metadata, and variables. Registered credential fields are cleared; ordinary variables and unresolved environment references remain included." }, "referenceManifest": { "description": "Versioned non-secret identifiers and registered source field occurrences for mapped import.", "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Reference format or deployment version number." }, "references": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Untrusted source reference label; imports never use it to authorize or query a source workspace." }, "required": { "type": "boolean", "description": "Whether the reference or configuration is required for this operation." }, "occurrences": { "minItems": 1, "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "valuePath": { "maxItems": 8, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "integer", "minimum": 0, "maximum": 2000 } ] }, "description": "Path within the field value; strings address properties and numbers address array entries." }, "positions": { "description": "Positions occupied by this identifier in a multi-value field.", "maxItems": 2000, "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 2000 } }, "encoding": { "type": "string", "enum": ["scalar", "array", "csv", "files", "environment"], "description": "Registered encoding used to discover and rewrite the reference." } }, "required": ["blockId", "subBlockKey", "valuePath", "encoding"], "additionalProperties": false }, "description": "Every registered source block and field occurrence of this reference." } }, "required": ["kind", "sourceId", "required", "occurrences"], "additionalProperties": false }, "description": "Non-secret resource identifiers and their registered occurrences." } }, "required": ["version", "references"], "additionalProperties": false } }, "required": ["version", "exportedAt", "workflow", "state"], "additionalProperties": false, "title": "Workflow export payload", "description": "Portable saved draft with registered credential fields cleared. Workspace bindings are cleared by default and retained when `includeWorkspaceBindings=true`." }, "ExportWorkflowResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkflowExportPayload" } }, "required": ["data"], "additionalProperties": false, "title": "Export workflow response", "description": "Portable workflow data with registered credential fields cleared.", "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": [] } } } ] }, "ImportedWorkflowBlock": { "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": "Imported workflow block", "description": "A block the import created in the new workflow." }, "ImportedWorkflow": { "type": "object", "properties": { "id": { "type": "string", "description": "Resource identifier." }, "name": { "type": "string", "description": "Display name of the workflow or workspace." }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Imported workflow description." }, "workspaceId": { "type": "string", "description": "Explicit current workspace scope." }, "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" }, "blocks": { "description": "Blocks the import created, in payload order. Omitted only when replaying an older receipt that did not record this summary. The workflow state read returns the current full graph.", "type": "array", "items": { "$ref": "#/components/schemas/ImportedWorkflowBlock" } }, "warnings": { "type": "array", "items": { "type": "string" }, "description": "Missing required workspace bindings, such as a table or knowledge base, reported as `: was stripped by export; set it before running`. Set these fields before execution. Default exports clear workspace bindings; `includeWorkspaceBindings=true` retains non-secret bindings for same-workspace imports. Empty when no required binding is missing." }, "operationId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Durable operation identifier to use for polling." }, "requestId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Client request ID used to commit this operation. Reuse identical mutation inputs with this ID after an uncertain response." }, "kind": { "type": "string", "enum": ["workflow_import", "workspace_fork", "workspace_push", "workspace_pull"], "description": "Type of committed workspace operation." }, "applied": { "type": "boolean", "const": true, "description": "The business transaction committed, including when follow-up work fails." }, "status": { "type": "string", "enum": [ "processing", "completed", "completed_with_warnings", "requires_configuration", "failed" ], "description": "Operation status; failed follow-up work does not undo the committed transaction." }, "resourceIds": { "maxItems": 5000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "description": "Identifiers of resources created or changed by the committed operation." }, "issues": { "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Stable machine-readable issue code." }, "message": { "type": "string", "maxLength": 2048, "description": "Human-readable explanation of the issue." }, "workflowId": { "description": "Workflow affected by this issue or deployment attempt.", "type": "string", "maxLength": 256 }, "blockId": { "description": "Source block identifier before graph ID regeneration.", "type": "string", "maxLength": 256 }, "subBlockKey": { "description": "Registered source field key, including the tool index for nested Agent fields.", "type": "string", "maxLength": 256 } }, "required": ["code", "message"], "additionalProperties": false }, "description": "Structured warnings, missing configuration, and follow-up failures." }, "idMap": { "description": "Source graph identifiers mapped to the imported identifiers.", "type": "object", "propertyNames": { "type": "string", "maxLength": 256 }, "additionalProperties": { "type": "string", "maxLength": 256 } }, "deploymentOperationIds": { "description": "Exact deployment attempts admitted by the workspace operation.", "maxItems": 1000, "type": "array", "items": { "type": "string", "maxLength": 256 } }, "deployments": { "description": "Readiness of the exact admitted deployment attempts.", "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "operationId": { "type": "string", "maxLength": 256, "description": "Durable operation identifier to use for polling." }, "workflowId": { "type": "string", "maxLength": 256, "description": "Workflow affected by this issue or deployment attempt." }, "version": { "type": "integer", "minimum": 1, "maximum": 9007199254740991, "description": "Deployment version number for this admitted attempt." }, "status": { "type": "string", "enum": ["preparing", "activating", "active", "failed", "superseded"], "description": "Status of this exact admitted deployment attempt." }, "ready": { "type": "boolean", "description": "Whether this exact deployment attempt is active and all required components are ready." }, "pendingComponents": { "maxItems": 32, "type": "array", "items": { "type": "string", "maxLength": 128 }, "description": "Deployment components that have not finished becoming ready." } }, "required": [ "operationId", "workflowId", "version", "status", "ready", "pendingComponents" ], "additionalProperties": false } }, "triggerUrlChanges": { "description": "Public trigger paths changed by this sync, with the affected workflow names.", "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "workflowName": { "type": "string", "maxLength": 1024, "description": "Name of the workflow whose public trigger path stops serving." }, "path": { "type": "string", "maxLength": 4096, "description": "Public trigger path that stops serving after this sync." } }, "required": ["workflowName", "path"], "additionalProperties": false } }, "backgroundWorkId": { "description": "Workspace activity identifier for resource-copy progress.", "type": "string", "maxLength": 256 }, "copyProgress": { "description": "Completion status and counts for explicitly selected resource copies.", "type": "object", "properties": { "status": { "type": "string", "enum": ["pending", "completed", "failed"], "description": "Background resource-copy status." }, "copied": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of resources copied successfully." }, "failed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of resources that failed to copy." } }, "required": ["status", "copied", "failed"], "additionalProperties": false } }, "required": [ "id", "name", "description", "workspaceId", "folderPath", "createdAt", "updatedAt", "warnings" ], "additionalProperties": false, "title": "Imported workflow", "description": "Workflow created by an import operation, with the required workspace bindings it arrived without." }, "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", "blocks": [ { "id": "block_start", "type": "starter", "name": "Start" }, { "id": "block_triage", "type": "agent", "name": "Triage" }, { "id": "block_reply", "type": "response", "name": "Reply" } ], "warnings": ["Triage: knowledgeBaseId was stripped by export; set it before running"] } } ] }, "ImportWorkflowBody": { "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 }, "mappings": { "description": "Mapping entries addressed by resource kind and source identifier.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Untrusted source reference label; imports never use it to authorize or query a source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["kind", "sourceId", "targetId"], "additionalProperties": false } }, "bindings": { "description": "Resolved and unresolved source occurrences with their destination selections.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "valuePath": { "default": [], "maxItems": 8, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "integer", "minimum": 0, "maximum": 2000 } ] }, "description": "Path within the field value; strings address properties and numbers address array entries." }, "positions": { "description": "Positions occupied by this identifier in a multi-value field.", "maxItems": 2000, "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 2000 } }, "encoding": { "default": "scalar", "type": "string", "enum": ["scalar", "array", "csv", "files", "environment"], "description": "Registered encoding used to discover and rewrite the reference." }, "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["blockId", "subBlockKey", "kind", "targetId"], "additionalProperties": false } }, "dependentValues": { "description": "Destination-specific values addressed by the source block ID and field key, before imported IDs are regenerated.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "value": { "type": "string", "maxLength": 16384, "description": "Destination value for the registered dependent field." } }, "required": ["blockId", "subBlockKey", "value"], "additionalProperties": false } }, "requestId": { "description": "Stable client request ID for mapped import. Reuse it with identical inputs after an uncertain response; changed inputs return 409. A new ID can create another workflow.", "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9._:-]+$" }, "previewFingerprint": { "description": "Fingerprint returned by an import preview with the same choices. A changed plan returns 409; preview again. Do not invent this value.", "type": "string", "pattern": "^[a-f0-9]{64}$" } }, "required": ["workspaceId", "workflow"], "additionalProperties": false, "title": "Import workflow input", "description": "Workflow document, destination, and optional reviewed mappings. This example creates an empty draft." }, "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": { "workflowId": { "description": "Child workflow containing the selected block. Omitted for the deployed workflow.", "type": "string" }, "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 are no more pages. Do not construct a cursor 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. On replace, omission uses the platform default; an empty string keeps the existing message.", "type": "string", "maxLength": 2000 }, "imageUrl": { "description": "Avatar image shown beside assistant messages. On replace, omission or an empty string keeps the existing avatar.", "type": "string", "maxLength": 2048 } }, "additionalProperties": false, "title": "Chat deployment customizations", "description": "Presentation overrides for the deployed chat." }, "ChatDeploymentOutputConfig": { "type": "object", "properties": { "workflowId": { "description": "Child workflow containing the selected block. Omit for the deployed workflow.", "type": "string", "minLength": 1 }, "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 `primaryColor` and `welcomeMessage` use platform defaults; an omitted or empty `imageUrl` keeps the existing avatar. An empty `welcomeMessage` keeps the existing message.", "$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 of 15 to 1024 characters, not only whitespace. Required whenever `authType` is `password`, and rejected otherwise. Never readable back. Taken literally, except that a request from the Sim agent resolves a whole-value `{{ENV_VAR}}` reference to that variable before the rules apply.", "type": "string", "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, when attributable. Get workflow run reads it from the run trace, so it is absent there when the trace is unavailable or hidden by organization permission groups, when no failed block in the trace recorded the run error, and for a timeout, cancellation, usage-limit, or invalid-input failure.", "type": "string" }, "blockName": { "description": "Display name of the failing block, when attributable. Present whenever `blockId` is.", "type": "string" }, "blockType": { "description": "Integration or block type that failed, when attributable. Present whenever `blockId` is.", "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." }, "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`, keyed by those selector strings exactly as sent, or null when none were requested. `output` stays the final workflow output regardless. Selectors whose block did not run or whose path is absent are omitted (an unknown block is a `400` instead); failed runs include the outputs of the blocks that did run." }, "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 }, "executionTimeoutSeconds": { "anyOf": [ { "type": "number", "exclusiveMinimum": 0 }, { "type": "null" } ], "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout." } }, "required": [ "runId", "workflowId", "status", "output", "blockOutputs", "error", "executionTimeoutSeconds" ], "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" }, "blockOutputs": null, "error": null, "startedAt": "2026-08-09T18:04:10.000Z", "endedAt": "2026-08-09T18:04:11.000Z", "durationMs": 1000, "executionTimeoutSeconds": 3000 } } ] }, "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." }, "executionTimeoutSeconds": { "anyOf": [ { "type": "number", "exclusiveMinimum": 0 }, { "type": "null" } ], "description": "Execution timeout applied to this run, in seconds: the plan's timeout, lowered by `executionTimeoutSeconds` when one was requested. Null when the run has no execution timeout." } }, "required": ["runId", "statusUrl", "executionTimeoutSeconds"], "additionalProperties": false, "title": "Queued workflow run", "description": "Receipt returned when a workflow run is queued, or is still running when `waitTimeoutSeconds` elapsed." }, "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, or for a synchronous run still running when `waitTimeoutSeconds` elapsed.", "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", "executionTimeoutSeconds": 5400 } } ] }, "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; `source: \"deployment\"` with `version` runs that deployment version. Manual execution requires OAuth or personal-key write access and supports synchronous or streamed runs only; `waitTimeoutSeconds` lets a synchronous one continue in the background.", "oneOf": [ { "type": "object", "properties": { "source": { "type": "string", "const": "deployment", "description": "Execute a deployed workflow version." }, "version": { "description": "Deployment version to execute instead of the active one. Requires a full-access API key or an OAuth access token with `api:write`, plus workspace write access, and the workflow must be deployed. An unknown version returns `404`.", "type": "integer", "minimum": 1, "maximum": 2147483647 } }, "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: its id, display name or reference key (the name lowercased, whitespace and dots removed)." }, "sourceRunId": { "type": "string", "minLength": 1, "description": "Run in this workflow whose persisted execution state supplies upstream block results. Missing or expired state returns 404." } }, "required": ["type", "blockId", "sourceRunId"], "additionalProperties": false } ] }, "stopAfterBlockId": { "description": "Saved workflow block after which the run stops (its id, display name or reference key); downstream blocks do not execute. Must not be inside a loop or parallel. If a router, condition, or untaken error path routes the run away from the block, the run fails as soon as that is decided; no further block starts, though blocks already running finish. With a block entry naming the same block, re-runs only that block against the source run.", "type": "string", "minLength": 1 } }, "required": ["source"], "additionalProperties": false } ] }, "async": { "default": false, "description": "Queue the run and return a 202 receipt. Requires a full-access API key or an OAuth access token with `api:write`, and a deployed run source. Cannot stream, select outputs, enable thinking/tool events, or include file-inlining options (`includeFileBase64` or `base64MaxBytes`).", "type": "boolean" }, "executionTimeoutSeconds": { "description": "Maximum duration of an asynchronous run, in seconds, capped by the plan's execution timeout. Requires `async: true` or `waitTimeoutSeconds`; otherwise returns `400`.", "type": "integer", "minimum": 1, "maximum": 604800 }, "waitTimeoutSeconds": { "description": "Wait at most this many seconds for a synchronous run; `0` waits until it settles. A run still going then continues in the background and the response carries its run receipt instead of its result: `202` on a JSON response, or a closing `detached` frame on an `application/x-ndjson` result stream, which keeps its `200`. The receipt is sent only once the run can be read on the runs resource, where it can also be cancelled. The run is admitted under asynchronous limits, and a dropped connection no longer cancels it. Requires a full-access API key or an OAuth access token with `api:write`. Cannot be combined with `async` or `stream`.", "type": "integer", "minimum": 0, "maximum": 604800 }, "stream": { "default": false, "description": "Return Server-Sent Events instead of JSON when true. Cannot be combined with `async`.", "type": "boolean" }, "selectedOutputs": { "description": "Select `.` or `..` using normalized block reference names. Child selectors cover every invocation. Synchronous results use selector strings verbatim as `blockOutputs` keys; streaming selections shape the envelope. Unknown block names or IDs return `400` with available blocks before execution. Unexecuted blocks and absent paths are omitted. Incompatible with `async`; select outputs from the finished run resource instead.", "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. Input descriptions specify compatible modes; invalid combinations return `400`.", "examples": [ { "input": { "ticketId": "ticket_123" } }, { "input": { "ticketId": "ticket_123" }, "async": true }, { "input": { "ticketId": "ticket_123" }, "stream": true }, { "run": { "source": "manual" } }, { "run": { "source": "manual" }, "waitTimeoutSeconds": 240 }, { "run": { "source": "manual", "entry": { "type": "block", "blockId": "block_123", "sourceRunId": "run_123" } } }, { "run": { "source": "manual", "entry": { "type": "block", "blockId": "block_123", "sourceRunId": "run_123" }, "stopAfterBlockId": "block_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 has a human or time pause that can still be resumed; once the run has finished and every pause point has resumed or failed, it reports the finished status. The single-run response provides the pause kind, resume time, and any automatic-resume waiting reason." }, "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": "Credits consumed, or null when unavailable or hidden by organization permission groups." } }, "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 are no more pages. Do not construct a cursor 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 } ] }, "PausedRun": { "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." }, "workflowName": { "type": "string", "description": "Name of the workflow that produced the run." }, "pausedAt": { "type": "string", "description": "ISO 8601 timestamp when the run entered the paused state.", "format": "date-time" }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowRunPausePoint" }, "description": "Human pause points still waiting for a resume, earliest first, at most 100. Resume one with Resume workflow run, naming its `contextId` and supplying `input`. Get workflow run lists every point of the run, including time pauses and points already resuming." } }, "required": ["runId", "workflowId", "workflowName", "pausedAt", "points"], "additionalProperties": false, "title": "Paused run", "description": "A run waiting on human input, with the points it waits at." }, "WorkflowRunPausePoint": { "type": "object", "properties": { "contextId": { "type": "string", "description": "Pause context to name in `contextId` when resuming this point." }, "blockId": { "type": "string", "description": "Workflow block that paused." }, "blockName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Name of the block as the run executed it. Null only for a point paused before names were recorded whose run was manual or whose deployment version no longer exists." }, "kind": { "type": "string", "enum": ["human", "time"], "description": "`human` waits for a resume request; `time` resumes automatically at `resumeAt`." }, "status": { "type": "string", "enum": ["paused", "queued", "resuming", "resumed", "failed"], "description": "Resume state of this point: waiting, queued behind another resume, resuming, resumed, or a failed resume attempt." }, "registeredAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 timestamp when the run paused at this point, or null for a point recorded without one.", "format": "date-time" }, "resumeAt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "ISO 8601 automatic-resume timestamp for a time pause, otherwise null.", "format": "date-time" }, "parallel": { "anyOf": [ { "type": "object", "properties": { "parallelId": { "type": "string", "description": "Parallel block containing the pause." }, "branchIndex": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Zero-based branch that paused." }, "branchTotal": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Number of branches, or null when unrecorded." } }, "required": ["parallelId", "branchIndex", "branchTotal"], "additionalProperties": false }, { "type": "null" } ], "description": "Parallel branch of the pause, or null outside a parallel." }, "loop": { "anyOf": [ { "type": "object", "properties": { "loopId": { "type": "string", "description": "Loop block containing the pause." }, "iteration": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Zero-based iteration that paused." } }, "required": ["loopId", "iteration"], "additionalProperties": false }, { "type": "null" } ], "description": "Loop iteration of the pause, or null outside a loop." }, "inputFields": { "anyOf": [ { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowRunPauseInputField" } }, { "type": "null" } ], "description": "Fields a human pause asks for, without default values. Labels and descriptions are resolved, so they are withheld when organization permission groups hide execution data. Null then, for a time pause, a pause with no declared form, fields over 64 KiB or not provably free of secrets, or one recorded before pause details were captured." }, "display": { "anyOf": [ { "description": "Reviewer content value." }, { "type": "null" } ], "description": "Content the pause presents to its reviewer, with the run's resolved secrets redacted. Null unless `includeOutput=true`, when hidden by organization permission groups, for a time pause, for content over 64 KiB or not provably free of secrets, or for a pause recorded before pause details were captured." }, "queuePosition": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Position among pending resume requests for this run, or null when none waits." } }, "required": [ "contextId", "blockId", "blockName", "kind", "status", "registeredAt", "resumeAt", "parallel", "loop", "inputFields", "display", "queuePosition" ], "additionalProperties": false, "title": "Workflow run pause point", "description": "One point at which a paused run waits." }, "WorkflowRunPauseInputField": { "type": "object", "properties": { "name": { "type": "string", "description": "Key to supply this field under in the resume `input`." }, "label": { "type": "string", "description": "Display label for the field." }, "type": { "type": "string", "description": "Declared value type, such as `string`, `number`, or `boolean`." }, "description": { "description": "Field help text, when configured.", "type": "string" }, "placeholder": { "description": "Placeholder text, when configured.", "type": "string" }, "required": { "type": "boolean", "description": "Whether the field is marked required." }, "options": { "description": "Selectable options, when the field offers a fixed set.", "type": "array", "items": { "description": "One selectable option." } } }, "required": ["name", "label", "type", "required"], "additionalProperties": false, "title": "Pause input field", "description": "One field a human pause asks the resumer to fill." }, "PausedRunListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/PausedRun" }, "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 are no more pages. Do not construct a cursor yourself." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "Paused run list response", "description": "A cursor-paginated page of runs waiting on human input.", "examples": [ { "data": [ { "runId": "run_8f14e45f-ceea-467f-a", "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workflowName": "Customer support triage", "pausedAt": "2026-08-09T18:04:11.000Z", "points": [ { "contextId": "blk_approval", "blockId": "blk_approval", "blockName": "Manager approval", "kind": "human", "status": "paused", "registeredAt": "2026-08-09T18:04:11.000Z", "resumeAt": null, "parallel": null, "loop": null, "inputFields": [ { "name": "approved", "label": "Approved", "type": "boolean", "required": true } ], "display": null, "queuePosition": null } ] } ], "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 has a human or time pause that can still be resumed; once the run has finished and every pause point has resumed or failed, it reports the finished status. The single-run response provides the pause kind, resume time, and any automatic-resume waiting reason." }, "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." }, "version": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "null" } ], "description": "Deployment version the run executed. Null for a manual run, a queued run not yet started, or a run whose version no longer exists." }, "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": "Recorded automatic-resume failure, or null when no failure is recorded. Inspect `pauseKind` and `resumeAt` to distinguish a scheduled time pause from human input. Cleared after a successful resume. A non-retryable or exhausted failure starts with `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." }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/WorkflowRunPausePoint" }, "description": "Every point the run is paused at, earliest first, at most 100; past 100, points not yet resumed are kept in preference to resumed ones. Resume one with Resume workflow run, naming its `contextId` and supplying `input`." } }, "required": [ "contextId", "pausedAt", "resumeAt", "pauseKind", "blockedOnBlockId", "automaticResumeWaitingReason", "pausePointCount", "resumedCount", "points" ], "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": "Credits consumed, or null when unavailable or hidden by organization permission groups." }, "error": { "anyOf": [ { "$ref": "#/components/schemas/ExecutionError" }, { "type": "null" } ], "description": "Structured execution failure, or null when none occurred. The failing block is read from the run trace, so `blockId`/`blockName`/`blockType` are absent, and a block-level failure reports `EXECUTION_FAILED`, when the trace is unavailable or hidden by organization permission groups." }, "output": { "anyOf": [ { "description": "Final workflow output value." }, { "type": "null" } ], "description": "Final output when `includeOutput=true`, or null when not requested or hidden by organization permission groups." }, "blockOutputs": { "anyOf": [ { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "description": "Output value produced by one workflow block." } }, { "type": "null" } ], "description": "Selected block outputs, or null when none were requested or execution data is hidden by organization permission groups. `selectedOutputs` controls these independently of `includeOutput`." }, "files": { "anyOf": [ { "type": "array", "items": { "$ref": "#/components/schemas/V2RunFile" } }, { "type": "null" } ], "description": "Run-produced files when `includeOutput=true`, or null when not requested or execution data is hidden by organization permission groups." } }, "required": [ "runId", "workflowId", "status", "trigger", "startedAt", "endedAt", "durationMs", "version", "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, "version": 3, "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 } ] } } ] }, "WorkflowResumeResult": { "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." }, "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`, keyed by those selector strings exactly as sent, or null when none were requested. `output` stays the final workflow output regardless. Selectors whose block did not run or whose path is absent are omitted (an unknown block is a `400` instead); failed runs include the outputs of the blocks that did run." }, "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", "blockOutputs", "error"], "additionalProperties": false, "title": "Workflow resume result", "description": "Synchronous resumed run output and in-band execution status. Run failures are reported in band, not as HTTP errors, so branch on `status`." }, "ResumeWorkflowSyncResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkflowResumeResult" } }, "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" }, "blockOutputs": null, "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 this request cancelled anything. `false` with an `already_*` reason means the run had already reached that terminal state, so there was nothing to cancel — still `200`, because a no-op is not an error. `false` with any other reason identifies a degraded or incomplete cancellation step." }, "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": "Kept for compatibility. False only when a cancellation that must publish its cancellation event did not." }, "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` and `queue_cancelled` are successful cancellation values. `already_cancelled`, `already_completed`, and `already_failed` mean the run had already reached that terminal state, so nothing was cancelled and `durablyRecorded` is false. The remaining values identify a degraded or incomplete cancellation step.", "type": "string", "enum": [ "recorded", "already_cancelled", "already_completed", "already_failed", "redis_unavailable", "redis_write_failed", "paused_event_publish_failed", "paused_database_cancel_failed", "queue_cancelled", "active_resume_signal_failed", "cancellation_not_finalized" ] } }, "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 is a `200` no-op, reported as `success: false` and `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` parameters; see the operation for inventory limits." } }, "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": "Where the folder lands, with `mv` semantics. A path naming an existing folder receives the source as a child under its current name; `/` moves it to the workspace root under its current name; any other path becomes the folder’s new full path (a rename, a relocation, or both).", "$ref": "#/components/schemas/FolderPathInput" } }, "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 } } } ] }, "GetWorkflowSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workflowId": { "type": "string", "description": "Workflow id." }, "workspaceId": { "type": "string", "description": "Workspace id." }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Relative path → file text: `workflow.ts`, then any `functions/*` files." }, "lock": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Lock format version." }, "blocks": { "description": "Block key → identity.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Block id." }, "parent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Key of the enclosing loop or parallel, or null." }, "branches": { "description": "Condition or router branch key → stored branch id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "items": { "description": "Per field, its id-bearing items (input format fields) in stored order.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name." }, "id": { "type": "string", "description": "Item id." } }, "required": ["name", "id"], "additionalProperties": false, "description": "One id-bearing list item." } } }, "ident": { "type": "string", "description": "The `const` name the block is printed as." }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Declaration-order tie-break." }, "layout": { "type": "object", "properties": { "x": { "type": "number", "description": "Canvas x position." }, "y": { "type": "number", "description": "Canvas y position." }, "w": { "description": "Container width.", "type": "number" }, "h": { "description": "Container height.", "type": "number" }, "height": { "description": "Stored block height.", "type": "number" }, "horizontalHandles": { "description": "Handles on the left and right.", "type": "boolean" } }, "required": ["x", "y"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Stored canvas geometry; applied only to new blocks." }, "codeFile": { "description": "Path of the block’s function-code file.", "type": "string" } }, "required": ["id", "parent", "ident", "order"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "One block’s identity." } }, "variables": { "description": "Variable key → variable id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["version", "blocks", "variables"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Identity sidecar (`.sim/lock.json`): binds the keys in the source to stored ids." }, "base": { "type": "object", "properties": { "version": { "default": 1, "description": "Base format version; a base written before it existed reads as 1.", "type": "number", "const": 1 }, "workflowId": { "type": "string", "minLength": 1, "description": "Workflow the source was read from; an apply to another workflow is refused." }, "workspaceId": { "type": "string", "description": "Workspace the workflow belongs to." }, "fingerprint": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Freshness token of the draft the source was read at: a hash of the canonical workflow and its ids. It ignores canvas positions, so moving blocks does not change it." }, "catalogHash": { "type": "string", "description": "Hash of the block catalog the source was printed against." } }, "required": ["version", "workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Freshness facts for the lock in this environment (`.sim/base.json`)." }, "canonicalHash": { "type": "string", "description": "Hash of the canonical workflow alone, without ids; comments do not affect it." }, "sdkMajor": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Workflow SDK major version of the source." }, "blockTypes": { "type": "array", "items": { "type": "string" }, "description": "Block types the source uses, as blocks or as agent tools, sorted." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "I_FINDINGS_TRUNCATED", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_STALE", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `W_CANON_UNRESOLVED_ID`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "blockKey": { "description": "Block the finding is about.", "type": "string" }, "param": { "description": "Field the finding is about.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding from reading the stored graph as source." }, "description": "Findings from reading the stored graph." } }, "required": [ "workflowId", "workspaceId", "files", "lock", "base", "canonicalHash", "sdkMajor", "blockTypes", "diagnostics" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Get workflow source response", "description": "The workflow draft as TypeScript source.", "examples": [ { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "canonicalHash": "0d6e2b8a4c1f7e3d9b5a2c8f4e1d7b3a9c6f2e8d4b1a7c3e9f5d2b8a4c1e7f3d", "sdkMajor": 1, "blockTypes": ["start_trigger"], "diagnostics": [] } } ] }, "ApplyWorkflowSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workflowId": { "type": "string", "description": "Workflow id." }, "workspaceId": { "type": "string", "description": "Workspace id." }, "dryRun": { "type": "boolean", "description": "True when nothing was written because `dryRun` was set." }, "applied": { "type": "boolean", "description": "True when the draft was written or the workflow renamed or redescribed; false on a dry run and on a no-op." }, "diff": { "type": "object", "properties": { "noop": { "type": "boolean", "description": "True when the source matches the saved draft." }, "meta": { "description": "The workflow name and description fields the source changes.", "type": "array", "items": { "type": "string", "enum": ["name", "description"] } }, "blocks": { "type": "object", "properties": { "added": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "type": { "type": "string", "description": "Block type." } }, "required": ["id", "key", "type"], "additionalProperties": false, "description": "An added or removed block by id, source key and type." }, "description": "New blocks." }, "removed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "type": { "type": "string", "description": "Block type." } }, "required": ["id", "key", "type"], "additionalProperties": false, "description": "An added or removed block by id, source key and type." }, "description": "Deleted blocks." }, "renamed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id; unchanged by the rename." }, "from": { "type": "string", "description": "Previous key." }, "to": { "type": "string", "description": "New key." } }, "required": ["id", "from", "to"], "additionalProperties": false, "description": "A renamed block." }, "description": "Renamed blocks; each keeps its id." }, "modified": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "fields": { "type": "array", "items": { "type": "string" }, "description": "Changed fields, modes (`modes.`) and attributes." }, "reparented": { "description": "Moved into or out of a container.", "type": "boolean" } }, "required": ["id", "key", "fields"], "additionalProperties": false, "description": "A changed block." }, "description": "Changed blocks." } }, "required": ["added", "removed", "renamed", "modified"], "additionalProperties": false, "description": "Block changes." }, "edges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Connections added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Connections removed." } }, "required": ["added", "removed"], "additionalProperties": false, "description": "Connection changes." }, "variables": { "type": "object", "properties": { "added": { "type": "array", "items": { "type": "string" }, "description": "Variable keys added." }, "removed": { "type": "array", "items": { "type": "string" }, "description": "Variable keys removed." }, "renamed": { "type": "array", "items": { "type": "object", "properties": { "from": { "type": "string", "description": "Former key." }, "to": { "type": "string", "description": "New key." } }, "required": ["from", "to"], "additionalProperties": false, "description": "A renamed variable." }, "description": "Variables renamed; each keeps its id, so none is deleted." }, "modified": { "type": "array", "items": { "type": "string" }, "description": "Variable keys changed." } }, "required": ["added", "removed", "renamed", "modified"], "additionalProperties": false, "description": "Variable changes." } }, "required": ["noop", "blocks", "edges", "variables"], "additionalProperties": false, "description": "What the apply changed, or would change on a dry run." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "I_FINDINGS_TRUNCATED", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_STALE", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `E_UNKNOWN_PARAM` or `E_APPLY_LOCKED_BLOCK`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "blockKey": { "description": "Block the finding is about.", "type": "string" }, "param": { "description": "Field the finding is about.", "type": "string" }, "file": { "description": "Submitted file the finding is in.", "type": "string" }, "line": { "description": "1-based line in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "column": { "description": "1-based column in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endLine": { "description": "1-based line the finding ends on.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endColumn": { "description": "1-based column the finding ends at.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "frame": { "description": "The source lines around the finding, with a caret row.", "type": "string" }, "blockId": { "description": "Stored id of the block the finding is about.", "type": "string" }, "path": { "description": "JSON Pointer into the lock, for a lock finding.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding from applying workflow source, pinned to the submitted files." }, "description": "Warnings, and on a dry run every error a commit would refuse." }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "The source re-printed from what was saved, including any normalized values." }, "lock": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Lock format version." }, "blocks": { "description": "Block key → identity.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Block id." }, "parent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Key of the enclosing loop or parallel, or null." }, "branches": { "description": "Condition or router branch key → stored branch id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "items": { "description": "Per field, its id-bearing items (input format fields) in stored order.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name." }, "id": { "type": "string", "description": "Item id." } }, "required": ["name", "id"], "additionalProperties": false, "description": "One id-bearing list item." } } }, "ident": { "type": "string", "description": "The `const` name the block is printed as." }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Declaration-order tie-break." }, "layout": { "type": "object", "properties": { "x": { "type": "number", "description": "Canvas x position." }, "y": { "type": "number", "description": "Canvas y position." }, "w": { "description": "Container width.", "type": "number" }, "h": { "description": "Container height.", "type": "number" }, "height": { "description": "Stored block height.", "type": "number" }, "horizontalHandles": { "description": "Handles on the left and right.", "type": "boolean" } }, "required": ["x", "y"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Stored canvas geometry; applied only to new blocks." }, "codeFile": { "description": "Path of the block’s function-code file.", "type": "string" } }, "required": ["id", "parent", "ident", "order"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "One block’s identity." } }, "variables": { "description": "Variable key → variable id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["version", "blocks", "variables"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Identity sidecar (`.sim/lock.json`): binds the keys in the source to stored ids." }, "base": { "type": "object", "properties": { "version": { "default": 1, "description": "Base format version; a base written before it existed reads as 1.", "type": "number", "const": 1 }, "workflowId": { "type": "string", "minLength": 1, "description": "Workflow the source was read from; an apply to another workflow is refused." }, "workspaceId": { "type": "string", "description": "Workspace the workflow belongs to." }, "fingerprint": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Freshness token of the draft the source was read at: a hash of the canonical workflow and its ids. It ignores canvas positions, so moving blocks does not change it." }, "catalogHash": { "type": "string", "description": "Hash of the block catalog the source was printed against." } }, "required": ["version", "workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Where the saved (or, on a dry run, would-be) draft was read: the next apply’s `base`." }, "mintedIds": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Block key → id for new blocks whose id was minted rather than taken from the lock." }, "notes": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal notes about the write." }, "needsRedeployment": { "type": "boolean", "description": "Whether the draft now differs from the live deployment; apply never deploys." } }, "required": [ "workflowId", "workspaceId", "dryRun", "applied", "diff", "diagnostics", "files", "lock", "base", "mintedIds", "notes", "needsRedeployment" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Apply workflow source response", "description": "The outcome, with the source re-printed from the saved draft.", "examples": [ { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": false, "applied": false, "diff": { "noop": true, "blocks": { "added": [], "removed": [], "renamed": [], "modified": [] }, "edges": { "added": 0, "removed": 0 }, "variables": { "added": [], "removed": [], "renamed": [], "modified": [] } }, "diagnostics": [], "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "mintedIds": {}, "notes": [], "needsRedeployment": false } } ] }, "ApplyWorkflowSourceBody": { "type": "object", "properties": { "files": { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 1024 }, "additionalProperties": { "type": "string" }, "description": "Relative path → file text: `workflow.ts` plus every function-code file it references (for example `functions/score.js`). At most 2001 files and 4000000 bytes together, for a workflow of at most 2000 blocks." }, "lock": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Lock format version." }, "blocks": { "description": "Block key → identity.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Block id." }, "parent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Key of the enclosing loop or parallel, or null." }, "branches": { "description": "Condition or router branch key → stored branch id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "items": { "description": "Per field, its id-bearing items (input format fields) in stored order.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name." }, "id": { "type": "string", "description": "Item id." } }, "required": ["name", "id"], "additionalProperties": false, "description": "One id-bearing list item." } } }, "ident": { "type": "string", "description": "The `const` name the block is printed as." }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Declaration-order tie-break." }, "layout": { "type": "object", "properties": { "x": { "type": "number", "description": "Canvas x position." }, "y": { "type": "number", "description": "Canvas y position." }, "w": { "description": "Container width.", "type": "number" }, "h": { "description": "Container height.", "type": "number" }, "height": { "description": "Stored block height.", "type": "number" }, "horizontalHandles": { "description": "Handles on the left and right.", "type": "boolean" } }, "required": ["x", "y"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Stored canvas geometry; applied only to new blocks." }, "codeFile": { "description": "Path of the block’s function-code file.", "type": "string" } }, "required": ["id", "parent", "ident", "order"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "One block’s identity." } }, "variables": { "description": "Variable key → variable id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["version", "blocks", "variables"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Identity sidecar (`.sim/lock.json`): binds the keys in the source to stored ids." }, "base": { "type": "object", "properties": { "version": { "default": 1, "description": "Base format version; a base written before it existed reads as 1.", "type": "number", "const": 1 }, "workflowId": { "type": "string", "minLength": 1, "description": "Workflow the source was read from; an apply to another workflow is refused." }, "workspaceId": { "type": "string", "description": "Workspace the workflow belongs to." }, "fingerprint": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Freshness token of the draft the source was read at: a hash of the canonical workflow and its ids. It ignores canvas positions, so moving blocks does not change it." }, "catalogHash": { "type": "string", "description": "Hash of the block catalog the source was printed against." } }, "required": ["workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Where and when the source was read (`.sim/base.json`). The apply answers `409` when the saved draft no longer matches `base.fingerprint`, and `400` when `base.workflowId` names another workflow." }, "provenance": { "description": "Where the source came from, for the audit log.", "type": "object", "properties": { "client": { "type": "string", "enum": ["cli", "copilot", "canvas", "api"], "description": "What submitted the source." }, "gitSha": { "description": "The commit the source was taken from; recorded in the audit log.", "type": "string", "pattern": "^[0-9a-f]{7,64}$" }, "repo": { "type": "string", "minLength": 1, "maxLength": 512, "description": "The repository the source was taken from (its remote URL); recorded in the audit log." } }, "required": ["client"], "additionalProperties": false } }, "required": ["files", "lock", "base"], "additionalProperties": false, "title": "Apply workflow source body", "description": "Edited source files with the lock and base they were read with." }, "PlanWorkflowSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workflowId": { "type": "string", "description": "Workflow id." }, "workspaceId": { "type": "string", "description": "Workspace id." }, "dryRun": { "type": "boolean", "description": "True when nothing was written because `dryRun` was set." }, "applied": { "type": "boolean", "description": "True when the draft was written or the workflow renamed or redescribed; false on a dry run and on a no-op." }, "diff": { "type": "object", "properties": { "noop": { "type": "boolean", "description": "True when the source matches the saved draft." }, "meta": { "description": "The workflow name and description fields the source changes.", "type": "array", "items": { "type": "string", "enum": ["name", "description"] } }, "blocks": { "type": "object", "properties": { "added": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "type": { "type": "string", "description": "Block type." } }, "required": ["id", "key", "type"], "additionalProperties": false, "description": "An added or removed block by id, source key and type." }, "description": "New blocks." }, "removed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "type": { "type": "string", "description": "Block type." } }, "required": ["id", "key", "type"], "additionalProperties": false, "description": "An added or removed block by id, source key and type." }, "description": "Deleted blocks." }, "renamed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id; unchanged by the rename." }, "from": { "type": "string", "description": "Previous key." }, "to": { "type": "string", "description": "New key." } }, "required": ["id", "from", "to"], "additionalProperties": false, "description": "A renamed block." }, "description": "Renamed blocks; each keeps its id." }, "modified": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "fields": { "type": "array", "items": { "type": "string" }, "description": "Changed fields, modes (`modes.`) and attributes." }, "reparented": { "description": "Moved into or out of a container.", "type": "boolean" } }, "required": ["id", "key", "fields"], "additionalProperties": false, "description": "A changed block." }, "description": "Changed blocks." } }, "required": ["added", "removed", "renamed", "modified"], "additionalProperties": false, "description": "Block changes." }, "edges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Connections added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Connections removed." } }, "required": ["added", "removed"], "additionalProperties": false, "description": "Connection changes." }, "variables": { "type": "object", "properties": { "added": { "type": "array", "items": { "type": "string" }, "description": "Variable keys added." }, "removed": { "type": "array", "items": { "type": "string" }, "description": "Variable keys removed." }, "renamed": { "type": "array", "items": { "type": "object", "properties": { "from": { "type": "string", "description": "Former key." }, "to": { "type": "string", "description": "New key." } }, "required": ["from", "to"], "additionalProperties": false, "description": "A renamed variable." }, "description": "Variables renamed; each keeps its id, so none is deleted." }, "modified": { "type": "array", "items": { "type": "string" }, "description": "Variable keys changed." } }, "required": ["added", "removed", "renamed", "modified"], "additionalProperties": false, "description": "Variable changes." } }, "required": ["noop", "blocks", "edges", "variables"], "additionalProperties": false, "description": "What the apply changed, or would change on a dry run." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "I_FINDINGS_TRUNCATED", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_STALE", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `E_UNKNOWN_PARAM` or `E_APPLY_LOCKED_BLOCK`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "blockKey": { "description": "Block the finding is about.", "type": "string" }, "param": { "description": "Field the finding is about.", "type": "string" }, "file": { "description": "Submitted file the finding is in.", "type": "string" }, "line": { "description": "1-based line in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "column": { "description": "1-based column in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endLine": { "description": "1-based line the finding ends on.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endColumn": { "description": "1-based column the finding ends at.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "frame": { "description": "The source lines around the finding, with a caret row.", "type": "string" }, "blockId": { "description": "Stored id of the block the finding is about.", "type": "string" }, "path": { "description": "JSON Pointer into the lock, for a lock finding.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding from applying workflow source, pinned to the submitted files." }, "description": "Warnings, and on a dry run every error a commit would refuse." }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "The source re-printed from what was saved, including any normalized values." }, "lock": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Lock format version." }, "blocks": { "description": "Block key → identity.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Block id." }, "parent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Key of the enclosing loop or parallel, or null." }, "branches": { "description": "Condition or router branch key → stored branch id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "items": { "description": "Per field, its id-bearing items (input format fields) in stored order.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name." }, "id": { "type": "string", "description": "Item id." } }, "required": ["name", "id"], "additionalProperties": false, "description": "One id-bearing list item." } } }, "ident": { "type": "string", "description": "The `const` name the block is printed as." }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Declaration-order tie-break." }, "layout": { "type": "object", "properties": { "x": { "type": "number", "description": "Canvas x position." }, "y": { "type": "number", "description": "Canvas y position." }, "w": { "description": "Container width.", "type": "number" }, "h": { "description": "Container height.", "type": "number" }, "height": { "description": "Stored block height.", "type": "number" }, "horizontalHandles": { "description": "Handles on the left and right.", "type": "boolean" } }, "required": ["x", "y"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Stored canvas geometry; applied only to new blocks." }, "codeFile": { "description": "Path of the block’s function-code file.", "type": "string" } }, "required": ["id", "parent", "ident", "order"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "One block’s identity." } }, "variables": { "description": "Variable key → variable id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["version", "blocks", "variables"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Identity sidecar (`.sim/lock.json`): binds the keys in the source to stored ids." }, "base": { "type": "object", "properties": { "version": { "default": 1, "description": "Base format version; a base written before it existed reads as 1.", "type": "number", "const": 1 }, "workflowId": { "type": "string", "minLength": 1, "description": "Workflow the source was read from; an apply to another workflow is refused." }, "workspaceId": { "type": "string", "description": "Workspace the workflow belongs to." }, "fingerprint": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Freshness token of the draft the source was read at: a hash of the canonical workflow and its ids. It ignores canvas positions, so moving blocks does not change it." }, "catalogHash": { "type": "string", "description": "Hash of the block catalog the source was printed against." } }, "required": ["version", "workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Where the saved (or, on a dry run, would-be) draft was read: the next apply’s `base`." }, "mintedIds": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Block key → id for new blocks whose id was minted rather than taken from the lock." }, "notes": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal notes about the write." }, "needsRedeployment": { "type": "boolean", "description": "Whether the draft now differs from the live deployment; apply never deploys." } }, "required": [ "workflowId", "workspaceId", "dryRun", "applied", "diff", "diagnostics", "files", "lock", "base", "mintedIds", "notes", "needsRedeployment" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Plan workflow source response", "description": "What an apply would store, and every finding.", "examples": [ { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": true, "applied": false, "diff": { "noop": true, "blocks": { "added": [], "removed": [], "renamed": [], "modified": [] }, "edges": { "added": 0, "removed": 0 }, "variables": { "added": [], "removed": [], "renamed": [], "modified": [] } }, "diagnostics": [], "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "mintedIds": {}, "notes": [], "needsRedeployment": false } } ] }, "PlanWorkflowSourceBody": { "type": "object", "properties": { "files": { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 1024 }, "additionalProperties": { "type": "string" }, "description": "Relative path → file text: `workflow.ts` plus every function-code file it references (for example `functions/score.js`). At most 2001 files and 4000000 bytes together, for a workflow of at most 2000 blocks." }, "lock": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Lock format version." }, "blocks": { "description": "Block key → identity.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Block id." }, "parent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Key of the enclosing loop or parallel, or null." }, "branches": { "description": "Condition or router branch key → stored branch id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "items": { "description": "Per field, its id-bearing items (input format fields) in stored order.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name." }, "id": { "type": "string", "description": "Item id." } }, "required": ["name", "id"], "additionalProperties": false, "description": "One id-bearing list item." } } }, "ident": { "type": "string", "description": "The `const` name the block is printed as." }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Declaration-order tie-break." }, "layout": { "type": "object", "properties": { "x": { "type": "number", "description": "Canvas x position." }, "y": { "type": "number", "description": "Canvas y position." }, "w": { "description": "Container width.", "type": "number" }, "h": { "description": "Container height.", "type": "number" }, "height": { "description": "Stored block height.", "type": "number" }, "horizontalHandles": { "description": "Handles on the left and right.", "type": "boolean" } }, "required": ["x", "y"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Stored canvas geometry; applied only to new blocks." }, "codeFile": { "description": "Path of the block’s function-code file.", "type": "string" } }, "required": ["id", "parent", "ident", "order"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "One block’s identity." } }, "variables": { "description": "Variable key → variable id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["version", "blocks", "variables"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Identity sidecar (`.sim/lock.json`): binds the keys in the source to stored ids." }, "base": { "type": "object", "properties": { "version": { "default": 1, "description": "Base format version; a base written before it existed reads as 1.", "type": "number", "const": 1 }, "workflowId": { "type": "string", "minLength": 1, "description": "Workflow the source was read from; an apply to another workflow is refused." }, "workspaceId": { "type": "string", "description": "Workspace the workflow belongs to." }, "fingerprint": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Freshness token of the draft the source was read at: a hash of the canonical workflow and its ids. It ignores canvas positions, so moving blocks does not change it." }, "catalogHash": { "type": "string", "description": "Hash of the block catalog the source was printed against." } }, "required": ["workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Where and when the source was read (`.sim/base.json`). A draft that no longer matches `base.fingerprint` is reported as `E_APPLY_STALE` in `diagnostics`." } }, "required": ["files", "lock", "base"], "additionalProperties": false, "title": "Plan workflow source body", "description": "Edited source files with the lock and base they were read with." }, "CreateWorkflowFromSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workflowId": { "type": "string", "description": "Workflow id." }, "workspaceId": { "type": "string", "description": "Workspace id." }, "dryRun": { "type": "boolean", "description": "True when nothing was written because `dryRun` was set." }, "applied": { "type": "boolean", "description": "True when the draft was written or the workflow renamed or redescribed; false on a dry run and on a no-op." }, "diff": { "type": "object", "properties": { "noop": { "type": "boolean", "description": "True when the source matches the saved draft." }, "meta": { "description": "The workflow name and description fields the source changes.", "type": "array", "items": { "type": "string", "enum": ["name", "description"] } }, "blocks": { "type": "object", "properties": { "added": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "type": { "type": "string", "description": "Block type." } }, "required": ["id", "key", "type"], "additionalProperties": false, "description": "An added or removed block by id, source key and type." }, "description": "New blocks." }, "removed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "type": { "type": "string", "description": "Block type." } }, "required": ["id", "key", "type"], "additionalProperties": false, "description": "An added or removed block by id, source key and type." }, "description": "Deleted blocks." }, "renamed": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id; unchanged by the rename." }, "from": { "type": "string", "description": "Previous key." }, "to": { "type": "string", "description": "New key." } }, "required": ["id", "from", "to"], "additionalProperties": false, "description": "A renamed block." }, "description": "Renamed blocks; each keeps its id." }, "modified": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored block id." }, "key": { "type": "string", "description": "Block key in the source." }, "fields": { "type": "array", "items": { "type": "string" }, "description": "Changed fields, modes (`modes.`) and attributes." }, "reparented": { "description": "Moved into or out of a container.", "type": "boolean" } }, "required": ["id", "key", "fields"], "additionalProperties": false, "description": "A changed block." }, "description": "Changed blocks." } }, "required": ["added", "removed", "renamed", "modified"], "additionalProperties": false, "description": "Block changes." }, "edges": { "type": "object", "properties": { "added": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Connections added." }, "removed": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Connections removed." } }, "required": ["added", "removed"], "additionalProperties": false, "description": "Connection changes." }, "variables": { "type": "object", "properties": { "added": { "type": "array", "items": { "type": "string" }, "description": "Variable keys added." }, "removed": { "type": "array", "items": { "type": "string" }, "description": "Variable keys removed." }, "renamed": { "type": "array", "items": { "type": "object", "properties": { "from": { "type": "string", "description": "Former key." }, "to": { "type": "string", "description": "New key." } }, "required": ["from", "to"], "additionalProperties": false, "description": "A renamed variable." }, "description": "Variables renamed; each keeps its id, so none is deleted." }, "modified": { "type": "array", "items": { "type": "string" }, "description": "Variable keys changed." } }, "required": ["added", "removed", "renamed", "modified"], "additionalProperties": false, "description": "Variable changes." } }, "required": ["noop", "blocks", "edges", "variables"], "additionalProperties": false, "description": "What the apply changed, or would change on a dry run." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_LIMIT_EXCEEDED", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "I_FINDINGS_TRUNCATED", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_STALE", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_NAME_TAKEN", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `E_UNKNOWN_PARAM` or `E_APPLY_LOCKED_BLOCK`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "blockKey": { "description": "Block the finding is about.", "type": "string" }, "param": { "description": "Field the finding is about.", "type": "string" }, "file": { "description": "Submitted file the finding is in.", "type": "string" }, "line": { "description": "1-based line in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "column": { "description": "1-based column in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endLine": { "description": "1-based line the finding ends on.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endColumn": { "description": "1-based column the finding ends at.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "frame": { "description": "The source lines around the finding, with a caret row.", "type": "string" }, "blockId": { "description": "Stored id of the block the finding is about.", "type": "string" }, "path": { "description": "JSON Pointer into the lock, for a lock finding.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding from applying workflow source, pinned to the submitted files." }, "description": "Warnings, and on a dry run every error a commit would refuse." }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "The source re-printed from what was saved, including any normalized values." }, "lock": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Lock format version." }, "blocks": { "description": "Block key → identity.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Block id." }, "parent": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Key of the enclosing loop or parallel, or null." }, "branches": { "description": "Condition or router branch key → stored branch id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "items": { "description": "Per field, its id-bearing items (input format fields) in stored order.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Item name." }, "id": { "type": "string", "description": "Item id." } }, "required": ["name", "id"], "additionalProperties": false, "description": "One id-bearing list item." } } }, "ident": { "type": "string", "description": "The `const` name the block is printed as." }, "order": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991, "description": "Declaration-order tie-break." }, "layout": { "type": "object", "properties": { "x": { "type": "number", "description": "Canvas x position." }, "y": { "type": "number", "description": "Canvas y position." }, "w": { "description": "Container width.", "type": "number" }, "h": { "description": "Container height.", "type": "number" }, "height": { "description": "Stored block height.", "type": "number" }, "horizontalHandles": { "description": "Handles on the left and right.", "type": "boolean" } }, "required": ["x", "y"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Stored canvas geometry; applied only to new blocks." }, "codeFile": { "description": "Path of the block’s function-code file.", "type": "string" } }, "required": ["id", "parent", "ident", "order"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "One block’s identity." } }, "variables": { "description": "Variable key → variable id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["version", "blocks", "variables"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Identity sidecar (`.sim/lock.json`): binds the keys in the source to stored ids." }, "base": { "type": "object", "properties": { "version": { "default": 1, "description": "Base format version; a base written before it existed reads as 1.", "type": "number", "const": 1 }, "workflowId": { "type": "string", "minLength": 1, "description": "Workflow the source was read from; an apply to another workflow is refused." }, "workspaceId": { "type": "string", "description": "Workspace the workflow belongs to." }, "fingerprint": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Freshness token of the draft the source was read at: a hash of the canonical workflow and its ids. It ignores canvas positions, so moving blocks does not change it." }, "catalogHash": { "type": "string", "description": "Hash of the block catalog the source was printed against." } }, "required": ["version", "workflowId", "workspaceId", "fingerprint", "catalogHash"], "additionalProperties": { "description": "An `x-` extension field, kept verbatim." }, "description": "Where the saved (or, on a dry run, would-be) draft was read: the next apply’s `base`." }, "mintedIds": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Block key → id for new blocks whose id was minted rather than taken from the lock." }, "notes": { "type": "array", "items": { "type": "string" }, "description": "Non-fatal notes about the write." }, "needsRedeployment": { "type": "boolean", "description": "Whether the draft now differs from the live deployment; apply never deploys." } }, "required": [ "workflowId", "workspaceId", "dryRun", "applied", "diff", "diagnostics", "files", "lock", "base", "mintedIds", "notes", "needsRedeployment" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Create workflow from source response", "description": "The outcome, with the source re-printed from the saved workflow.", "examples": [ { "data": { "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": false, "applied": true, "diff": { "noop": false, "blocks": { "added": [ { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "key": "start", "type": "start_trigger" } ], "removed": [], "renamed": [], "modified": [] }, "edges": { "added": 0, "removed": 0 }, "variables": { "added": [], "removed": [], "renamed": [], "modified": [] } }, "diagnostics": [], "files": { "workflow.ts": "// @sim-sdk 1\nimport { trigger, workflow } from '@sim/workflow-sdk'\n\nexport default workflow('Support triage', () => {\n const start = trigger.start('Start')\n})\n" }, "lock": { "version": 1, "blocks": { "start": { "id": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77", "parent": null, "ident": "start", "order": 0 } }, "variables": {} }, "base": { "version": 1, "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "fingerprint": "sf1:9c1d4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d", "catalogHash": "3f0c1a9e5b7d2c4f6a8e0b1d3c5f7a9e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a" }, "mintedIds": { "start": "a3f1c0b2-7a44-4c1d-9d3a-2b8e5f0a1c77" }, "notes": [], "needsRedeployment": false } } ] }, "CreateWorkflowFromSourceBody": { "type": "object", "properties": { "files": { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 1024 }, "additionalProperties": { "type": "string" }, "description": "Relative path → file text: `workflow.ts` plus every function-code file it references (for example `functions/score.js`). At most 2001 files and 4000000 bytes together, for a workflow of at most 2000 blocks." }, "name": { "description": "Workflow name. Defaults to the name in the source's `workflow('…')` call.", "type": "string", "minLength": 1, "maxLength": 255 }, "description": { "description": "Workflow description. Defaults to the description in the source.", "anyOf": [ { "type": "string", "maxLength": 50000 }, { "type": "null" } ] }, "folderPath": { "$ref": "#/components/schemas/FolderPathInput" }, "provenance": { "description": "Where the source came from, for the audit log.", "type": "object", "properties": { "client": { "type": "string", "enum": ["cli", "copilot", "canvas", "api"], "description": "What submitted the source." }, "gitSha": { "description": "The commit the source was taken from; recorded in the audit log.", "type": "string", "pattern": "^[0-9a-f]{7,64}$" }, "repo": { "type": "string", "minLength": 1, "maxLength": 512, "description": "The repository the source was taken from (its remote URL); recorded in the audit log." } }, "required": ["client"], "additionalProperties": false } }, "required": ["files"], "additionalProperties": false, "title": "Create workflow from source body", "description": "Source files and where to create the workflow." }, "GetSourceResourcesResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workspaceId": { "type": "string", "description": "Workspace id." }, "tables": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." }, "columns": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Column name, as row data names it." }, "type": { "type": "string", "enum": [ "string", "number", "currency", "boolean", "date", "json", "select" ], "description": "Column type, e.g. `string`, `number`, `boolean`, `json`, `select`." }, "options": { "description": "Option names a `select` column accepts, as table blocks read and write them.", "type": "array", "items": { "type": "string" } }, "multiple": { "description": "A `select` column whose cells hold several options.", "type": "boolean" }, "required": { "description": "Every row holds a value.", "type": "boolean" } }, "required": ["name", "type"], "additionalProperties": false }, "description": "Columns in table order." } }, "required": ["key", "id", "name", "columns"], "additionalProperties": false, "description": "A table: `table(key)`." }, "description": "Tables, oldest first." }, "knowledgeBases": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." } }, "required": ["key", "id", "name"], "additionalProperties": false, "description": "A knowledge base: `knowledgeBase(key)`." }, "description": "Knowledge bases, oldest first." }, "credentials": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." }, "provider": { "type": "string", "description": "The provider the credential is for, e.g. `slack` or `google-email`." } }, "required": ["key", "id", "name", "provider"], "additionalProperties": false, "description": "A saved credential: `credential(key)`." }, "description": "Saved credentials, oldest first. Secrets are listed under `env`." }, "workflows": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." }, "inputs": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "Input field name." }, "type": { "type": "string", "description": "Input field type, e.g. `string` or `number`." } }, "required": ["name", "type"], "additionalProperties": false }, "description": "Inputs the workflow start block declares." } }, "required": ["key", "id", "name", "inputs"], "additionalProperties": false, "description": "A workflow: `childWorkflow(key)`." }, "description": "Workflows, oldest first." }, "skills": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." } }, "required": ["key", "id", "name"], "additionalProperties": false, "description": "A workspace skill: `skill(key)`." }, "description": "Workspace skills, oldest first. Built-in skills have no key and are not listed." }, "customTools": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." } }, "required": ["key", "id", "name"], "additionalProperties": false, "description": "A workspace custom tool, by its title: `customTool(key)`." }, "description": "Workspace custom tools, oldest first." }, "mcpServers": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "The key workflow source names this resource by; it never changes once assigned." }, "id": { "type": "string", "description": "Resource id." }, "name": { "type": "string", "description": "Current display name." }, "tools": { "description": "Tool names the server listed, for `mcp(key).tool(name)`; absent when it could not be listed (unreachable, or not listable by this caller).", "type": "array", "items": { "type": "string" } } }, "required": ["key", "id", "name"], "additionalProperties": false, "description": "An MCP server the workspace consumes: `mcp(key)`." }, "description": "MCP servers, oldest first." }, "env": { "type": "array", "items": { "type": "string" }, "description": "Environment variable names a run can read as `env.NAME`: the workspace secrets and, for a user, their personal ones. Never values." }, "truncated": { "type": "boolean", "description": "True when a kind had more than 1000 resources; only the oldest 1000 of that kind are listed." } }, "required": [ "workspaceId", "tables", "knowledgeBases", "credentials", "workflows", "skills", "customTools", "mcpServers", "env", "truncated" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Get source resources response", "description": "The workspace resources workflow source can name.", "examples": [ { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "tables": [ { "key": "tickets", "id": "tbl_4f1c2a9e", "name": "Tickets", "columns": [ { "name": "subject", "type": "string" }, { "name": "status", "type": "select", "options": ["open", "closed"] } ] } ], "knowledgeBases": [ { "key": "docs", "id": "kb_93a1e7c2", "name": "Docs" } ], "credentials": [ { "key": "support-slack", "id": "cred_51d0b8f4", "name": "Support Slack", "provider": "slack" } ], "workflows": [ { "key": "assign-owner", "id": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", "name": "Assign owner", "inputs": [ { "name": "leads", "type": "array" } ] } ], "skills": [ { "key": "triage", "id": "skl_7e2a4c19", "name": "Triage" } ], "customTools": [ { "key": "lookup-order", "id": "ctl_2b8d6f03", "name": "lookup_order" } ], "mcpServers": [ { "key": "github", "id": "mcp-1a2b3c4d", "name": "GitHub", "tools": ["create_issue", "list_issues"] } ], "env": ["CRM_KEY"], "truncated": false } } ] }, "WorkspaceForkPreview": { "type": "object", "properties": { "previewFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "Fingerprint to submit when applying this preview with the same choices. Preview again after changing a choice." }, "sourceWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Canonical workspace the workflows and resources are copied from." }, "workflows": { "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "name": { "type": "string", "maxLength": 1024, "description": "Display name of the workflow or workspace." } }, "required": ["sourceWorkflowId", "name"], "additionalProperties": false }, "description": "Eligible workflows and their planned actions." }, "selectedResourceCount": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of resources explicitly selected for copying." }, "draftOnly": { "type": "boolean", "const": true, "description": "True because fork creation produces undeployed drafts." } }, "required": [ "previewFingerprint", "sourceWorkspaceId", "workflows", "selectedResourceCount", "draftOnly" ], "additionalProperties": false, "title": "Workspace fork preview", "description": "Read-only fork plan and fingerprint." }, "PreviewWorkspaceForkResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceForkPreview" } }, "required": ["data"], "additionalProperties": false, "title": "Preview workspace fork response", "description": "Deployed source workflows, selected-copy count, and a preview fingerprint.", "examples": [ { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "sourceWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "workflows": [], "selectedResourceCount": 0, "draftOnly": true } } ] }, "PreviewWorkspaceForkBody": { "type": "object", "properties": { "name": { "description": "Display name of the workflow or workspace.", "type": "string", "minLength": 1, "maxLength": 100 }, "copy": { "description": "Explicit resource selections to copy into the new fork; omitted resource kinds are not copied.", "type": "object", "properties": { "files": { "description": "Workspace file IDs to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "tables": { "description": "Source table identifiers whose schemas and rows are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "knowledgeBases": { "description": "Source knowledge base identifiers whose documents and content are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "customTools": { "description": "Source custom tool identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "skills": { "description": "Source skill identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "mcpServers": { "description": "External MCP server identifiers to copy; OAuth connections require authorization in the destination.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "workflowMcpServers": { "description": "Workflow-publishing MCP server identifiers to copy as empty configuration shells.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "additionalProperties": false } }, "additionalProperties": false, "title": "Preview workspace fork request", "description": "Optional child name and explicitly selected resource copies." }, "WorkspaceOperationReport": { "type": "object", "properties": { "operationId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Durable operation identifier to use for polling." }, "requestId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Client request ID used to commit this operation. Reuse identical mutation inputs with this ID after an uncertain response." }, "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." }, "kind": { "type": "string", "enum": ["workflow_import", "workspace_fork", "workspace_push", "workspace_pull"], "description": "Type of committed workspace operation." }, "applied": { "type": "boolean", "const": true, "description": "The business transaction committed, including when follow-up work fails." }, "status": { "type": "string", "enum": [ "processing", "completed", "completed_with_warnings", "requires_configuration", "failed" ], "description": "Operation status; failed follow-up work does not undo the committed transaction." }, "resourceIds": { "maxItems": 5000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 }, "description": "Identifiers of resources created or changed by the committed operation." }, "issues": { "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Stable machine-readable issue code." }, "message": { "type": "string", "maxLength": 2048, "description": "Human-readable explanation of the issue." }, "workflowId": { "description": "Workflow affected by this issue or deployment attempt.", "type": "string", "maxLength": 256 }, "blockId": { "description": "Source block identifier before graph ID regeneration.", "type": "string", "maxLength": 256 }, "subBlockKey": { "description": "Registered source field key, including the tool index for nested Agent fields.", "type": "string", "maxLength": 256 } }, "required": ["code", "message"], "additionalProperties": false }, "description": "Structured warnings, missing configuration, and follow-up failures." }, "idMap": { "description": "Source graph identifiers mapped to the imported identifiers.", "type": "object", "propertyNames": { "type": "string", "maxLength": 256 }, "additionalProperties": { "type": "string", "maxLength": 256 } }, "deploymentOperationIds": { "description": "Exact deployment attempts admitted by the workspace operation.", "maxItems": 1000, "type": "array", "items": { "type": "string", "maxLength": 256 } }, "deployments": { "description": "Readiness of the exact admitted deployment attempts.", "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "operationId": { "type": "string", "maxLength": 256, "description": "Durable operation identifier to use for polling." }, "workflowId": { "type": "string", "maxLength": 256, "description": "Workflow affected by this issue or deployment attempt." }, "version": { "type": "integer", "minimum": 1, "maximum": 9007199254740991, "description": "Deployment version number for this admitted attempt." }, "status": { "type": "string", "enum": ["preparing", "activating", "active", "failed", "superseded"], "description": "Status of this exact admitted deployment attempt." }, "ready": { "type": "boolean", "description": "Whether this exact deployment attempt is active and all required components are ready." }, "pendingComponents": { "maxItems": 32, "type": "array", "items": { "type": "string", "maxLength": 128 }, "description": "Deployment components that have not finished becoming ready." } }, "required": [ "operationId", "workflowId", "version", "status", "ready", "pendingComponents" ], "additionalProperties": false } }, "triggerUrlChanges": { "description": "Public trigger paths changed by this sync, with the affected workflow names.", "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "workflowName": { "type": "string", "maxLength": 1024, "description": "Name of the workflow whose public trigger path stops serving." }, "path": { "type": "string", "maxLength": 4096, "description": "Public trigger path that stops serving after this sync." } }, "required": ["workflowName", "path"], "additionalProperties": false } }, "backgroundWorkId": { "description": "Workspace activity identifier for resource-copy progress.", "type": "string", "maxLength": 256 }, "copyProgress": { "description": "Completion status and counts for explicitly selected resource copies.", "type": "object", "properties": { "status": { "type": "string", "enum": ["pending", "completed", "failed"], "description": "Background resource-copy status." }, "copied": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of resources copied successfully." }, "failed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of resources that failed to copy." } }, "required": ["status", "copied", "failed"], "additionalProperties": false } }, "required": [ "operationId", "requestId", "workspaceId", "kind", "applied", "status", "resourceIds", "issues" ], "additionalProperties": false, "title": "Workspace operation receipt", "description": "Committed operation receipt, resource copies, and exact deployment readiness." }, "ForkWorkspaceResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceOperationReport" } }, "required": ["data"], "additionalProperties": false, "title": "Fork workspace response", "description": "Committed fork receipt and resource-copy progress.", "examples": [ { "data": { "operationId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "requestId": "fork-support-2026-10-13", "workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "kind": "workspace_fork", "applied": true, "status": "processing", "resourceIds": ["destination_workflow_id"], "issues": [] } } ] }, "ForkWorkspaceBody": { "type": "object", "properties": { "name": { "description": "Display name of the workflow or workspace.", "type": "string", "minLength": 1, "maxLength": 100 }, "copy": { "description": "Explicit resource selections to copy into the new fork; omitted resource kinds are not copied.", "type": "object", "properties": { "files": { "description": "Workspace file IDs to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "tables": { "description": "Source table identifiers whose schemas and rows are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "knowledgeBases": { "description": "Source knowledge base identifiers whose documents and content are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "customTools": { "description": "Source custom tool identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "skills": { "description": "Source skill identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "mcpServers": { "description": "External MCP server identifiers to copy; OAuth connections require authorization in the destination.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "workflowMcpServers": { "description": "Workflow-publishing MCP server identifiers to copy as empty configuration shells.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "additionalProperties": false }, "requestId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Stable client request ID. Reuse it with identical inputs after an uncertain response; changed inputs return 409. A new ID can apply another operation." }, "previewFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "Fingerprint returned by a preview with the same choices. A changed plan returns 409; preview again. The example hash is illustrative; use the actual preview value." } }, "required": ["requestId", "previewFingerprint"], "additionalProperties": false, "title": "Fork workspace request", "description": "Child name and copy choices, with the actual preview fingerprint and a stable request ID.", "examples": [ { "name": "Support sandbox", "requestId": "fork-support-2026-10-13", "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a" } ] }, "WorkspaceSyncPreview": { "type": "object", "properties": { "previewFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "Fingerprint to submit when applying this preview with the same choices. Preview again after changing a choice." }, "sourceWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Canonical workspace the workflows and resources are copied from." }, "targetWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Canonical workspace receiving the changes." }, "ready": { "type": "boolean", "description": "Whether required bindings, configuration, and sync blockers are resolved. This does not mean the target is already deployed." }, "workflows": { "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "action": { "type": "string", "enum": ["create", "replace", "archive"], "description": "Planned workflow creation, replacement, or archival." }, "sourceWorkflowId": { "description": "Workflow identifier in the source workspace.", "type": "string", "minLength": 1 }, "targetWorkflowId": { "description": "Existing target workflow identifier; absent when apply will create a new target.", "type": "string", "minLength": 1 }, "name": { "type": "string", "maxLength": 1024, "description": "Display name of the workflow or workspace." }, "comparison": { "description": "Last successfully synced source deployment compared with the source deployment pinned by this preview. Absent for archive actions.", "oneOf": [ { "type": "object", "properties": { "status": { "type": "string", "const": "available", "description": "Both exact source snapshots are available." }, "base": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "Exact source deployment snapshot identifier." }, "version": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "Saved version number in the source workflow." } }, "required": ["id", "version"], "additionalProperties": false, "description": "Source deployment last successfully synced to this destination." }, "target": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "Exact source deployment snapshot identifier." }, "version": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "Saved version number in the source workflow." } }, "required": ["id", "version"], "additionalProperties": false, "description": "Pinned source deployment that this sync would copy." } }, "required": ["status", "base", "target"], "additionalProperties": false }, { "type": "object", "properties": { "status": { "type": "string", "const": "unavailable", "description": "The source baseline cannot be compared." }, "reason": { "type": "string", "enum": ["new_workflow", "no_baseline", "missing_baseline"], "description": "New destination workflow, no recorded successful sync, or deleted baseline snapshot." }, "target": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "Exact source deployment snapshot identifier." }, "version": { "type": "integer", "minimum": 1, "maximum": 2147483647, "description": "Saved version number in the source workflow." } }, "required": ["id", "version"], "additionalProperties": false, "description": "Pinned source deployment that this sync would copy." } }, "required": ["status", "reason", "target"], "additionalProperties": false } ] } }, "required": ["action", "name"], "additionalProperties": false }, "description": "Eligible workflows and their planned actions." }, "unresolvedBindings": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "maxLength": 256, "description": "Resource or operation kind." }, "sourceId": { "type": "string", "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "blockName": { "description": "Display name of the affected source block.", "type": "string", "maxLength": 1024 }, "reason": { "description": "Structured explanation of the unresolved binding.", "type": "string", "maxLength": 256 } }, "required": ["kind", "sourceId"], "additionalProperties": false }, "description": "Source references that still require destination mappings or explicit copy choices." }, "configuration": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "maxLength": 256, "description": "Block identifier in the source workflow." }, "subBlockKey": { "type": "string", "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "title": { "type": "string", "maxLength": 1024, "description": "Human-readable configuration field label." }, "required": { "type": "boolean", "description": "Whether the reference or configuration is required for this operation." }, "currentValue": { "type": "string", "maxLength": 65536, "description": "Persisted sync override or proposed override; empty when neither is configured." }, "multiSelect": { "description": "Whether the field accepts comma-separated selections.", "type": "boolean" }, "selectorKey": { "description": "Registered selector key for discovering this field’s options.", "type": "string", "maxLength": 256 }, "discoveryWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace scope for selector discovery: source for a parent being copied, otherwise destination." }, "context": { "type": "object", "propertyNames": { "type": "string", "maxLength": 256 }, "additionalProperties": { "type": "string", "maxLength": 4096 }, "description": "Allowlisted selector dependencies scoped to discoveryWorkspaceId." }, "parentKind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox" ], "description": "Resource kind that owns this dependent configuration." }, "parentSourceId": { "type": "string", "maxLength": 4096, "description": "Source identifier of the parent resource being mapped." }, "parentContextKey": { "description": "Selector context key supplied by the mapped parent resource.", "type": "string", "maxLength": 256 } }, "required": [ "sourceWorkflowId", "sourceBlockId", "subBlockKey", "title", "required", "currentValue", "discoveryWorkspaceId", "context", "parentKind", "parentSourceId" ], "additionalProperties": false }, "description": "Dependent fields that may need destination-specific values." }, "excludedTargets": { "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "description": "Resource identifier." }, "name": { "type": "string", "maxLength": 1024, "description": "Display name of the workflow or workspace." } }, "required": ["id", "name"], "additionalProperties": false }, "description": "Target workflows explicitly excluded from sync." }, "triggerSlots": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Stable source trigger block identifier to use in trigger mappings." }, "blockName": { "type": "string", "maxLength": 1024, "description": "Display name of the source trigger block." }, "workflowName": { "type": "string", "maxLength": 1024, "description": "Display name of the source workflow." }, "ownPath": { "anyOf": [ { "type": "string", "maxLength": 4096 }, { "type": "null" } ], "description": "Existing target trigger path, preserved automatically and not configurable." }, "adoptablePaths": { "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 4096 }, "description": "Retiring paths in the same target workflow with a compatible trigger provider." }, "defaultAdoptPath": { "anyOf": [ { "type": "string", "maxLength": 4096 }, { "type": "null" } ], "description": "Default adoption when ownPath is null; null then allocates a new path." } }, "required": [ "sourceWorkflowId", "sourceBlockId", "blockName", "workflowName", "ownPath", "adoptablePaths", "defaultAdoptPath" ], "additionalProperties": false }, "description": "Source triggers and the target paths available for explicit adoption choices." }, "triggerUrlChanges": { "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "workflowName": { "type": "string", "maxLength": 1024, "description": "Name of the affected workflow." }, "path": { "type": "string", "maxLength": 4096, "description": "Public trigger path that stops serving after this sync." } }, "required": ["workflowName", "path"], "additionalProperties": false }, "description": "Retiring target trigger URLs no arriving trigger adopts." } }, "required": [ "previewFingerprint", "sourceWorkspaceId", "targetWorkspaceId", "ready", "workflows", "unresolvedBindings", "configuration", "excludedTargets", "triggerSlots", "triggerUrlChanges" ], "additionalProperties": false, "title": "Workspace sync preview", "description": "Read-only sync actions, bindings, configuration, and trigger-path choices." }, "PreviewWorkspacePushResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceSyncPreview" } }, "required": ["data"], "additionalProperties": false, "title": "Preview workspace push response", "description": "Current-to-other workflow actions, required choices, and preview fingerprint.", "examples": [ { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "sourceWorkspaceId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "targetWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "ready": true, "workflows": [], "unresolvedBindings": [], "configuration": [], "excludedTargets": [], "triggerSlots": [], "triggerUrlChanges": [] } } ] }, "PreviewWorkspacePushBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." }, "mappings": { "description": "Proposed mapping entries addressed by resource type and `sourceId`. Preview does not save them; apply commits them with the sync.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "resourceType": { "type": "string", "enum": [ "oauth_credential", "service_account_credential", "env_var", "table", "knowledge_base", "file", "file_folder", "mcp_server", "custom_block", "custom_tool", "skill", "sandbox" ], "description": "Resource type stored on the canonical parent/child edge." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["resourceType", "sourceId", "targetId"], "additionalProperties": false } }, "dependentValues": { "description": "Destination-specific choices addressed by source workflow ID, source block ID, and field key. Omission keeps saved overrides; an explicit empty array clears them.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Block identifier in the source workflow." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "value": { "type": "string", "maxLength": 65536, "description": "Destination value for the registered dependent field." } }, "required": ["sourceWorkflowId", "sourceBlockId", "subBlockKey", "value"], "additionalProperties": false } }, "copyResources": { "description": "Explicit source resources to copy before syncing the workflows.", "type": "object", "properties": { "knowledgeBases": { "description": "Source knowledge base identifiers whose documents and content are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "tables": { "description": "Source table identifiers whose schemas and rows are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "customTools": { "description": "Source custom tool identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "skills": { "description": "Source skill identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "files": { "description": "Workspace file storage keys to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "mcpServers": { "description": "External MCP server identifiers to copy; OAuth connections require authorization in the destination.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "additionalProperties": false }, "dropReferences": { "description": "Source-deleted references explicitly acknowledged for removal; live source references cannot be dropped.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." } }, "required": ["kind", "sourceId"], "additionalProperties": false } }, "triggerMappings": { "description": "Public trigger path choices from preview.triggerSlots, addressed by source workflow and block IDs. Duplicate or unavailable choices are rejected.", "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source trigger block identifier from the sync preview." }, "adoptPath": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "An adoptable path offered for this trigger, or null to allocate a new path." } }, "required": ["sourceWorkflowId", "sourceBlockId", "adoptPath"], "additionalProperties": false } } }, "required": ["otherWorkspaceId"], "additionalProperties": false, "title": "Preview workspace push request", "description": "Other workspace and proposed source-to-target sync choices." }, "PushWorkspaceResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceOperationReport" } }, "required": ["data"], "additionalProperties": false, "title": "Push workspace response", "description": "Committed push receipt with copy and deployment readiness.", "examples": [ { "data": { "operationId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "requestId": "push-support-2026-10-13", "workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "kind": "workspace_push", "applied": true, "status": "processing", "resourceIds": ["destination_workflow_id"], "issues": [] } } ] }, "PushWorkspaceBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." }, "mappings": { "description": "Proposed mapping entries addressed by resource type and `sourceId`. Preview does not save them; apply commits them with the sync.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "resourceType": { "type": "string", "enum": [ "oauth_credential", "service_account_credential", "env_var", "table", "knowledge_base", "file", "file_folder", "mcp_server", "custom_block", "custom_tool", "skill", "sandbox" ], "description": "Resource type stored on the canonical parent/child edge." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["resourceType", "sourceId", "targetId"], "additionalProperties": false } }, "dependentValues": { "description": "Destination-specific choices addressed by source workflow ID, source block ID, and field key. Omission keeps saved overrides; an explicit empty array clears them.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Block identifier in the source workflow." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "value": { "type": "string", "maxLength": 65536, "description": "Destination value for the registered dependent field." } }, "required": ["sourceWorkflowId", "sourceBlockId", "subBlockKey", "value"], "additionalProperties": false } }, "copyResources": { "description": "Explicit source resources to copy before syncing the workflows.", "type": "object", "properties": { "knowledgeBases": { "description": "Source knowledge base identifiers whose documents and content are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "tables": { "description": "Source table identifiers whose schemas and rows are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "customTools": { "description": "Source custom tool identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "skills": { "description": "Source skill identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "files": { "description": "Workspace file storage keys to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "mcpServers": { "description": "External MCP server identifiers to copy; OAuth connections require authorization in the destination.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "additionalProperties": false }, "dropReferences": { "description": "Source-deleted references explicitly acknowledged for removal; live source references cannot be dropped.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." } }, "required": ["kind", "sourceId"], "additionalProperties": false } }, "triggerMappings": { "description": "Public trigger path choices from preview.triggerSlots, addressed by source workflow and block IDs. Duplicate or unavailable choices are rejected.", "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source trigger block identifier from the sync preview." }, "adoptPath": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "An adoptable path offered for this trigger, or null to allocate a new path." } }, "required": ["sourceWorkflowId", "sourceBlockId", "adoptPath"], "additionalProperties": false } }, "requestId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Stable client request ID. Reuse it with identical inputs after an uncertain response; changed inputs return 409. A new ID can apply another operation." }, "previewFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "Fingerprint returned by a preview with the same choices. A changed plan returns 409; preview again. The example hash is illustrative; use the actual preview value." }, "confirm": { "type": "boolean", "const": true, "description": "Confirm replacement of mapped target drafts and archival of mapped targets whose sources were deleted or archived." } }, "required": ["otherWorkspaceId", "requestId", "previewFingerprint", "confirm"], "additionalProperties": false, "title": "Push workspace request", "description": "Confirmed current-to-other choices, actual preview fingerprint, and stable request ID.", "examples": [ { "otherWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "requestId": "push-support-2026-10-13", "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "confirm": true } ] }, "PreviewWorkspacePullResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceSyncPreview" } }, "required": ["data"], "additionalProperties": false, "title": "Preview workspace pull response", "description": "Other-to-current workflow actions, required choices, and preview fingerprint.", "examples": [ { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "sourceWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "targetWorkspaceId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "ready": true, "workflows": [], "unresolvedBindings": [], "configuration": [], "excludedTargets": [], "triggerSlots": [], "triggerUrlChanges": [] } } ] }, "PreviewWorkspacePullBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." }, "mappings": { "description": "Proposed mapping entries addressed by resource type and `sourceId`. Preview does not save them; apply commits them with the sync.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "resourceType": { "type": "string", "enum": [ "oauth_credential", "service_account_credential", "env_var", "table", "knowledge_base", "file", "file_folder", "mcp_server", "custom_block", "custom_tool", "skill", "sandbox" ], "description": "Resource type stored on the canonical parent/child edge." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["resourceType", "sourceId", "targetId"], "additionalProperties": false } }, "dependentValues": { "description": "Destination-specific choices addressed by source workflow ID, source block ID, and field key. Omission keeps saved overrides; an explicit empty array clears them.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Block identifier in the source workflow." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "value": { "type": "string", "maxLength": 65536, "description": "Destination value for the registered dependent field." } }, "required": ["sourceWorkflowId", "sourceBlockId", "subBlockKey", "value"], "additionalProperties": false } }, "copyResources": { "description": "Explicit source resources to copy before syncing the workflows.", "type": "object", "properties": { "knowledgeBases": { "description": "Source knowledge base identifiers whose documents and content are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "tables": { "description": "Source table identifiers whose schemas and rows are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "customTools": { "description": "Source custom tool identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "skills": { "description": "Source skill identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "files": { "description": "Workspace file storage keys to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "mcpServers": { "description": "External MCP server identifiers to copy; OAuth connections require authorization in the destination.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "additionalProperties": false }, "dropReferences": { "description": "Source-deleted references explicitly acknowledged for removal; live source references cannot be dropped.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." } }, "required": ["kind", "sourceId"], "additionalProperties": false } }, "triggerMappings": { "description": "Public trigger path choices from preview.triggerSlots, addressed by source workflow and block IDs. Duplicate or unavailable choices are rejected.", "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source trigger block identifier from the sync preview." }, "adoptPath": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "An adoptable path offered for this trigger, or null to allocate a new path." } }, "required": ["sourceWorkflowId", "sourceBlockId", "adoptPath"], "additionalProperties": false } } }, "required": ["otherWorkspaceId"], "additionalProperties": false, "title": "Preview workspace pull request", "description": "Other workspace and proposed source-to-target sync choices." }, "PullWorkspaceResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceOperationReport" } }, "required": ["data"], "additionalProperties": false, "title": "Pull workspace response", "description": "Committed pull receipt with copy and deployment readiness.", "examples": [ { "data": { "operationId": "e4f8d2b6-9a1c-4e3d-8b7f-5c0a2d9e6f13", "requestId": "pull-support-2026-10-13", "workspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "kind": "workspace_pull", "applied": true, "status": "processing", "resourceIds": ["destination_workflow_id"], "issues": [] } } ] }, "PullWorkspaceBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." }, "mappings": { "description": "Proposed mapping entries addressed by resource type and `sourceId`. Preview does not save them; apply commits them with the sync.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "resourceType": { "type": "string", "enum": [ "oauth_credential", "service_account_credential", "env_var", "table", "knowledge_base", "file", "file_folder", "mcp_server", "custom_block", "custom_tool", "skill", "sandbox" ], "description": "Resource type stored on the canonical parent/child edge." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["resourceType", "sourceId", "targetId"], "additionalProperties": false } }, "dependentValues": { "description": "Destination-specific choices addressed by source workflow ID, source block ID, and field key. Omission keeps saved overrides; an explicit empty array clears them.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Block identifier in the source workflow." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "value": { "type": "string", "maxLength": 65536, "description": "Destination value for the registered dependent field." } }, "required": ["sourceWorkflowId", "sourceBlockId", "subBlockKey", "value"], "additionalProperties": false } }, "copyResources": { "description": "Explicit source resources to copy before syncing the workflows.", "type": "object", "properties": { "knowledgeBases": { "description": "Source knowledge base identifiers whose documents and content are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "tables": { "description": "Source table identifiers whose schemas and rows are copied.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "customTools": { "description": "Source custom tool identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "skills": { "description": "Source skill identifiers to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "files": { "description": "Workspace file storage keys to copy.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } }, "mcpServers": { "description": "External MCP server identifiers to copy; OAuth connections require authorization in the destination.", "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1 } } }, "additionalProperties": false }, "dropReferences": { "description": "Source-deleted references explicitly acknowledged for removal; live source references cannot be dropped.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." } }, "required": ["kind", "sourceId"], "additionalProperties": false } }, "triggerMappings": { "description": "Public trigger path choices from preview.triggerSlots, addressed by source workflow and block IDs. Duplicate or unavailable choices are rejected.", "maxItems": 500, "type": "array", "items": { "type": "object", "properties": { "sourceWorkflowId": { "type": "string", "minLength": 1, "description": "Workflow identifier in the source workspace." }, "sourceBlockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source trigger block identifier from the sync preview." }, "adoptPath": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "An adoptable path offered for this trigger, or null to allocate a new path." } }, "required": ["sourceWorkflowId", "sourceBlockId", "adoptPath"], "additionalProperties": false } }, "requestId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Stable client request ID. Reuse it with identical inputs after an uncertain response; changed inputs return 409. A new ID can apply another operation." }, "previewFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$", "description": "Fingerprint returned by a preview with the same choices. A changed plan returns 409; preview again. The example hash is illustrative; use the actual preview value." }, "confirm": { "type": "boolean", "const": true, "description": "Confirm replacement of mapped target drafts and archival of mapped targets whose sources were deleted or archived." } }, "required": ["otherWorkspaceId", "requestId", "previewFingerprint", "confirm"], "additionalProperties": false, "title": "Pull workspace request", "description": "Confirmed other-to-current choices, actual preview fingerprint, and stable request ID.", "examples": [ { "otherWorkspaceId": "9f4c2a10-3b7e-4d58-8f6a-2c1d0e5b7a94", "requestId": "pull-support-2026-10-13", "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "confirm": true } ] }, "GetWorkspaceForkAvailabilityResult": { "type": "object", "properties": { "available": { "type": "boolean", "description": "Whether this deployment and workspace plan enable forking." } }, "required": ["available"], "additionalProperties": false, "title": "Get workspace fork availability result", "description": "Fork feature availability for this workspace." }, "GetWorkspaceForkAvailabilityResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/GetWorkspaceForkAvailabilityResult" } }, "required": ["data"], "additionalProperties": false, "title": "Get workspace fork availability response", "description": "Whether forking is enabled for this deployment and workspace plan." }, "GetWorkspaceForkLineageResult": { "type": "object", "properties": { "current": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Resource identifier." }, "name": { "type": "string", "maxLength": 1024, "description": "Display name of the workflow or workspace." }, "organizationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Owning organization, or null for a personal workspace." } }, "required": ["id", "name", "organizationId"], "additionalProperties": false, "description": "The current workspace lineage node." }, "parent": { "anyOf": [ { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Resource identifier." }, "name": { "type": "string", "maxLength": 1024, "description": "Display name of the workflow or workspace." }, "organizationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Owning organization, or null for a personal workspace." } }, "required": ["id", "name", "organizationId"], "additionalProperties": false }, { "type": "null" } ], "description": "The live parent workspace, or null when this workspace is not a fork." } }, "required": ["current", "parent"], "additionalProperties": false, "title": "Get workspace fork lineage result", "description": "Current workspace and its active parent." }, "GetWorkspaceForkLineageResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/GetWorkspaceForkLineageResult" } }, "required": ["data"], "additionalProperties": false, "title": "Get workspace fork lineage response", "description": "Current workspace and its active direct parent, when present." }, "ListWorkspaceForkChildrenResult": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Resource identifier." }, "name": { "type": "string", "maxLength": 1024, "description": "Display name of the workflow or workspace." }, "organizationId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "description": "Owning organization, or null for a personal workspace." }, "createdAt": { "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 creation timestamp." } }, "required": ["id", "name", "organizationId", "createdAt"], "additionalProperties": false, "title": "List workspace fork children result", "description": "An active direct child workspace." }, "ListWorkspaceForkChildrenResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ListWorkspaceForkChildrenResult" }, "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 are no more pages. Do not construct a cursor yourself." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "List workspace fork children response", "description": "A page of active direct child workspaces." }, "ListWorkspaceForkResourcesResult": { "type": "object", "properties": { "id": { "type": "string", "maxLength": 4096, "description": "Resource identifier." }, "label": { "type": "string", "maxLength": 1024, "description": "Human-readable resource label." }, "folderId": { "description": "Containing folder identifier, or null at the workspace root.", "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "folderName": { "description": "Containing folder name, or null at the workspace root.", "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": ["id", "label"], "additionalProperties": false, "title": "List workspace fork resources result", "description": "A copyable resource candidate." }, "ListWorkspaceForkResourcesResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/ListWorkspaceForkResourcesResult" }, "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 are no more pages. Do not construct a cursor yourself." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "List workspace fork resources response", "description": "A page of copyable resource candidates." }, "GetWorkspaceForkMappingsResult": { "type": "object", "properties": { "resourceType": { "type": "string", "enum": [ "oauth_credential", "service_account_credential", "env_var", "table", "knowledge_base", "file", "file_folder", "mcp_server", "custom_block", "custom_tool", "skill", "sandbox" ], "description": "Resource type stored on the canonical parent/child edge." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." }, "id": { "type": "string", "maxLength": 256, "description": "Resource identifier." } }, "required": ["resourceType", "sourceId", "targetId", "id"], "additionalProperties": false, "title": "Get workspace fork mappings result", "description": "A saved directional mapping entry." }, "GetWorkspaceForkMappingsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/GetWorkspaceForkMappingsResult" }, "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 are no more pages. Do not construct a cursor yourself." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "Get workspace fork mappings response", "description": "A page of persisted source-to-target mapping entries." }, "UpdateWorkspaceForkMappingsResult": { "type": "object", "properties": { "updated": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of records changed." } }, "required": ["updated"], "additionalProperties": false, "title": "Update workspace fork mappings result", "description": "Count of changed mapping records." }, "UpdateWorkspaceForkMappingsResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/UpdateWorkspaceForkMappingsResult" } }, "required": ["data"], "additionalProperties": false, "title": "Update workspace fork mappings response", "description": "Number of mapping records changed." }, "UpdateWorkspaceForkMappingsBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." }, "direction": { "type": "string", "enum": ["push", "pull"], "description": "Push means current to other; pull means other to current, independent of parent/child orientation." }, "mappings": { "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "resourceType": { "type": "string", "enum": [ "oauth_credential", "service_account_credential", "env_var", "table", "knowledge_base", "file", "file_folder", "mcp_server", "custom_block", "custom_tool", "skill", "sandbox" ], "description": "Resource type stored on the canonical parent/child edge." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Source resource identifier in the canonical source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["resourceType", "sourceId", "targetId"], "additionalProperties": false }, "description": "Mapping entries addressed by resource type and `sourceId`. `targetId: null` clears a mapping." } }, "required": ["otherWorkspaceId", "direction", "mappings"], "additionalProperties": false, "title": "Update workspace fork mappings request", "description": "Other workspace, direction, and mapping entries to update." }, "RollbackWorkspaceForkResult": { "type": "object", "properties": { "restored": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Workflows restored to their prior deployed version." }, "archived": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Workflows created by the sync and now archived." }, "unarchived": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Previously archived workflows restored by rollback." }, "skipped": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Snapshot workflows no longer available to restore." }, "pendingActivations": { "maxItems": 1000, "type": "array", "items": { "type": "string", "maxLength": 256 }, "description": "Workflows whose restored deployment is still activating." } }, "required": ["restored", "archived", "unarchived", "skipped", "pendingActivations"], "additionalProperties": false, "title": "Rollback workspace fork result", "description": "Workflow restoration and pending-activation counts." }, "RollbackWorkspaceForkResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/RollbackWorkspaceForkResult" } }, "required": ["data"], "additionalProperties": false, "title": "Rollback workspace fork response", "description": "Restored, archived, skipped, and still-activating workflow counts." }, "RollbackWorkspaceForkBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." } }, "required": ["otherWorkspaceId"], "additionalProperties": false, "title": "Rollback workspace fork request", "description": "Other workspace whose latest inbound sync should be undone." }, "UnlinkWorkspaceForkResult": { "type": "object", "properties": { "unlinked": { "type": "boolean", "description": "Whether the fork edge was removed." } }, "required": ["unlinked"], "additionalProperties": false, "title": "Unlink workspace fork result", "description": "Fork-edge removal acknowledgment." }, "UnlinkWorkspaceForkResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/UnlinkWorkspaceForkResult" } }, "required": ["data"], "additionalProperties": false, "title": "Unlink workspace fork response", "description": "Confirmation that the relationship was removed." }, "UnlinkWorkspaceForkBody": { "type": "object", "properties": { "otherWorkspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Workspace on the other side of the direct fork edge." } }, "required": ["otherWorkspaceId"], "additionalProperties": false, "title": "Unlink workspace fork request", "description": "Other workspace on the direct fork edge to remove." }, "UpdateWorkspaceForkExclusionsResult": { "type": "object", "properties": { "updated": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "Number of records changed." } }, "required": ["updated"], "additionalProperties": false, "title": "Update workspace fork exclusions result", "description": "Count of changed workflow exclusion flags." }, "UpdateWorkspaceForkExclusionsResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/UpdateWorkspaceForkExclusionsResult" } }, "required": ["data"], "additionalProperties": false, "title": "Update workspace fork exclusions response", "description": "Number of workflow exclusion flags changed." }, "UpdateWorkspaceForkExclusionsBody": { "type": "object", "properties": { "workflowIds": { "minItems": 1, "maxItems": 1000, "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Workflow identifiers in the current workspace." }, "forkSyncExcluded": { "type": "boolean", "description": "Whether the named workflows should be skipped as sync sources and targets." } }, "required": ["workflowIds", "forkSyncExcluded"], "additionalProperties": false, "title": "Update workspace fork exclusions request", "description": "Workflow IDs and whether to exclude them from sync." }, "PreviewWorkflowImportResult": { "type": "object", "properties": { "previewFingerprint": { "type": "string", "minLength": 64, "maxLength": 64, "description": "Fingerprint to send when applying this import with the same choices. Preview again after changing any choice." }, "ready": { "type": "boolean", "description": "Whether every required destination binding and configuration field is resolved for import." }, "bindings": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "maxLength": 4096, "description": "Untrusted source reference label; imports never use it to authorize or query a source workspace." }, "targetId": { "anyOf": [ { "type": "string", "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." }, "required": { "type": "boolean", "description": "Whether the reference or configuration is required for this operation." }, "occurrence": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "valuePath": { "maxItems": 8, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "integer", "minimum": 0, "maximum": 2000 } ] }, "description": "Path within the field value; strings address properties and numbers address array entries." }, "positions": { "description": "Positions occupied by this identifier in a multi-value field.", "maxItems": 2000, "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 2000 } }, "encoding": { "type": "string", "enum": ["scalar", "array", "csv", "files", "environment"], "description": "Registered encoding used to discover and rewrite the reference." } }, "required": ["blockId", "subBlockKey", "valuePath", "encoding"], "additionalProperties": false, "description": "Registered source field occurrence addressed by this binding." } }, "required": ["kind", "sourceId", "targetId", "required", "occurrence"], "additionalProperties": false }, "description": "Resolved and unresolved source occurrences with their destination selections." }, "unresolvedBindings": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "maxLength": 4096, "description": "Untrusted source reference label; imports never use it to authorize or query a source workspace." }, "targetId": { "anyOf": [ { "type": "string", "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." }, "required": { "type": "boolean", "description": "Whether the reference or configuration is required for this operation." }, "occurrence": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "valuePath": { "maxItems": 8, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "integer", "minimum": 0, "maximum": 2000 } ] }, "description": "Path within the field value; strings address properties and numbers address array entries." }, "positions": { "description": "Positions occupied by this identifier in a multi-value field.", "maxItems": 2000, "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 2000 } }, "encoding": { "type": "string", "enum": ["scalar", "array", "csv", "files", "environment"], "description": "Registered encoding used to discover and rewrite the reference." } }, "required": ["blockId", "subBlockKey", "valuePath", "encoding"], "additionalProperties": false, "description": "Registered source field occurrence addressed by this binding." } }, "required": ["kind", "sourceId", "targetId", "required", "occurrence"], "additionalProperties": false }, "description": "Source references that still require destination mappings or explicit copy choices." }, "configuration": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "title": { "type": "string", "maxLength": 1024, "description": "Human-readable configuration field label." }, "required": { "type": "boolean", "description": "Whether the reference or configuration is required for this operation." }, "configured": { "type": "boolean", "description": "Whether this destination field currently has a nonempty value." }, "multiSelect": { "description": "Whether the field accepts comma-separated selections.", "type": "boolean" }, "selectorKey": { "description": "Registered selector key for discovering this field’s destination options.", "type": "string", "maxLength": 256 }, "context": { "type": "object", "propertyNames": { "type": "string", "maxLength": 256 }, "additionalProperties": { "type": "string", "maxLength": 16384 }, "description": "Allowlisted selector dependencies scoped to the destination workspace." }, "requiresAuthentication": { "type": "boolean", "description": "Whether a human must connect the provider before choices can be discovered." } }, "required": [ "blockId", "subBlockKey", "title", "required", "configured", "context", "requiresAuthentication" ], "additionalProperties": false }, "description": "Dependent fields that may need destination-specific values." }, "unresolvedConfiguration": { "maxItems": 10000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Registered source field key, including the tool index for nested Agent fields." }, "title": { "type": "string", "maxLength": 1024, "description": "Human-readable configuration field label." }, "required": { "type": "boolean", "description": "Whether the reference or configuration is required for this operation." }, "configured": { "type": "boolean", "description": "Whether this destination field currently has a nonempty value." }, "multiSelect": { "description": "Whether the field accepts comma-separated selections.", "type": "boolean" }, "selectorKey": { "description": "Registered selector key for discovering this field’s destination options.", "type": "string", "maxLength": 256 }, "context": { "type": "object", "propertyNames": { "type": "string", "maxLength": 256 }, "additionalProperties": { "type": "string", "maxLength": 16384 }, "description": "Allowlisted selector dependencies scoped to the destination workspace." }, "requiresAuthentication": { "type": "boolean", "description": "Whether a human must connect the provider before choices can be discovered." } }, "required": [ "blockId", "subBlockKey", "title", "required", "configured", "context", "requiresAuthentication" ], "additionalProperties": false }, "description": "Required destination configuration that remains empty." }, "discovery": { "maxItems": 32, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "maxLength": 256, "description": "Resource or operation kind." }, "command": { "type": "string", "maxLength": 1024, "description": "CLI command to enumerate destination candidates." }, "humanAuthorizationMayBeRequired": { "type": "boolean", "description": "Whether discovery may require a human OAuth authorization step." } }, "required": ["kind", "command", "humanAuthorizationMayBeRequired"], "additionalProperties": false }, "description": "CLI operations for discovering suitable destination resources." } }, "required": [ "previewFingerprint", "ready", "bindings", "unresolvedBindings", "configuration", "unresolvedConfiguration", "discovery" ], "additionalProperties": false, "title": "Workflow import preview", "description": "Import readiness, unresolved bindings, and destination discovery instructions." }, "PreviewWorkflowImportResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/PreviewWorkflowImportResult" } }, "required": ["data"], "additionalProperties": false, "title": "Preview workflow import response", "description": "Import readiness, unresolved bindings, and destination discovery instructions.", "examples": [ { "data": { "previewFingerprint": "c7d158e8cbc5137a2d0a4fc37ddaeb51a3b9757485679a6ad82a7de3fdac4e3a", "ready": true, "bindings": [], "unresolvedBindings": [], "configuration": [], "unresolvedConfiguration": [], "discovery": [] } } ] }, "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 }, "mappings": { "description": "Mapping entries addressed by resource kind and source identifier.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "sourceId": { "type": "string", "minLength": 1, "maxLength": 4096, "description": "Untrusted source reference label; imports never use it to authorize or query a source workspace." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["kind", "sourceId", "targetId"], "additionalProperties": false } }, "bindings": { "description": "Resolved and unresolved source occurrences with their destination selections.", "maxItems": 5000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "valuePath": { "default": [], "maxItems": 8, "type": "array", "items": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 256 }, { "type": "integer", "minimum": 0, "maximum": 2000 } ] }, "description": "Path within the field value; strings address properties and numbers address array entries." }, "positions": { "description": "Positions occupied by this identifier in a multi-value field.", "maxItems": 2000, "type": "array", "items": { "type": "integer", "minimum": 0, "maximum": 2000 } }, "encoding": { "default": "scalar", "type": "string", "enum": ["scalar", "array", "csv", "files", "environment"], "description": "Registered encoding used to discover and rewrite the reference." }, "kind": { "type": "string", "enum": [ "credential", "env-var", "knowledge-base", "knowledge-document", "table", "file", "file-folder", "mcp-server", "custom-tool", "custom-block", "skill", "sandbox", "workflow" ], "description": "Resource or operation kind." }, "targetId": { "anyOf": [ { "type": "string", "minLength": 1, "maxLength": 4096 }, { "type": "null" } ], "description": "Authorized destination identifier, or null to clear the mapping." } }, "required": ["blockId", "subBlockKey", "kind", "targetId"], "additionalProperties": false } }, "dependentValues": { "description": "Destination-specific values addressed by the source block ID and field key, before imported IDs are regenerated.", "maxItems": 2000, "type": "array", "items": { "type": "object", "properties": { "blockId": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Source block identifier before graph ID regeneration." }, "subBlockKey": { "type": "string", "minLength": 1, "maxLength": 256, "description": "Registered source field key, including the tool index for nested Agent fields." }, "value": { "type": "string", "maxLength": 16384, "description": "Destination value for the registered dependent field." } }, "required": ["blockId", "subBlockKey", "value"], "additionalProperties": false } } }, "required": ["workspaceId", "workflow"], "additionalProperties": false, "title": "Import workflow request", "description": "Portable workflow data and destination metadata for an import." }, "SelectorOption": { "type": "object", "properties": { "id": { "type": "string", "minLength": 1, "maxLength": 16384, "description": "Provider resource identifier." }, "label": { "type": "string", "minLength": 1, "maxLength": 16384, "description": "Human-readable provider resource name." }, "meta": { "description": "Safe scalar metadata for presenting or configuring this choice.", "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 128 }, "additionalProperties": { "anyOf": [ { "type": "string", "maxLength": 16384 }, { "type": "number" }, { "type": "boolean" }, { "type": "null" } ] } } }, "required": ["id", "label"], "additionalProperties": false, "title": "SelectorOption", "description": "The SelectorOption result." }, "ListSelectorResponse": { "type": "object", "properties": { "data": { "maxItems": 100, "type": "array", "items": { "$ref": "#/components/schemas/SelectorOption" }, "description": "Authorized provider options in this page." }, "nextCursor": { "anyOf": [ { "type": "string", "maxLength": 32768 }, { "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." }, "truncated": { "type": "boolean", "description": "Whether provider limits left the result incomplete. A null `nextCursor` with `truncated: true` does not establish that all options were searched." } }, "required": ["data", "nextCursor", "truncated"], "additionalProperties": false, "title": "List selector response", "description": "A page of authorized options, continuation cursor, and truncation status." }, "ListSelectorBody": { "type": "object", "properties": { "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." }, "selectorKey": { "type": "string", "enum": [ "airtable.bases", "airtable.tables", "asana.workspaces", "attio.lists", "attio.objects", "bigquery.datasets", "bigquery.tables", "bitbucket.workspaces", "bitbucket.repositories", "calcom.eventTypes", "calcom.schedules", "clickup.workspaces", "clickup.spaces", "clickup.folders", "clickup.lists", "coda.docs", "coda.pages", "coda.tables", "coda.columns", "coda.rows", "coda.formulas", "coda.controls", "coda.folders", "coda.permissions", "confluence.spaces", "confluence.spacesById", "confluence.pages", "google.tasks.lists", "gauge.organizations", "gauge.categories", "gauge.topics", "gauge.prompts", "gauge.tags", "gauge.answers", "fivetran.groups", "fivetran.connections", "gmail.labels", "google.calendar", "google.drive", "google.sheets", "harmonic.savedSearches", "jama.projects", "jama.itemTypes", "flow.projects", "flow.categories", "flow.branches", "helpscout.mailboxes", "helpscout.assignees", "hubspot.lists", "hubspot.owners", "hubspot.pipelines", "hubspot.pipelineStages", "hubspot.properties", "jsm.requestTypes", "jsm.serviceDesks", "microsoft.planner.plans", "notion.databases", "notion.pages", "netsuite.recordTypes", "netsuite.asyncTasks", "pipedrive.pipelines", "sharepoint.lists", "trello.boards", "zoho_desk.organizations", "zoho_desk.departments", "zoho_desk.agents", "zoom.meetings", "slack.channels", "snowflake.databases", "snowflake.schemas", "snowflake.tables", "snowflake.warehouses", "snowflake.roles", "snowflake.fileFormats", "snowflake.procedures", "slack.users", "outlook.folders", "outlook.calendars", "microsoft.teams", "microsoft.chats", "microsoft.channels", "microsoft.planner", "onedrive.files", "onedrive.folders", "sharepoint.sites", "microsoft.excel", "microsoft.excel.drives", "microsoft.excel.sheets", "microsoft.word", "wealthbox.contacts", "jira.issues", "jira.projects", "jira.projectKeys", "linear.projects", "linear.teams", "monday.boards", "monday.groups", "webflow.sites", "webflow.collections", "webflow.items", "planetscale.databases", "powerbi.workspaces", "powerbi.datasets", "powerbi.reports", "planetscale.branches", "planetscale.backups", "planetscale.deployRequests", "planetscale.savedDatabases", "planetscale.savedBranches", "planetscale.savedBackups", "planetscale.savedDeployRequests", "cloudwatch.logGroups", "cloudwatch.logStreams", "cloudwatch.savedLogGroups", "cloudwatch.savedLogStreams", "imap.mailboxes", "mcp.tools", "managedAgent.agents", "managedAgent.environments", "managedAgent.vaults", "managedAgent.memoryStores", "knowledge.documents", "sim.workflows", "table.columns", "table.outputColumns", "workspace.secretNames", "workspace.sandboxes", "providers.ollamaEmbeddingModels", "providers.openrouterEmbeddingModels" ], "description": "Registered selector key from an import or sync preview, such as `gmail.labels`." }, "context": { "default": {}, "description": "Only the dependencies declared by the selector, such as oauthCredential and channelId. Missing OAuth connections require human authorization.", "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 64 }, "additionalProperties": { "type": "string", "maxLength": 16384 } }, "search": { "description": "Provider option search text.", "type": "string", "minLength": 1, "maxLength": 1024 }, "cursor": { "description": "Cursor returned by the preceding page. Keep `workspaceId`, `selectorKey`, `context`, and `search` unchanged; only `limit` may change. Restart without a cursor after a changed-page 409.", "type": "string", "minLength": 1, "maxLength": 32768 }, "limit": { "default": 50, "description": "Maximum options per page, from 1 to 100. Defaults to 50.", "type": "integer", "minimum": 1, "maximum": 100 } }, "required": ["workspaceId", "selectorKey"], "additionalProperties": false, "title": "List selector request", "description": "Workspace, registered selector key, context, and optional search/cursor." }, "GetSelectorResponse": { "type": "object", "properties": { "data": { "anyOf": [ { "$ref": "#/components/schemas/SelectorOption" }, { "type": "null" } ], "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Get selector response", "description": "The authorized option, or data:null when absent from complete results." }, "GetSelectorBody": { "type": "object", "properties": { "workspaceId": { "type": "string", "minLength": 1, "maxLength": 128, "description": "Explicit current workspace scope." }, "selectorKey": { "type": "string", "enum": [ "airtable.bases", "airtable.tables", "asana.workspaces", "attio.lists", "attio.objects", "bigquery.datasets", "bigquery.tables", "bitbucket.workspaces", "bitbucket.repositories", "calcom.eventTypes", "calcom.schedules", "clickup.workspaces", "clickup.spaces", "clickup.folders", "clickup.lists", "coda.docs", "coda.pages", "coda.tables", "coda.columns", "coda.rows", "coda.formulas", "coda.controls", "coda.folders", "coda.permissions", "confluence.spaces", "confluence.spacesById", "confluence.pages", "google.tasks.lists", "gauge.organizations", "gauge.categories", "gauge.topics", "gauge.prompts", "gauge.tags", "gauge.answers", "fivetran.groups", "fivetran.connections", "gmail.labels", "google.calendar", "google.drive", "google.sheets", "harmonic.savedSearches", "jama.projects", "jama.itemTypes", "flow.projects", "flow.categories", "flow.branches", "helpscout.mailboxes", "helpscout.assignees", "hubspot.lists", "hubspot.owners", "hubspot.pipelines", "hubspot.pipelineStages", "hubspot.properties", "jsm.requestTypes", "jsm.serviceDesks", "microsoft.planner.plans", "notion.databases", "notion.pages", "netsuite.recordTypes", "netsuite.asyncTasks", "pipedrive.pipelines", "sharepoint.lists", "trello.boards", "zoho_desk.organizations", "zoho_desk.departments", "zoho_desk.agents", "zoom.meetings", "slack.channels", "snowflake.databases", "snowflake.schemas", "snowflake.tables", "snowflake.warehouses", "snowflake.roles", "snowflake.fileFormats", "snowflake.procedures", "slack.users", "outlook.folders", "outlook.calendars", "microsoft.teams", "microsoft.chats", "microsoft.channels", "microsoft.planner", "onedrive.files", "onedrive.folders", "sharepoint.sites", "microsoft.excel", "microsoft.excel.drives", "microsoft.excel.sheets", "microsoft.word", "wealthbox.contacts", "jira.issues", "jira.projects", "jira.projectKeys", "linear.projects", "linear.teams", "monday.boards", "monday.groups", "webflow.sites", "webflow.collections", "webflow.items", "planetscale.databases", "powerbi.workspaces", "powerbi.datasets", "powerbi.reports", "planetscale.branches", "planetscale.backups", "planetscale.deployRequests", "planetscale.savedDatabases", "planetscale.savedBranches", "planetscale.savedBackups", "planetscale.savedDeployRequests", "cloudwatch.logGroups", "cloudwatch.logStreams", "cloudwatch.savedLogGroups", "cloudwatch.savedLogStreams", "imap.mailboxes", "mcp.tools", "managedAgent.agents", "managedAgent.environments", "managedAgent.vaults", "managedAgent.memoryStores", "knowledge.documents", "sim.workflows", "table.columns", "table.outputColumns", "workspace.secretNames", "workspace.sandboxes", "providers.ollamaEmbeddingModels", "providers.openrouterEmbeddingModels" ], "description": "Registered selector key from an import or sync preview, such as `gmail.labels`." }, "context": { "default": {}, "description": "Only the dependencies declared by the selector, such as oauthCredential and channelId. Missing OAuth connections require human authorization.", "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 64 }, "additionalProperties": { "type": "string", "maxLength": 16384 } }, "id": { "type": "string", "minLength": 1, "maxLength": 16384, "description": "Provider option ID to resolve with the same selector and declared context." } }, "required": ["workspaceId", "selectorKey", "id"], "additionalProperties": false, "title": "Get selector request", "description": "Workspace, registered selector key, context, and provider option ID." }, "GetWorkspaceOperationResponse": { "type": "object", "properties": { "data": { "description": "Response data.", "$ref": "#/components/schemas/WorkspaceOperationReport" } }, "required": ["data"], "additionalProperties": false, "title": "Get workspace operation response", "description": "Refreshed commit, copy progress, and exact deployment readiness." }, "ListWorkspaceOperationsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/WorkspaceOperationReport" }, "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 are no more pages. Do not construct a cursor yourself." } }, "required": ["data", "nextCursor"], "additionalProperties": false, "title": "List workspace operations response", "description": "A page of stored operation receipts." }, "GetWorkspaceSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workspaceId": { "type": "string", "description": "Workspace id." }, "kinds": { "type": "array", "items": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "description": "The kinds read; the directory manages exactly these." }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Directory path → file text." }, "blobs": { "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Directory path of the binary file." }, "sha256": { "description": "Absent when the server did not hash the bytes within the request; hash the downloaded bytes and record them in the base with `id` and `rev`.", "type": "string", "pattern": "^[0-9a-f]{64}$" }, "size": { "type": "integer", "minimum": 0, "maximum": 10000000, "description": "Bytes." }, "id": { "type": "string", "description": "Stored id of the binary file." }, "href": { "type": "string", "description": "Where to download its bytes." }, "rev": { "description": "Content revision, present when `sha256` is absent.", "type": "string" } }, "required": ["path", "size", "id", "href"], "additionalProperties": false }, "description": "Binary files, downloaded separately by `href`." }, "base": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Base format version." }, "workspaceId": { "type": "string", "description": "Workspace the directory was read from." }, "resources": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id the key is bound to." }, "fingerprint": { "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.", "type": "string" }, "columns": { "description": "Table column key → stored column.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored column id." }, "options": { "description": "Select option name → option id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["id"], "additionalProperties": false } }, "blobs": { "description": "Binary file name → its stored id, revision and hash as last read.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id of the binary file." }, "rev": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ], "description": "Content revision as last read." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." } }, "required": ["id", "rev", "sha256"], "additionalProperties": false } }, "rows": { "description": "A table’s managed rows, as last read.", "type": "object", "properties": { "fingerprint": { "type": "string", "description": "`rf1:` fingerprint of the managed rows as last read." }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The table’s row version as last read; it moves on every row write." } }, "required": ["fingerprint", "version"], "additionalProperties": { "description": "An `x-` extension field, kept as written." } } }, "required": ["id"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "One resource in the base." }, "description": "`kind:key` → the stored resource and its fingerprint." } }, "required": ["version", "workspaceId", "resources"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "`.sim/base.json`: per resource, the id and fingerprint the directory was read at. Apply compares it with the server to tell a local edit from a server change." }, "skipped": { "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "reason": { "type": "string", "description": "Why it was left out." } }, "required": ["kind", "key", "reason"], "additionalProperties": false }, "description": "Resources left out, with why: too large to read as source, not readable by the caller, or past the directory's declaration or binary-file budget." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_DECL_SYNTAX", "E_DECL_HEADER", "E_DECL_IMPORT", "E_DECL_EXPORT", "E_DECL_UNSUPPORTED", "E_DECL_DUPLICATE_KEY", "E_DECL_SHAPE", "E_DECL_UNKNOWN_FIELD", "E_DECL_UNKNOWN_FILE", "W_PATH_NOT_SENT", "E_BLOB_MANIFEST", "E_BLOB_MISSING", "E_KEY_INVALID", "W_DECL_SUSPICIOUS_CHARACTER", "E_BASE_JSON", "E_BASE_VERSION", "E_BASE_SHAPE", "E_BASE_UNKNOWN_FIELD", "E_SECRET_NAME", "E_SECRET_MISSING", "W_SECRET_MISSING", "E_CREDENTIAL_MISSING", "E_CREDENTIAL_AMBIGUOUS", "W_CREDENTIAL_MISSING", "W_CREDENTIAL_AMBIGUOUS", "E_TABLE_COLUMN_NAME", "E_TABLE_DUPLICATE_COLUMN", "E_TABLE_TOO_MANY_COLUMNS", "E_TABLE_OPTIONS", "E_TABLE_TYPE_CONVERSION", "E_TABLE_FOLDER", "E_TABLE_ROWS", "I_TABLE_SEED_SKIPPED", "I_TABLE_ROWS_UNKEYED", "W_LIKELY_RENAME", "E_TOOL_SCHEMA", "E_TOOL_CODE", "E_TOOL_STORED_MISSING", "W_TOOL_LITERAL_SECRET", "E_SKILL_FRONTMATTER", "E_MCP_LITERAL_SECRET", "E_MCP_STORED_MISSING", "E_MCP_TOOL_UNKNOWN", "W_MCP_REPLACE", "W_MCP_TOOLS_UNCHECKED", "E_FILE_PATH", "E_FILE_PATH_COLLISION", "E_FILE_NAME", "E_FILE_TOO_LARGE", "E_FILE_CONTENT", "E_KB_EMBEDDING_IMMUTABLE", "E_KB_EMBEDDING_MODEL", "E_KB_DOC_AMBIGUOUS", "E_KB_DOC_NAME", "E_KB_DOC_EMPTY", "E_KB_CHUNKING", "E_KB_FOLDER", "W_KB_DOC_UNCHECKED", "W_KB_DOC_FAILED", "I_KB_REEMBED", "I_KB_CHUNKING", "I_KB_PROCESSING", "I_KB_DOCS_UNHASHED", "I_KB_UNMANAGED_DOCS", "I_KB_REPLACE_UNFINISHED", "E_DEPLOY_WORKFLOW", "E_DEPLOY_SECRET", "E_DEPLOY_CHAT_OUTPUT", "E_DEPLOY_CHAT_IDENTIFIER", "E_DEPLOY_PINNED_CHAT", "W_DEPLOYED_DRAFT_CHANGED", "W_DEPLOY_DRAFT_NOT_SOURCE", "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT", "I_DEPLOY_DRAFT_NOT_LIVE", "E_APPLY_NO_BASE", "E_APPLY_FORBIDDEN", "E_APPLY_DELETE_NOT_ALLOWED", "E_APPLY_LOCKED", "E_APPLY_REFUSED", "E_APPLY_FAILED", "E_PLAN_TOO_LARGE", "E_PLAN_REF_DELETED", "E_PLAN_REF_HELD", "W_RESOURCE_IN_USE", "W_TABLE_COLUMN_RENAMED_IN_USE", "E_WORKFLOW_FILES_MISSING", "E_WORKFLOW_FOLDER_COPIED", "W_UNDECLARED", "W_BASE_OTHER_WORKSPACE", "W_PROMOTE_TARGET_DELETED", "W_PROMOTE_DELETES_TARGET_ONLY", "W_SERVER_CHANGED", "W_SERVER_DELETED", "W_SERVER_MOVED", "I_KEY_REBOUND", "E_KEY_RENAMED", "E_APPLY_STALE", "E_LIMIT_EXCEEDED", "E_NAME_TAKEN", "I_FINDINGS_TRUNCATED", "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "file": { "description": "Directory file the finding is in.", "type": "string" }, "line": { "description": "1-based line in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "column": { "description": "1-based column in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endLine": { "description": "1-based line the finding ends on.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endColumn": { "description": "1-based column the finding ends at.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "frame": { "description": "The source lines around the finding, with a caret row.", "type": "string" }, "path": { "description": "JSON Pointer into a JSON file, such as the base.", "type": "string" }, "kind": { "description": "Kind of the resource the finding is about.", "type": "string" }, "key": { "description": "Key of the resource the finding is about.", "type": "string" }, "blockKey": { "description": "Workflow block the finding is about.", "type": "string" }, "param": { "description": "Block field the finding is about.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding about the directory, pinned to its file when it has one." }, "description": "Findings from reading." } }, "required": [ "workspaceId", "kinds", "files", "blobs", "base", "skipped", "diagnostics" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Get workspace source response", "description": "The workspace as a source directory.", "examples": [ { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "kinds": ["table", "workflow"], "files": { "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n name: 'leads',\n columns: {\n email: column.string({ required: true, unique: true }),\n status: column.select({ options: ['new', 'won'] }),\n },\n})\n" }, "blobs": [], "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } }, "skipped": [], "diagnostics": [] } } ] }, "ApplyWorkspaceSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workspaceId": { "type": "string", "description": "Workspace id." }, "dryRun": { "type": "boolean", "description": "True when nothing was written because `dryRun` was set." }, "plan": { "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "action": { "type": "string", "enum": ["create", "update", "adopt", "delete", "noop"], "description": "`adopt` binds the key to an existing resource of the same name, then updates it." }, "fields": { "description": "What changes.", "type": "array", "items": { "type": "string" } }, "destructive": { "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.", "type": "object", "properties": { "what": { "type": "string", "description": "What is lost." }, "counts": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "How much is lost." } }, "required": ["what", "counts"], "additionalProperties": false }, "id": { "description": "Stored id, once known.", "type": "string" }, "held": { "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.", "type": "boolean", "const": true } }, "required": ["kind", "key", "action"], "additionalProperties": false, "description": "One planned or applied change." }, "description": "Every planned change, no-ops included, in apply order." }, "refuses": { "description": "Set on a dry run: whether the apply would refuse. Errors of a change held back (`held`) refuse nothing else; any other error refuses. Absent on an apply.", "type": "boolean" }, "applied": { "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "action": { "type": "string", "enum": ["create", "update", "adopt", "delete", "noop"], "description": "`adopt` binds the key to an existing resource of the same name, then updates it." }, "fields": { "description": "What changes.", "type": "array", "items": { "type": "string" } }, "destructive": { "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.", "type": "object", "properties": { "what": { "type": "string", "description": "What is lost." }, "counts": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "How much is lost." } }, "required": ["what", "counts"], "additionalProperties": false }, "id": { "description": "Stored id, once known.", "type": "string" }, "held": { "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.", "type": "boolean", "const": true } }, "required": ["kind", "key", "action"], "additionalProperties": false, "description": "One planned or applied change." }, "description": "The changes written, in order." }, "failed": { "description": "The change that failed mid-apply. The changes before it are written (`applied`); the rest were not attempted. Applying the same directory again continues.", "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "code": { "type": "string", "enum": [ "E_DECL_SYNTAX", "E_DECL_HEADER", "E_DECL_IMPORT", "E_DECL_EXPORT", "E_DECL_UNSUPPORTED", "E_DECL_DUPLICATE_KEY", "E_DECL_SHAPE", "E_DECL_UNKNOWN_FIELD", "E_DECL_UNKNOWN_FILE", "W_PATH_NOT_SENT", "E_BLOB_MANIFEST", "E_BLOB_MISSING", "E_KEY_INVALID", "W_DECL_SUSPICIOUS_CHARACTER", "E_BASE_JSON", "E_BASE_VERSION", "E_BASE_SHAPE", "E_BASE_UNKNOWN_FIELD", "E_SECRET_NAME", "E_SECRET_MISSING", "W_SECRET_MISSING", "E_CREDENTIAL_MISSING", "E_CREDENTIAL_AMBIGUOUS", "W_CREDENTIAL_MISSING", "W_CREDENTIAL_AMBIGUOUS", "E_TABLE_COLUMN_NAME", "E_TABLE_DUPLICATE_COLUMN", "E_TABLE_TOO_MANY_COLUMNS", "E_TABLE_OPTIONS", "E_TABLE_TYPE_CONVERSION", "E_TABLE_FOLDER", "E_TABLE_ROWS", "I_TABLE_SEED_SKIPPED", "I_TABLE_ROWS_UNKEYED", "W_LIKELY_RENAME", "E_TOOL_SCHEMA", "E_TOOL_CODE", "E_TOOL_STORED_MISSING", "W_TOOL_LITERAL_SECRET", "E_SKILL_FRONTMATTER", "E_MCP_LITERAL_SECRET", "E_MCP_STORED_MISSING", "E_MCP_TOOL_UNKNOWN", "W_MCP_REPLACE", "W_MCP_TOOLS_UNCHECKED", "E_FILE_PATH", "E_FILE_PATH_COLLISION", "E_FILE_NAME", "E_FILE_TOO_LARGE", "E_FILE_CONTENT", "E_KB_EMBEDDING_IMMUTABLE", "E_KB_EMBEDDING_MODEL", "E_KB_DOC_AMBIGUOUS", "E_KB_DOC_NAME", "E_KB_DOC_EMPTY", "E_KB_CHUNKING", "E_KB_FOLDER", "W_KB_DOC_UNCHECKED", "W_KB_DOC_FAILED", "I_KB_REEMBED", "I_KB_CHUNKING", "I_KB_PROCESSING", "I_KB_DOCS_UNHASHED", "I_KB_UNMANAGED_DOCS", "I_KB_REPLACE_UNFINISHED", "E_DEPLOY_WORKFLOW", "E_DEPLOY_SECRET", "E_DEPLOY_CHAT_OUTPUT", "E_DEPLOY_CHAT_IDENTIFIER", "E_DEPLOY_PINNED_CHAT", "W_DEPLOYED_DRAFT_CHANGED", "W_DEPLOY_DRAFT_NOT_SOURCE", "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT", "I_DEPLOY_DRAFT_NOT_LIVE", "E_APPLY_NO_BASE", "E_APPLY_FORBIDDEN", "E_APPLY_DELETE_NOT_ALLOWED", "E_APPLY_LOCKED", "E_APPLY_REFUSED", "E_APPLY_FAILED", "E_PLAN_TOO_LARGE", "E_PLAN_REF_DELETED", "E_PLAN_REF_HELD", "W_RESOURCE_IN_USE", "W_TABLE_COLUMN_RENAMED_IN_USE", "E_WORKFLOW_FILES_MISSING", "E_WORKFLOW_FOLDER_COPIED", "W_UNDECLARED", "W_BASE_OTHER_WORKSPACE", "W_PROMOTE_TARGET_DELETED", "W_PROMOTE_DELETES_TARGET_ONLY", "W_SERVER_CHANGED", "W_SERVER_DELETED", "W_SERVER_MOVED", "I_KEY_REBOUND", "E_KEY_RENAMED", "E_APPLY_STALE", "E_LIMIT_EXCEEDED", "E_NAME_TAKEN", "I_FINDINGS_TRUNCATED", "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code." }, "message": { "type": "string", "description": "What failed." } }, "required": ["kind", "key", "code", "message"], "additionalProperties": false }, "needBlobs": { "type": "array", "items": { "type": "string" }, "description": "Binary paths a write needs whose bytes are not staged: on a dry run, exactly what to stage before applying." }, "applyId": { "description": "The id of an apply that wrote: every audit log entry its writes recorded carries it as `metadata.correlationId`. Absent on a dry run.", "type": "string" }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Files re-printed from what was saved, for every resource written." }, "base": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Base format version." }, "workspaceId": { "type": "string", "description": "Workspace the directory was read from." }, "resources": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id the key is bound to." }, "fingerprint": { "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.", "type": "string" }, "columns": { "description": "Table column key → stored column.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored column id." }, "options": { "description": "Select option name → option id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["id"], "additionalProperties": false } }, "blobs": { "description": "Binary file name → its stored id, revision and hash as last read.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id of the binary file." }, "rev": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ], "description": "Content revision as last read." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." } }, "required": ["id", "rev", "sha256"], "additionalProperties": false } }, "rows": { "description": "A table’s managed rows, as last read.", "type": "object", "properties": { "fingerprint": { "type": "string", "description": "`rf1:` fingerprint of the managed rows as last read." }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The table’s row version as last read; it moves on every row write." } }, "required": ["fingerprint", "version"], "additionalProperties": { "description": "An `x-` extension field, kept as written." } } }, "required": ["id"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "One resource in the base." }, "description": "`kind:key` → the stored resource and its fingerprint." } }, "required": ["version", "workspaceId", "resources"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "The base after this apply: the next apply’s `base`." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_DECL_SYNTAX", "E_DECL_HEADER", "E_DECL_IMPORT", "E_DECL_EXPORT", "E_DECL_UNSUPPORTED", "E_DECL_DUPLICATE_KEY", "E_DECL_SHAPE", "E_DECL_UNKNOWN_FIELD", "E_DECL_UNKNOWN_FILE", "W_PATH_NOT_SENT", "E_BLOB_MANIFEST", "E_BLOB_MISSING", "E_KEY_INVALID", "W_DECL_SUSPICIOUS_CHARACTER", "E_BASE_JSON", "E_BASE_VERSION", "E_BASE_SHAPE", "E_BASE_UNKNOWN_FIELD", "E_SECRET_NAME", "E_SECRET_MISSING", "W_SECRET_MISSING", "E_CREDENTIAL_MISSING", "E_CREDENTIAL_AMBIGUOUS", "W_CREDENTIAL_MISSING", "W_CREDENTIAL_AMBIGUOUS", "E_TABLE_COLUMN_NAME", "E_TABLE_DUPLICATE_COLUMN", "E_TABLE_TOO_MANY_COLUMNS", "E_TABLE_OPTIONS", "E_TABLE_TYPE_CONVERSION", "E_TABLE_FOLDER", "E_TABLE_ROWS", "I_TABLE_SEED_SKIPPED", "I_TABLE_ROWS_UNKEYED", "W_LIKELY_RENAME", "E_TOOL_SCHEMA", "E_TOOL_CODE", "E_TOOL_STORED_MISSING", "W_TOOL_LITERAL_SECRET", "E_SKILL_FRONTMATTER", "E_MCP_LITERAL_SECRET", "E_MCP_STORED_MISSING", "E_MCP_TOOL_UNKNOWN", "W_MCP_REPLACE", "W_MCP_TOOLS_UNCHECKED", "E_FILE_PATH", "E_FILE_PATH_COLLISION", "E_FILE_NAME", "E_FILE_TOO_LARGE", "E_FILE_CONTENT", "E_KB_EMBEDDING_IMMUTABLE", "E_KB_EMBEDDING_MODEL", "E_KB_DOC_AMBIGUOUS", "E_KB_DOC_NAME", "E_KB_DOC_EMPTY", "E_KB_CHUNKING", "E_KB_FOLDER", "W_KB_DOC_UNCHECKED", "W_KB_DOC_FAILED", "I_KB_REEMBED", "I_KB_CHUNKING", "I_KB_PROCESSING", "I_KB_DOCS_UNHASHED", "I_KB_UNMANAGED_DOCS", "I_KB_REPLACE_UNFINISHED", "E_DEPLOY_WORKFLOW", "E_DEPLOY_SECRET", "E_DEPLOY_CHAT_OUTPUT", "E_DEPLOY_CHAT_IDENTIFIER", "E_DEPLOY_PINNED_CHAT", "W_DEPLOYED_DRAFT_CHANGED", "W_DEPLOY_DRAFT_NOT_SOURCE", "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT", "I_DEPLOY_DRAFT_NOT_LIVE", "E_APPLY_NO_BASE", "E_APPLY_FORBIDDEN", "E_APPLY_DELETE_NOT_ALLOWED", "E_APPLY_LOCKED", "E_APPLY_REFUSED", "E_APPLY_FAILED", "E_PLAN_TOO_LARGE", "E_PLAN_REF_DELETED", "E_PLAN_REF_HELD", "W_RESOURCE_IN_USE", "W_TABLE_COLUMN_RENAMED_IN_USE", "E_WORKFLOW_FILES_MISSING", "E_WORKFLOW_FOLDER_COPIED", "W_UNDECLARED", "W_BASE_OTHER_WORKSPACE", "W_PROMOTE_TARGET_DELETED", "W_PROMOTE_DELETES_TARGET_ONLY", "W_SERVER_CHANGED", "W_SERVER_DELETED", "W_SERVER_MOVED", "I_KEY_REBOUND", "E_KEY_RENAMED", "E_APPLY_STALE", "E_LIMIT_EXCEEDED", "E_NAME_TAKEN", "I_FINDINGS_TRUNCATED", "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "file": { "description": "Directory file the finding is in.", "type": "string" }, "line": { "description": "1-based line in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "column": { "description": "1-based column in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endLine": { "description": "1-based line the finding ends on.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endColumn": { "description": "1-based column the finding ends at.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "frame": { "description": "The source lines around the finding, with a caret row.", "type": "string" }, "path": { "description": "JSON Pointer into a JSON file, such as the base.", "type": "string" }, "kind": { "description": "Kind of the resource the finding is about.", "type": "string" }, "key": { "description": "Key of the resource the finding is about.", "type": "string" }, "blockKey": { "description": "Workflow block the finding is about.", "type": "string" }, "param": { "description": "Block field the finding is about.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding about the directory, pinned to its file when it has one." }, "description": "Warnings, and on a dry run every error." } }, "required": [ "workspaceId", "dryRun", "plan", "applied", "needBlobs", "files", "base", "diagnostics" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Apply workspace source response", "description": "The plan, what was written, and the files re-printed from it.", "examples": [ { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": false, "plan": [ { "kind": "table", "key": "leads", "action": "noop", "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c" } ], "applied": [], "needBlobs": [], "files": {}, "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } }, "diagnostics": [] } } ] }, "ApplyWorkspaceSourceBody": { "type": "object", "properties": { "files": { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 1024 }, "additionalProperties": { "type": "string" }, "description": "Directory path → text for every managed kind: declarations (`tables/leads.ts`) and workflow folders (`workflows/ingest/workflow.ts`, `functions/*`, `.sim/lock.json`, `.sim/base.json`). A workflow folder sent with only its `.sim/base.json` is unchanged." }, "blobs": { "description": "Binary files by path, with the SHA-256 and size of their bytes. Their bytes must be staged first: `sim workspaces source apply` stages them, or upload them to `POST /api/v2/workspaces/{workspaceId}/source/blobs` (not available over MCP). An apply with any missing is refused with `E_BLOB_MISSING` and writes nothing.", "maxItems": 20000, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Directory path of the binary file." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." }, "size": { "type": "integer", "minimum": 0, "maximum": 10000000, "description": "Bytes." } }, "required": ["path", "sha256", "size"], "additionalProperties": false } }, "base": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Base format version." }, "workspaceId": { "type": "string", "description": "Workspace the directory was read from." }, "resources": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id the key is bound to." }, "fingerprint": { "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.", "type": "string" }, "columns": { "description": "Table column key → stored column.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored column id." }, "options": { "description": "Select option name → option id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["id"] } }, "blobs": { "description": "Binary file name → its stored id, revision and hash as last read.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id of the binary file." }, "rev": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ], "description": "Content revision as last read." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." } }, "required": ["id", "rev", "sha256"] } }, "rows": { "description": "A table’s managed rows, as last read.", "type": "object", "properties": { "fingerprint": { "type": "string", "description": "`rf1:` fingerprint of the managed rows as last read." }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The table’s row version as last read; it moves on every row write." } }, "required": ["fingerprint", "version"], "additionalProperties": { "description": "An `x-` extension field, kept as written." } } }, "required": ["id"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "One resource in the base." }, "description": "`kind:key` → the stored resource and its fingerprint." } }, "required": ["version", "workspaceId", "resources"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "`.sim/base.json`: per resource, the id and fingerprint the directory was read at. Apply compares it with the server to tell a local edit from a server change." }, "kinds": { "maxItems": 10, "type": "array", "items": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "description": "The kind folders the directory holds, empty ones included. A kind is managed only when listed here or when a file of it is sent." }, "options": { "description": "How far the apply may go.", "type": "object", "properties": { "allowDelete": { "description": "Delete resources, columns and data the directory no longer declares.", "type": "boolean" }, "only": { "description": "Apply only these kinds.", "type": "array", "items": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." } } }, "additionalProperties": false }, "provenance": { "description": "Where the directory came from, for the audit log.", "type": "object", "properties": { "client": { "type": "string", "enum": ["cli", "api"], "description": "What submitted the directory." }, "gitSha": { "description": "The commit the directory was taken from; recorded in the audit log.", "type": "string", "pattern": "^[0-9a-f]{7,64}$" }, "repo": { "type": "string", "minLength": 1, "maxLength": 512, "description": "The repository the source was taken from (its remote URL); recorded in the audit log." } }, "required": ["client"], "additionalProperties": false } }, "required": ["files", "kinds"], "additionalProperties": false, "title": "Apply workspace source body", "description": "The directory files, its managed kinds and the base they were read with.", "examples": [ { "files": { "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n name: 'leads',\n columns: {\n email: column.string({ required: true, unique: true }),\n status: column.select({ options: ['new', 'won'] }),\n },\n})\n" }, "kinds": ["table"], "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } } } ] }, "PlanWorkspaceSourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workspaceId": { "type": "string", "description": "Workspace id." }, "dryRun": { "type": "boolean", "description": "True when nothing was written because `dryRun` was set." }, "plan": { "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "action": { "type": "string", "enum": ["create", "update", "adopt", "delete", "noop"], "description": "`adopt` binds the key to an existing resource of the same name, then updates it." }, "fields": { "description": "What changes.", "type": "array", "items": { "type": "string" } }, "destructive": { "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.", "type": "object", "properties": { "what": { "type": "string", "description": "What is lost." }, "counts": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "How much is lost." } }, "required": ["what", "counts"], "additionalProperties": false }, "id": { "description": "Stored id, once known.", "type": "string" }, "held": { "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.", "type": "boolean", "const": true } }, "required": ["kind", "key", "action"], "additionalProperties": false, "description": "One planned or applied change." }, "description": "Every planned change, no-ops included, in apply order." }, "refuses": { "description": "Set on a dry run: whether the apply would refuse. Errors of a change held back (`held`) refuse nothing else; any other error refuses. Absent on an apply.", "type": "boolean" }, "applied": { "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "action": { "type": "string", "enum": ["create", "update", "adopt", "delete", "noop"], "description": "`adopt` binds the key to an existing resource of the same name, then updates it." }, "fields": { "description": "What changes.", "type": "array", "items": { "type": "string" } }, "destructive": { "description": "Data the change deletes: dropped columns, removed select options and the cells they empty, or a deleted resource. A dry run shows it whether or not `allowDelete` is set.", "type": "object", "properties": { "what": { "type": "string", "description": "What is lost." }, "counts": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "description": "How much is lost." } }, "required": ["what", "counts"], "additionalProperties": false }, "id": { "description": "Stored id, once known.", "type": "string" }, "held": { "description": "Held back: the change uses a declared secret the workspace has no value for, or a declared credential key nothing binds to (see its errors). It is not written; the rest of the apply goes ahead.", "type": "boolean", "const": true } }, "required": ["kind", "key", "action"], "additionalProperties": false, "description": "One planned or applied change." }, "description": "The changes written, in order." }, "failed": { "description": "The change that failed mid-apply. The changes before it are written (`applied`); the rest were not attempted. Applying the same directory again continues.", "type": "object", "properties": { "kind": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "key": { "type": "string", "description": "Resource key." }, "code": { "type": "string", "enum": [ "E_DECL_SYNTAX", "E_DECL_HEADER", "E_DECL_IMPORT", "E_DECL_EXPORT", "E_DECL_UNSUPPORTED", "E_DECL_DUPLICATE_KEY", "E_DECL_SHAPE", "E_DECL_UNKNOWN_FIELD", "E_DECL_UNKNOWN_FILE", "W_PATH_NOT_SENT", "E_BLOB_MANIFEST", "E_BLOB_MISSING", "E_KEY_INVALID", "W_DECL_SUSPICIOUS_CHARACTER", "E_BASE_JSON", "E_BASE_VERSION", "E_BASE_SHAPE", "E_BASE_UNKNOWN_FIELD", "E_SECRET_NAME", "E_SECRET_MISSING", "W_SECRET_MISSING", "E_CREDENTIAL_MISSING", "E_CREDENTIAL_AMBIGUOUS", "W_CREDENTIAL_MISSING", "W_CREDENTIAL_AMBIGUOUS", "E_TABLE_COLUMN_NAME", "E_TABLE_DUPLICATE_COLUMN", "E_TABLE_TOO_MANY_COLUMNS", "E_TABLE_OPTIONS", "E_TABLE_TYPE_CONVERSION", "E_TABLE_FOLDER", "E_TABLE_ROWS", "I_TABLE_SEED_SKIPPED", "I_TABLE_ROWS_UNKEYED", "W_LIKELY_RENAME", "E_TOOL_SCHEMA", "E_TOOL_CODE", "E_TOOL_STORED_MISSING", "W_TOOL_LITERAL_SECRET", "E_SKILL_FRONTMATTER", "E_MCP_LITERAL_SECRET", "E_MCP_STORED_MISSING", "E_MCP_TOOL_UNKNOWN", "W_MCP_REPLACE", "W_MCP_TOOLS_UNCHECKED", "E_FILE_PATH", "E_FILE_PATH_COLLISION", "E_FILE_NAME", "E_FILE_TOO_LARGE", "E_FILE_CONTENT", "E_KB_EMBEDDING_IMMUTABLE", "E_KB_EMBEDDING_MODEL", "E_KB_DOC_AMBIGUOUS", "E_KB_DOC_NAME", "E_KB_DOC_EMPTY", "E_KB_CHUNKING", "E_KB_FOLDER", "W_KB_DOC_UNCHECKED", "W_KB_DOC_FAILED", "I_KB_REEMBED", "I_KB_CHUNKING", "I_KB_PROCESSING", "I_KB_DOCS_UNHASHED", "I_KB_UNMANAGED_DOCS", "I_KB_REPLACE_UNFINISHED", "E_DEPLOY_WORKFLOW", "E_DEPLOY_SECRET", "E_DEPLOY_CHAT_OUTPUT", "E_DEPLOY_CHAT_IDENTIFIER", "E_DEPLOY_PINNED_CHAT", "W_DEPLOYED_DRAFT_CHANGED", "W_DEPLOY_DRAFT_NOT_SOURCE", "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT", "I_DEPLOY_DRAFT_NOT_LIVE", "E_APPLY_NO_BASE", "E_APPLY_FORBIDDEN", "E_APPLY_DELETE_NOT_ALLOWED", "E_APPLY_LOCKED", "E_APPLY_REFUSED", "E_APPLY_FAILED", "E_PLAN_TOO_LARGE", "E_PLAN_REF_DELETED", "E_PLAN_REF_HELD", "W_RESOURCE_IN_USE", "W_TABLE_COLUMN_RENAMED_IN_USE", "E_WORKFLOW_FILES_MISSING", "E_WORKFLOW_FOLDER_COPIED", "W_UNDECLARED", "W_BASE_OTHER_WORKSPACE", "W_PROMOTE_TARGET_DELETED", "W_PROMOTE_DELETES_TARGET_ONLY", "W_SERVER_CHANGED", "W_SERVER_DELETED", "W_SERVER_MOVED", "I_KEY_REBOUND", "E_KEY_RENAMED", "E_APPLY_STALE", "E_LIMIT_EXCEEDED", "E_NAME_TAKEN", "I_FINDINGS_TRUNCATED", "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code." }, "message": { "type": "string", "description": "What failed." } }, "required": ["kind", "key", "code", "message"], "additionalProperties": false }, "needBlobs": { "type": "array", "items": { "type": "string" }, "description": "Binary paths a write needs whose bytes are not staged: on a dry run, exactly what to stage before applying." }, "applyId": { "description": "The id of an apply that wrote: every audit log entry its writes recorded carries it as `metadata.correlationId`. Absent on a dry run.", "type": "string" }, "files": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" }, "description": "Files re-printed from what was saved, for every resource written." }, "base": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Base format version." }, "workspaceId": { "type": "string", "description": "Workspace the directory was read from." }, "resources": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id the key is bound to." }, "fingerprint": { "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.", "type": "string" }, "columns": { "description": "Table column key → stored column.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored column id." }, "options": { "description": "Select option name → option id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["id"], "additionalProperties": false } }, "blobs": { "description": "Binary file name → its stored id, revision and hash as last read.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id of the binary file." }, "rev": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ], "description": "Content revision as last read." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." } }, "required": ["id", "rev", "sha256"], "additionalProperties": false } }, "rows": { "description": "A table’s managed rows, as last read.", "type": "object", "properties": { "fingerprint": { "type": "string", "description": "`rf1:` fingerprint of the managed rows as last read." }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The table’s row version as last read; it moves on every row write." } }, "required": ["fingerprint", "version"], "additionalProperties": { "description": "An `x-` extension field, kept as written." } } }, "required": ["id"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "One resource in the base." }, "description": "`kind:key` → the stored resource and its fingerprint." } }, "required": ["version", "workspaceId", "resources"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "The base after this apply: the next apply’s `base`." }, "diagnostics": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string", "enum": [ "E_DECL_SYNTAX", "E_DECL_HEADER", "E_DECL_IMPORT", "E_DECL_EXPORT", "E_DECL_UNSUPPORTED", "E_DECL_DUPLICATE_KEY", "E_DECL_SHAPE", "E_DECL_UNKNOWN_FIELD", "E_DECL_UNKNOWN_FILE", "W_PATH_NOT_SENT", "E_BLOB_MANIFEST", "E_BLOB_MISSING", "E_KEY_INVALID", "W_DECL_SUSPICIOUS_CHARACTER", "E_BASE_JSON", "E_BASE_VERSION", "E_BASE_SHAPE", "E_BASE_UNKNOWN_FIELD", "E_SECRET_NAME", "E_SECRET_MISSING", "W_SECRET_MISSING", "E_CREDENTIAL_MISSING", "E_CREDENTIAL_AMBIGUOUS", "W_CREDENTIAL_MISSING", "W_CREDENTIAL_AMBIGUOUS", "E_TABLE_COLUMN_NAME", "E_TABLE_DUPLICATE_COLUMN", "E_TABLE_TOO_MANY_COLUMNS", "E_TABLE_OPTIONS", "E_TABLE_TYPE_CONVERSION", "E_TABLE_FOLDER", "E_TABLE_ROWS", "I_TABLE_SEED_SKIPPED", "I_TABLE_ROWS_UNKEYED", "W_LIKELY_RENAME", "E_TOOL_SCHEMA", "E_TOOL_CODE", "E_TOOL_STORED_MISSING", "W_TOOL_LITERAL_SECRET", "E_SKILL_FRONTMATTER", "E_MCP_LITERAL_SECRET", "E_MCP_STORED_MISSING", "E_MCP_TOOL_UNKNOWN", "W_MCP_REPLACE", "W_MCP_TOOLS_UNCHECKED", "E_FILE_PATH", "E_FILE_PATH_COLLISION", "E_FILE_NAME", "E_FILE_TOO_LARGE", "E_FILE_CONTENT", "E_KB_EMBEDDING_IMMUTABLE", "E_KB_EMBEDDING_MODEL", "E_KB_DOC_AMBIGUOUS", "E_KB_DOC_NAME", "E_KB_DOC_EMPTY", "E_KB_CHUNKING", "E_KB_FOLDER", "W_KB_DOC_UNCHECKED", "W_KB_DOC_FAILED", "I_KB_REEMBED", "I_KB_CHUNKING", "I_KB_PROCESSING", "I_KB_DOCS_UNHASHED", "I_KB_UNMANAGED_DOCS", "I_KB_REPLACE_UNFINISHED", "E_DEPLOY_WORKFLOW", "E_DEPLOY_SECRET", "E_DEPLOY_CHAT_OUTPUT", "E_DEPLOY_CHAT_IDENTIFIER", "E_DEPLOY_PINNED_CHAT", "W_DEPLOYED_DRAFT_CHANGED", "W_DEPLOY_DRAFT_NOT_SOURCE", "E_DEPLOY_DRAFT_NOT_SOURCE_CHAT", "I_DEPLOY_DRAFT_NOT_LIVE", "E_APPLY_NO_BASE", "E_APPLY_FORBIDDEN", "E_APPLY_DELETE_NOT_ALLOWED", "E_APPLY_LOCKED", "E_APPLY_REFUSED", "E_APPLY_FAILED", "E_PLAN_TOO_LARGE", "E_PLAN_REF_DELETED", "E_PLAN_REF_HELD", "W_RESOURCE_IN_USE", "W_TABLE_COLUMN_RENAMED_IN_USE", "E_WORKFLOW_FILES_MISSING", "E_WORKFLOW_FOLDER_COPIED", "W_UNDECLARED", "W_BASE_OTHER_WORKSPACE", "W_PROMOTE_TARGET_DELETED", "W_PROMOTE_DELETES_TARGET_ONLY", "W_SERVER_CHANGED", "W_SERVER_DELETED", "W_SERVER_MOVED", "I_KEY_REBOUND", "E_KEY_RENAMED", "E_APPLY_STALE", "E_LIMIT_EXCEEDED", "E_NAME_TAKEN", "I_FINDINGS_TRUNCATED", "E_SYNTAX", "E_SDK_HEADER", "E_SDK_MAJOR", "E_SDK_MAJOR_OLD", "E_UNSUPPORTED_SYNTAX", "E_WORKFLOW_EXPORT", "E_INVALID_CHARACTER", "E_NUMBER_NOT_FINITE", "W_NUMBER_PRECISION", "E_TOO_MANY_ERRORS", "E_DUPLICATE_NAME", "E_RESERVED_NAME", "E_KEY_OVERRIDE", "E_EMPTY_NAME", "E_LOOKALIKE_NAME", "W_LOOKALIKE_NAME", "W_SUSPICIOUS_CHARACTER", "E_NAME_NOT_LITERAL", "E_UNKNOWN_IDENTIFIER", "E_OUT_OF_SCOPE", "E_UNKNOWN_VARIABLE", "E_DUPLICATE_VARIABLE", "E_VARIABLE_NAME_MISMATCH", "E_INVALID_ENV_NAME", "W_ENV_UNKNOWN", "W_CHILD_INPUT_UNKNOWN", "W_CHILD_NO_START", "W_CHILD_RESULT_PATH", "E_UNKNOWN_SUBFLOW_PROPERTY", "W_FORWARD_REF", "W_REF_NOT_NORMALIZED", "E_REF_UNREPRESENTABLE", "W_REF_OUT_OF_SCOPE", "E_EDGE_SCOPE", "E_EDGE_NOTE", "E_TARGET_TRIGGER", "E_NO_DEFAULT_OUTPUT", "E_DUPLICATE_EDGE", "E_ERROR_PORT_UNSUPPORTED", "W_ERROR_PORT_STORED", "E_UNKNOWN_BRANCH", "E_DUPLICATE_BRANCH_KEY", "E_BRANCH_KEY_COLLIDES", "E_BRANCH_ELSE_LAST", "W_RAW_HANDLE", "W_SUBFLOW_HANDLE_SCOPE", "E_EDGE_CYCLE", "W_EDGE_CYCLE", "W_BRANCH_UNWIRED", "E_UNKNOWN_BUILDER", "E_UNKNOWN_PARAM", "E_FIXED_PARAM", "W_FIELD_NOT_APPLICABLE", "W_REQUIRED_MISSING", "W_UNKNOWN_OPTION", "E_UNKNOWN_OPERATION", "W_UNKNOWN_MODEL", "W_LEGACY_BLOCK_TYPE", "W_UNKNOWN_BLOCK_TYPE", "W_TYPE_NOT_ADDABLE", "I_SCHEDULE_UTC", "E_STORED_VALUE_MISSING", "W_VALUE_KIND", "W_OUT_OF_RANGE", "W_TABLE_FILTER_SHAPE", "W_LITERAL_SECRET", "W_SUBFLOW_COUNT", "W_UNKNOWN_OUTPUT_PATH", "W_OUTPUT_PATH_UNDECLARED", "W_JSON_REF_UNTYPED", "W_LOOP_CONDITION_SYNTAX", "E_CODE_FILE_MISSING", "E_CODE_FILE_PATH", "W_CODE_FILE_INLINED", "W_CODE_FILE_REF_SYNTAX", "W_UNRESOLVED_REF", "W_FORWARD_REF_LITERALIZED", "W_COMMENT_MOVED", "W_COMMENT_DROPPED", "E_LOCK_JSON", "E_LOCK_VERSION", "E_LOCK_SHAPE", "E_LOCK_UNKNOWN_FIELD", "E_LOCK_KEY", "E_LOCK_IDENT", "E_LOCK_DUPLICATE_IDENT", "E_LOCK_DUPLICATE_ID", "E_LOCK_PARENT", "E_LOCK_BRANCH", "E_LOCK_CODE_FILE_PATH", "E_SOURCE_META_JSON", "E_SOURCE_META_VERSION", "E_SOURCE_META_SHAPE", "E_SOURCE_META_UNKNOWN_FIELD", "E_SOURCE_META_IDENT", "E_SOURCE_META_DUPLICATE_IDENT", "E_SOURCE_META_ANCHOR", "E_CANON_LEGACY_NAME_COLLISION", "E_CANON_EDGE_SCOPE", "W_CANON_RESERVED_NAME", "W_CANON_DANGLING_EDGE", "W_CANON_DANGLING_PARENT", "W_CANON_RAW_HANDLE", "W_CANON_UNKNOWN_BLOCK_TYPE", "W_CANON_UNRESOLVED_ID", "W_CANON_TITLE_OVERRIDE", "W_CANON_SUBFLOW_REPAIRED", "W_CANON_SUBBLOCK_TYPE_DRIFT", "W_CANON_UNDECODABLE_JSON", "E_MAT_DUPLICATE_LOCK_ID", "E_MAT_UNKNOWN_RESOURCE", "E_MAT_UNKNOWN_VARIABLE", "W_MAT_DELETED_SINCE_PULL", "W_MAT_INFERRED_RENAME", "W_MAT_RETYPE_RECREATED", "W_MAT_LOCK_ID_CLAIMED", "I_MAT_NEEDS_LAYOUT", "E_APPLY_WORKFLOW_MISMATCH", "E_APPLY_LOCKED_BLOCK", "E_APPLY_TYPE_NOT_ADDABLE", "E_APPLY_INVALID_STATE", "E_APPLY_BLOCK_NOT_FOUND", "E_APPLY_INVALID_BLOCK_TYPE", "E_APPLY_BLOCK_NOT_ALLOWED", "E_APPLY_MODEL_NOT_ALLOWED", "E_APPLY_TOOL_NOT_ALLOWED", "E_APPLY_INVALID_EDGE_SOURCE", "E_APPLY_INVALID_EDGE_SCOPE", "E_APPLY_INVALID_SOURCE_HANDLE", "E_APPLY_INVALID_TARGET_HANDLE", "E_APPLY_INVALID_SUBBLOCK_FIELD", "E_APPLY_MISSING_REQUIRED_PARAMS", "E_APPLY_RETRY_NOT_SUPPORTED", "E_APPLY_DUPLICATE_TRIGGER", "E_APPLY_DUPLICATE_SINGLE_INSTANCE_BLOCK", "E_APPLY_DISABLED_ANCESTOR", "E_APPLY_CREDENTIAL_UNREACHABLE", "W_APPLY_CREDENTIAL_KEPT", "E_APPLY_SANDBOX_PLAN_REQUIRED", "W_APPLY_HOSTED_KEY_DROPPED", "W_APPLY_VALUE_NORMALIZED", "W_APPLY_TYPE_CHANGED", "W_APPLY_TRIGGER_REMOVED", "W_APPLY_CATALOG_MOVED", "W_APPLY_PROBABLE_RENAME", "E_APPLY_LINT", "E_APPLY_UNRESOLVED_REF", "E_APPLY_REF_OUT_OF_SCOPE", "E_APPLY_CODE_FILE_REF_SYNTAX", "E_APPLY_LOOP_CONDITION_SYNTAX", "W_APPLY_LINT", "W_TABLE_UNKNOWN_COLUMN", "E_APPLY_INVALID_SCHEDULE", "E_APPLY_BLOCK_DELETE", "E_APPLY_VARIABLE_DELETE", "E_WORKFLOW_META_INVALID" ], "description": "Diagnostic code, e.g. `E_APPLY_STALE` or `E_UNKNOWN_PARAM`." }, "severity": { "type": "string", "enum": ["error", "warning", "info"], "description": "Diagnostic severity." }, "message": { "type": "string", "description": "What was found." }, "hint": { "description": "How to address it.", "type": "string" }, "file": { "description": "Directory file the finding is in.", "type": "string" }, "line": { "description": "1-based line in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "column": { "description": "1-based column in `file`.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endLine": { "description": "1-based line the finding ends on.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "endColumn": { "description": "1-based column the finding ends at.", "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, "frame": { "description": "The source lines around the finding, with a caret row.", "type": "string" }, "path": { "description": "JSON Pointer into a JSON file, such as the base.", "type": "string" }, "kind": { "description": "Kind of the resource the finding is about.", "type": "string" }, "key": { "description": "Key of the resource the finding is about.", "type": "string" }, "blockKey": { "description": "Workflow block the finding is about.", "type": "string" }, "param": { "description": "Block field the finding is about.", "type": "string" } }, "required": ["code", "severity", "message"], "additionalProperties": false, "description": "A finding about the directory, pinned to its file when it has one." }, "description": "Warnings, and on a dry run every error." } }, "required": [ "workspaceId", "dryRun", "plan", "applied", "needBlobs", "files", "base", "diagnostics" ], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Plan workspace source response", "description": "The plan an apply would carry out.", "examples": [ { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "dryRun": true, "plan": [ { "kind": "table", "key": "leads", "action": "noop", "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c" } ], "applied": [], "needBlobs": [], "files": {}, "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } }, "diagnostics": [] } } ] }, "PlanWorkspaceSourceBody": { "type": "object", "properties": { "files": { "type": "object", "propertyNames": { "type": "string", "minLength": 1, "maxLength": 1024 }, "additionalProperties": { "type": "string" }, "description": "Directory path → text for every managed kind: declarations (`tables/leads.ts`) and workflow folders (`workflows/ingest/workflow.ts`, `functions/*`, `.sim/lock.json`, `.sim/base.json`). A workflow folder sent with only its `.sim/base.json` is unchanged." }, "blobs": { "description": "Binary files by path, with the SHA-256 and size of their bytes. Their bytes must be staged first: `sim workspaces source apply` stages them, or upload them to `POST /api/v2/workspaces/{workspaceId}/source/blobs` (not available over MCP). An apply with any missing is refused with `E_BLOB_MISSING` and writes nothing.", "maxItems": 20000, "type": "array", "items": { "type": "object", "properties": { "path": { "type": "string", "minLength": 1, "maxLength": 1024, "description": "Directory path of the binary file." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." }, "size": { "type": "integer", "minimum": 0, "maximum": 10000000, "description": "Bytes." } }, "required": ["path", "sha256", "size"], "additionalProperties": false } }, "base": { "type": "object", "properties": { "version": { "type": "number", "const": 1, "description": "Base format version." }, "workspaceId": { "type": "string", "description": "Workspace the directory was read from." }, "resources": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id the key is bound to." }, "fingerprint": { "description": "`rf1:` fingerprint of the resource as last read; absent for a workflow, and for a binary file listed without `sha256` until the client records its hash.", "type": "string" }, "columns": { "description": "Table column key → stored column.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored column id." }, "options": { "description": "Select option name → option id.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": ["id"] } }, "blobs": { "description": "Binary file name → its stored id, revision and hash as last read.", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "object", "properties": { "id": { "type": "string", "description": "Stored id of the binary file." }, "rev": { "anyOf": [ { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 }, { "type": "string" } ], "description": "Content revision as last read." }, "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." } }, "required": ["id", "rev", "sha256"] } }, "rows": { "description": "A table’s managed rows, as last read.", "type": "object", "properties": { "fingerprint": { "type": "string", "description": "`rf1:` fingerprint of the managed rows as last read." }, "version": { "type": "integer", "minimum": 0, "maximum": 9007199254740991, "description": "The table’s row version as last read; it moves on every row write." } }, "required": ["fingerprint", "version"], "additionalProperties": { "description": "An `x-` extension field, kept as written." } } }, "required": ["id"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "One resource in the base." }, "description": "`kind:key` → the stored resource and its fingerprint." } }, "required": ["version", "workspaceId", "resources"], "additionalProperties": { "description": "An `x-` extension field, kept as written." }, "description": "`.sim/base.json`: per resource, the id and fingerprint the directory was read at. Apply compares it with the server to tell a local edit from a server change." }, "kinds": { "maxItems": 10, "type": "array", "items": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." }, "description": "The kind folders the directory holds, empty ones included. A kind is managed only when listed here or when a file of it is sent." }, "options": { "description": "How far the apply may go.", "type": "object", "properties": { "allowDelete": { "description": "Delete resources, columns and data the directory no longer declares.", "type": "boolean" }, "only": { "description": "Apply only these kinds.", "type": "array", "items": { "type": "string", "enum": [ "secret", "credential", "custom-tool", "skill", "mcp-server", "table", "knowledge-base", "file", "workflow", "deployment" ], "description": "A resource kind: `secret`, `credential`, `custom-tool`, `skill`, `mcp-server`, `table`, `knowledge-base`, `file`, `workflow`, `deployment`." } } }, "additionalProperties": false } }, "required": ["files", "kinds"], "additionalProperties": false, "title": "Plan workspace source body", "description": "The directory files, its managed kinds and the base they were read with.", "examples": [ { "files": { "tables/leads.ts": "// @sim-sdk 1\nimport { column, defineTable } from '@sim/workflow-sdk/workspace'\n\nexport default defineTable({\n name: 'leads',\n columns: {\n email: column.string({ required: true, unique: true }),\n status: column.select({ options: ['new', 'won'] }),\n },\n})\n" }, "kinds": ["table"], "base": { "version": 1, "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "resources": { "table:leads": { "id": "tbl_5c0e2a7b9d1f4e3a8b6c2d0f7e9a1b3c", "fingerprint": "rf1:4b8d2f6a0c3e7b1d5f9a2c6e0b4d8f3a7c1e5b9d2f6a0c4e8b3d7f1a5c9e2b6d", "columns": { "email": { "id": "col_8e1c4a7b2d5f" }, "status": { "id": "col_3b6d9f2a5c8e", "options": { "new": "k2Pq9x", "won": "r7Tn4m" } } } } } } } ] }, "FindMissingWorkspaceSourceBlobsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workspaceId": { "type": "string", "description": "Workspace id." }, "missing": { "type": "array", "items": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." }, "description": "SHA-256 of each listed file that is not staged, in the order listed." } }, "required": ["workspaceId", "missing"], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Find missing workspace source blobs response", "description": "The SHA-256 of each binary file still to stage.", "examples": [ { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "missing": ["9f2c4e6a8b0d1f3e5a7c9b2d4f6e8a0c1b3d5f7e9a2c4b6d8f0e1a3c5b7d9f2e"] } } ] }, "FindMissingWorkspaceSourceBlobsBody": { "type": "object", "properties": { "blobs": { "maxItems": 20000, "type": "array", "items": { "type": "object", "properties": { "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." }, "size": { "type": "integer", "minimum": 0, "maximum": 10000000, "description": "Bytes." } }, "required": ["sha256", "size"], "additionalProperties": false, "description": "A binary file by the SHA-256 and size of its bytes." }, "description": "The binary files an apply will need." } }, "required": ["blobs"], "additionalProperties": false, "title": "Find missing workspace source blobs body", "description": "The binary files an apply will need.", "examples": [ { "blobs": [ { "sha256": "9f2c4e6a8b0d1f3e5a7c9b2d4f6e8a0c1b3d5f7e9a2c4b6d8f0e1a3c5b7d9f2e", "size": 18432 } ] } ] }, "StageWorkspaceSourceBlobsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "workspaceId": { "type": "string", "description": "Workspace id." }, "staged": { "type": "array", "items": { "type": "object", "properties": { "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "SHA-256 of the bytes, lowercase hex." }, "size": { "type": "integer", "minimum": 0, "maximum": 10000000, "description": "Bytes." } }, "required": ["sha256", "size"], "additionalProperties": false, "description": "A binary file by the SHA-256 and size of its bytes." }, "description": "The binary files now staged." } }, "required": ["workspaceId", "staged"], "additionalProperties": false, "description": "Response data." } }, "required": ["data"], "additionalProperties": false, "title": "Stage workspace source blobs response", "description": "The binary files now staged.", "examples": [ { "data": { "workspaceId": "a91c4b2e-6d3f-4e8a-b5c7-0d9e2f1a8c64", "staged": [ { "sha256": "9f2c4e6a8b0d1f3e5a7c9b2d4f6e8a0c1b3d5f7e9a2c4b6d8f0e1a3c5b7d9f2e", "size": 18432 } ] } } ] }, "StageWorkspaceSourceBlobsForm": { "type": "object", "propertyNames": { "type": "string", "pattern": "^[0-9a-f]{64}$", "description": "The SHA-256 of the part, lowercase hex." }, "additionalProperties": { "type": "string", "format": "binary", "contentEncoding": "binary", "maxLength": 10000000, "description": "The bytes of one binary file." }, "description": "One file part per binary file, named by its SHA-256.", "title": "Stage workspace source blobs form" } } }, "x-generated-by": "scripts/generate-openapi.ts" }