工作流设计 Beta
流程定义、版本、发布、部署、触发器与算子目录。
按查询选择器获取流程版本。
GET /workflow-orchestration/control-plane/flow-compilation/flow-version/{queryselector}
返回与路由中指定的查询选择器和搜索条件匹配的 FlowVersion 信息。
认证: Bearer 令牌
参数
-
queryselectorenum 路径 必填 -
此查询可用的筛选条件
idorganization-idflow-definition-idall -
searchstring 查询 -
用于搜索实体的关键字。
-
include_statusstring 查询 -
可选的状态参数,用于包含指定状态的流程版本。
-
exclude_statusstring 查询 -
可选的状态参数,用于排除指定状态的流程版本。
-
pageinteger 查询 -
页码,从 1 开始(默认 1)。
-
pageSizeinteger 查询 -
每页记录数(默认 25)。
响应
-
200成功。 -
500执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/flow-compilation/flow-version/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-compilation/flow-version/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-compilation/flow-version/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org_blackwood_stone",
"flow_definition_id": "flow-def-email-routing",
"flow_slug": "flow.email_classify_and_route",
"version": "1.3.0",
"name": "Email classification and routing v3",
"description": "Third compiled version with improved classification labels and new routing paths.",
"graph": {
"nodes": [
{
"node_id": "trigger_email",
"operator_slug": "webhook.trigger",
"label": "Trigger incoming email",
"config": {
"path": "/ingress/email"
}
},
{
"node_id": "classify_email",
"operator_slug": "ai.classify",
"label": "Classify incoming email",
"config": {
"labels": [
"billing",
"technical",
"complaint"
],
"confidence_threshold": 0.7
}
},
{
"node_id": "create_ticket",
"operator_slug": "http.request",
"label": "Create support ticket",
"config": {
"method": "POST",
"url": "https://tickets.example.com/api/v1/tickets"
}
}
],
"edges": [
{
"from": {
"node_id": "trigger_email",
"port": "out"
},
"to": {
"node_id": "classify_email",
"port": "in"
},
"condition": {
"type": "expression",
"expression": "payload.is_spam != true"
},
"priority": 10,
"error_semantics": "fallback",
"is_enabled": true
},
{
"from": {
"node_id": "classify_email",
"port": "out"
},
"to": {
"node_id": "create_ticket",
"port": "in"
},
"condition": null,
"priority": 0,
"error_semantics": null,
"is_enabled": true
}
]
},
"trigger_ids": [
"trig_email_ingress"
],
"default_trigger_id": "trig_email_ingress",
"primary_agent_profile_id": "agent_support_router",
"agent_profile_ids": [
"agent_support_router",
"agent_quality_assistant"
],
"validation_status": "valid",
"validation_issues": [],
"is_default": true,
"compatible_with_versions": [
"2"
],
"concurrency_limit": 5000,
"default_timeout_ms": 600000,
"default_retry_policy": {
"max_attempts": 3,
"backoff_strategy": "exponential"
},
"rollout_strategy": "immediate"
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}创建流程定义。
POST /workflow-orchestration/control-plane/flow-design/flow-definition/
返回根据所提供数据创建的流程定义。
认证: Bearer 令牌
请求体
要创建的 FlowDefinition 对象。
-
namestring 必填 -
在 Sommatic AI 中显示的流程定义名称(可读)。
-
slugstring 必填 -
在多个版本和部署之间标识同一逻辑流程的稳定语义键。
-
descriptionstring -
较长的自由文本描述,说明该流程的业务与运营目的。
-
business_purposestring -
简要说明该流程旨在支撑的组织职能或结果。
-
cognitive_rolestring -
该流程在组织认知体系中的总体角色,例如 "orchestration"、"monitoring"、"remediation"、"classification" 或 "decision_support"。
-
categorystring -
可选的类别或领域标签,用于在 Sommatic AI 工作区中对相关流程分组。
-
tagsarray<string> -
可选的标签列表,用于对流程定义进行分类、搜索和筛选。
-
organization_idstring 必填 -
拥有该流程定义的组织(租户)标识符。
-
project_idstring 必填 -
用于将该流程与相关自动化资产归组的项目标识符。
-
draft_graphobject -
描述该定义草稿流程结构的有向无环图。
-
nodesarray<NodeDefinitionModel> -
NodeDefinitionModel 实例列表,定义该流程定义中各节点的行为。
-
edgesarray<NodeEdgeModel> -
NodeEdgeModel 实例列表,描述该定义中节点之间的控制流。
-
-
trigger_idsarray<string> -
可启动或恢复该流程定义的 TriggerModel 标识符列表。
-
default_trigger_idstring -
作为该流程默认入口的 TriggerModel 标识符。
-
primary_agent_profile_idstring -
为该流程提供默认 AI 行为的主 AgentProfileModel 标识符。
-
agent_profile_idsarray<string> -
可选,以多智能体编排方式执行时可参与该流程的 AgentProfileModel 标识符列表。
-
supports_concurrent_instancesboolean -
表示在同一业务上下文中该流程的多个实例能否并行运行。
-
max_concurrent_instancesinteger -
可选,该流程定义允许的并发实例数上限。
-
default_timeout_msinteger -
可选,节点未设置超时时应用于流程实例的默认执行超时(毫秒)。
-
default_retry_policyobject -
可选,流程级默认重试策略,为未单独覆盖的节点提供重试基线行为,通常包括最大尝试次数和退避策略。
-
editor_stateobject -
可选,持久化的编辑器状态,例如画布位置、缩放级别和节点坐标,使可视化构建器能够恢复设计者上次使用的布局。
-
latest_version_idstring -
从该定义编译出的最新 FlowVersionModel 的标识符(如有)。
-
version_counterinteger -
用于从该定义生成连续 FlowVersionModel 版本号的单调递增计数器。
-
compiler_hintsobject -
可选的编译器提示和优化标志,影响该定义如何编译为 FlowVersionModel 实例,例如首选的 worker 池或执行策略。
-
execution_stateobject -
控制流程是否接受新执行的运营闸门,按执行模式(test、prod)分别设置。某一模式下为
paused: true时,所有分发入口(webhook、chain、scheduled、manual)都会跳过编排器执行。test 模式下不创建 FlowInstance(返回 423 Locked);prod 模式下会创建状态为paused的 FlowInstance 用于审计,但不会调用编排器。-
testobject -
-
pausedboolean -
paused_atstring -
paused_bystring -
paused_reasonstring
-
-
prodobject -
-
pausedboolean -
paused_atstring -
paused_bystring -
paused_reasonstring
-
-
-
output_configarray<object> -
定义查看工作流运行结果时,哪些节点输出作为有意义的结果展示。每个条目固定一个节点,并控制提取和显示哪些数据(output、metrics、meta)。
-
node_idstring -
其输出需纳入所配置结果的节点标识符。
-
labelstring -
该输出条目在结果视图中显示的可读标签。
-
displaystring -
显示模式:"full" 显示完整输出,"fields" 仅显示所选字段。
-
fieldsarray<string> -
当 display 为 "fields" 时,要提取的输出字段名列表。
-
include_metricsboolean -
是否包含该节点的执行指标(延迟、token 用量)。
-
include_metaboolean -
是否包含 meta 对象(评估详情、路由决策)。
-
orderinteger -
在结果视图中的显示顺序(数值小者在前)。
-
-
git_bindingobject -
该资源同步来源 Git 仓库的关联信息(参见 docs/concepts/git_sync.md):{ repository_id, repository, branch, environment, package_path, resource_key, file_path, last_synced_commit, last_synced_at, deployed_commit, deployed_at, deployed_version, unlinked, unlinked_at }。unlinked = true 表示当前安装不再从 Git 同步该资源。
-
persistence_store_idstring -
可选,引用一个载荷存储(WorkflowOrchestrationMemoryStore),用于定义该工作流大体积执行载荷的外置位置。设置后,超过存储阈值的字符串值会上传到所引用的 Blob 存储(按 SHA-256 内容寻址),并在执行文档中替换为
$payloadRef描述符。为 null 或未设置时,大体积值会被截断为临时预览(带_truncated标记),工作流运行不依赖任何存储。
响应
-
200成功。 -
500执行此操作时出错。
curl -X POST https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"slug": "<slug>",
"organization_id": "<organization_id>",
"project_id": "<project_id>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"slug": "<slug>",
"organization_id": "<organization_id>",
"project_id": "<project_id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"name": "<name>",
"slug": "<slug>",
"organization_id": "<organization_id>",
"project_id": "<project_id>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"name": "Email classification and routing",
"slug": "flow.email_classify_and_route",
"description": "Flow definition that classifies inbound emails, routes them to the appropriate downstream systems and can later evolve into a multi-agent orchestration for case handling.\n",
"business_purpose": "Classify incoming emails and create tickets according to their category.",
"cognitive_role": "orchestration",
"category": "customer_support",
"tags": [
"email",
"classification",
"routing"
],
"organization_id": "org_blackwood_stone",
"project_id": "proj_core_operations",
"draft_nodes": [
{
"id": "trigger_email",
"type": "webhook.trigger",
"params": {
"path": "/ingress/email"
}
},
{
"id": "classify_email",
"type": "ai.classify",
"params": {
"labels": [
"billing",
"technical",
"complaint"
]
}
},
{
"id": "create_ticket",
"type": "http.request",
"params": {
"method": "POST",
"url": "https://tickets.example.com/api/v1/tickets"
}
}
],
"draft_edges": [
{
"from": {
"node_id": "trigger_email",
"port": "out"
},
"to": {
"node_id": "classify_email",
"port": "in"
}
},
{
"from": {
"node_id": "classify_email",
"port": "out"
},
"to": {
"node_id": "create_ticket",
"port": "in"
}
}
],
"trigger_ids": [
"trig_email_ingress"
],
"default_trigger_id": "trig_email_ingress",
"primary_agent_profile_id": "agent_support_router",
"agent_profile_ids": [
"agent_support_router",
"agent_quality_assistant"
],
"supports_concurrent_instances": true,
"max_concurrent_instances": 1000,
"default_timeout_ms": 600000,
"default_retry_policy": {
"max_attempts": 3,
"backoff_strategy": "exponential"
},
"editor_state": {
"zoom": 0.9,
"pan_x": 120,
"pan_y": -40
},
"latest_version_id": "flow:email-classify-and-post@v3",
"version_counter": 3,
"compiler_hints": {
"preferred_worker_pool": "standard",
"enable_optimistic_compilation": true
}
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}更新现有流程定义。
PATCH /workflow-orchestration/control-plane/flow-design/flow-definition/
使用所提供的数据更新现有流程定义。
认证: Bearer 令牌
请求体
要创建的 FlowDefinition 对象。
-
namestring 必填 -
在 Sommatic AI 中显示的流程定义名称(可读)。
-
slugstring 必填 -
在多个版本和部署之间标识同一逻辑流程的稳定语义键。
-
descriptionstring -
较长的自由文本描述,说明该流程的业务与运营目的。
-
business_purposestring -
简要说明该流程旨在支撑的组织职能或结果。
-
cognitive_rolestring -
该流程在组织认知体系中的总体角色,例如 "orchestration"、"monitoring"、"remediation"、"classification" 或 "decision_support"。
-
categorystring -
可选的类别或领域标签,用于在 Sommatic AI 工作区中对相关流程分组。
-
tagsarray<string> -
可选的标签列表,用于对流程定义进行分类、搜索和筛选。
-
organization_idstring 必填 -
拥有该流程定义的组织(租户)标识符。
-
project_idstring 必填 -
用于将该流程与相关自动化资产归组的项目标识符。
-
draft_graphobject -
描述该定义草稿流程结构的有向无环图。
-
nodesarray<NodeDefinitionModel> -
NodeDefinitionModel 实例列表,定义该流程定义中各节点的行为。
-
edgesarray<NodeEdgeModel> -
NodeEdgeModel 实例列表,描述该定义中节点之间的控制流。
-
-
trigger_idsarray<string> -
可启动或恢复该流程定义的 TriggerModel 标识符列表。
-
default_trigger_idstring -
作为该流程默认入口的 TriggerModel 标识符。
-
primary_agent_profile_idstring -
为该流程提供默认 AI 行为的主 AgentProfileModel 标识符。
-
agent_profile_idsarray<string> -
可选,以多智能体编排方式执行时可参与该流程的 AgentProfileModel 标识符列表。
-
supports_concurrent_instancesboolean -
表示在同一业务上下文中该流程的多个实例能否并行运行。
-
max_concurrent_instancesinteger -
可选,该流程定义允许的并发实例数上限。
-
default_timeout_msinteger -
可选,节点未设置超时时应用于流程实例的默认执行超时(毫秒)。
-
default_retry_policyobject -
可选,流程级默认重试策略,为未单独覆盖的节点提供重试基线行为,通常包括最大尝试次数和退避策略。
-
editor_stateobject -
可选,持久化的编辑器状态,例如画布位置、缩放级别和节点坐标,使可视化构建器能够恢复设计者上次使用的布局。
-
latest_version_idstring -
从该定义编译出的最新 FlowVersionModel 的标识符(如有)。
-
version_counterinteger -
用于从该定义生成连续 FlowVersionModel 版本号的单调递增计数器。
-
compiler_hintsobject -
可选的编译器提示和优化标志,影响该定义如何编译为 FlowVersionModel 实例,例如首选的 worker 池或执行策略。
-
execution_stateobject -
控制流程是否接受新执行的运营闸门,按执行模式(test、prod)分别设置。某一模式下为
paused: true时,所有分发入口(webhook、chain、scheduled、manual)都会跳过编排器执行。test 模式下不创建 FlowInstance(返回 423 Locked);prod 模式下会创建状态为paused的 FlowInstance 用于审计,但不会调用编排器。-
testobject -
-
pausedboolean -
paused_atstring -
paused_bystring -
paused_reasonstring
-
-
prodobject -
-
pausedboolean -
paused_atstring -
paused_bystring -
paused_reasonstring
-
-
-
output_configarray<object> -
定义查看工作流运行结果时,哪些节点输出作为有意义的结果展示。每个条目固定一个节点,并控制提取和显示哪些数据(output、metrics、meta)。
-
node_idstring -
其输出需纳入所配置结果的节点标识符。
-
labelstring -
该输出条目在结果视图中显示的可读标签。
-
displaystring -
显示模式:"full" 显示完整输出,"fields" 仅显示所选字段。
-
fieldsarray<string> -
当 display 为 "fields" 时,要提取的输出字段名列表。
-
include_metricsboolean -
是否包含该节点的执行指标(延迟、token 用量)。
-
include_metaboolean -
是否包含 meta 对象(评估详情、路由决策)。
-
orderinteger -
在结果视图中的显示顺序(数值小者在前)。
-
-
git_bindingobject -
该资源同步来源 Git 仓库的关联信息(参见 docs/concepts/git_sync.md):{ repository_id, repository, branch, environment, package_path, resource_key, file_path, last_synced_commit, last_synced_at, deployed_commit, deployed_at, deployed_version, unlinked, unlinked_at }。unlinked = true 表示当前安装不再从 Git 同步该资源。
-
persistence_store_idstring -
可选,引用一个载荷存储(WorkflowOrchestrationMemoryStore),用于定义该工作流大体积执行载荷的外置位置。设置后,超过存储阈值的字符串值会上传到所引用的 Blob 存储(按 SHA-256 内容寻址),并在执行文档中替换为
$payloadRef描述符。为 null 或未设置时,大体积值会被截断为临时预览(带_truncated标记),工作流运行不依赖任何存储。
响应
-
200成功。 -
500执行此操作时出错。
curl -X PATCH https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>",
"slug": "<slug>",
"organization_id": "<organization_id>",
"project_id": "<project_id>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<name>",
"slug": "<slug>",
"organization_id": "<organization_id>",
"project_id": "<project_id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.patch(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"name": "<name>",
"slug": "<slug>",
"organization_id": "<organization_id>",
"project_id": "<project_id>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"name": "Email classification and routing",
"slug": "flow.email_classify_and_route",
"description": "Flow definition that classifies inbound emails, routes them to the appropriate downstream systems and can later evolve into a multi-agent orchestration for case handling.\n",
"business_purpose": "Classify incoming emails and create tickets according to their category.",
"cognitive_role": "orchestration",
"category": "customer_support",
"tags": [
"email",
"classification",
"routing"
],
"organization_id": "org_blackwood_stone",
"project_id": "proj_core_operations",
"draft_nodes": [
{
"id": "trigger_email",
"type": "webhook.trigger",
"params": {
"path": "/ingress/email"
}
},
{
"id": "classify_email",
"type": "ai.classify",
"params": {
"labels": [
"billing",
"technical",
"complaint"
]
}
},
{
"id": "create_ticket",
"type": "http.request",
"params": {
"method": "POST",
"url": "https://tickets.example.com/api/v1/tickets"
}
}
],
"draft_edges": [
{
"from": {
"node_id": "trigger_email",
"port": "out"
},
"to": {
"node_id": "classify_email",
"port": "in"
}
},
{
"from": {
"node_id": "classify_email",
"port": "out"
},
"to": {
"node_id": "create_ticket",
"port": "in"
}
}
],
"trigger_ids": [
"trig_email_ingress"
],
"default_trigger_id": "trig_email_ingress",
"primary_agent_profile_id": "agent_support_router",
"agent_profile_ids": [
"agent_support_router",
"agent_quality_assistant"
],
"supports_concurrent_instances": true,
"max_concurrent_instances": 1000,
"default_timeout_ms": 600000,
"default_retry_policy": {
"max_attempts": 3,
"backoff_strategy": "exponential"
},
"editor_state": {
"zoom": 0.9,
"pan_x": 120,
"pan_y": -40
},
"latest_version_id": "flow:email-classify-and-post@v3",
"version_counter": 3,
"compiler_hints": {
"preferred_worker_pool": "standard",
"enable_optimistic_compilation": true
}
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}按 id 删除流程定义。
DELETE /workflow-orchestration/control-plane/flow-design/flow-definition/
根据所提供的 ID 删除流程定义。
认证: Bearer 令牌
请求体
要删除的流程定义 ID
-
idstring
响应
-
200成功。 -
500执行此操作时出错。
curl -X DELETE https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "<id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.delete(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"id": "<id>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "FlowDefinition successfully deleted",
"result": null
}{
"status": 500,
"success": false,
"message": "Something went wrong while performing this action",
"result": null
}暂停指定模式(test 或 prod)下的工作流执行。
POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/pause
运行闸门:阻止该工作流在所选模式下的新执行。test 模式下不会创建 FlowInstance(423 Locked);prod 模式下会创建一个状态为 paused 的 FlowInstance 用于审计。连接到该 flow_definition 的 SSE 客户端会收到 workflow-paused 事件。
认证: Bearer 令牌
参数
-
idstring 路径 必填
请求体
-
modestring - 可选值
testprod -
reasonstring -
actorstring -
发起暂停的操作人
user_id。
响应
curl -X POST https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/pause \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "test",
"reason": "<reason>",
"actor": "<actor>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/pause', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"mode": "test",
"reason": "<reason>",
"actor": "<actor>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/pause",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"mode": "test",
"reason": "<reason>",
"actor": "<actor>"
},
)
data = response.json()将当前草稿发布为新版本。
POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/publish
基于 draft_nodes / draft_edges 创建下一个 FlowVersion 并设为 is_default = true,清除之前的默认版本,并更新 latest_version_id / version_counter。由 Studio 的 Deploy 操作和 Git 同步调用。
认证: Bearer 令牌
参数
-
idstring 路径 必填
请求体
-
descriptionstring -
gitobject -
从 Git 发布时的来源:
{ repository, branch, commit, path, key }。
响应
-
200已创建的版本。
curl -X POST https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/publish \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "<description>",
"git": {}
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/publish', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"description": "<description>",
"git": {}
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/publish",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"description": "<description>",
"git": {}
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {}
}恢复指定模式(test 或 prod)下的工作流执行。
POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/resume
清除所选模式的暂停标志;新的分派恢复正常处理。
认证: Bearer 令牌
参数
-
idstring 路径 必填
请求体
-
modestring - 可选值
testprod -
actorstring -
发起恢复的操作人
user_id。
响应
curl -X POST https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/resume \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "test",
"actor": "<actor>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/resume', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"mode": "test",
"actor": "<actor>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/<id>/resume",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"mode": "test",
"actor": "<actor>"
},
)
data = response.json()按查询选择器获取流程定义。
GET /workflow-orchestration/control-plane/flow-design/flow-definition/{queryselector}
返回与路由中指定的查询选择器和搜索条件匹配的流程定义信息。
认证: Bearer 令牌
参数
-
queryselectorenum 路径 必填 -
此查询可用的筛选条件
idorganization-idallstatuses -
searchstring 查询 -
用于搜索实体的关键字。
-
include_statusstring 查询 -
可选的状态参数,用于包含指定状态的流程定义。
-
exclude_statusstring 查询 -
可选的状态参数,用于排除指定状态的流程定义。
-
pageinteger 查询 -
页码,从 1 开始(默认 1)。
-
pageSizeinteger 查询 -
每页记录数(默认 25)。
响应
-
200成功。 -
500执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"name": "Email classification and routing",
"slug": "flow.email_classify_and_route",
"description": "Flow definition that classifies inbound emails, routes them to the appropriate downstream systems and can later evolve into a multi-agent orchestration for case handling.\n",
"business_purpose": "Classify incoming emails and create tickets according to their category.",
"cognitive_role": "orchestration",
"category": "customer_support",
"tags": [
"email",
"classification",
"routing"
],
"organization_id": "org_blackwood_stone",
"project_id": "proj_core_operations",
"draft_nodes": [
{
"id": "trigger_email",
"type": "webhook.trigger",
"params": {
"path": "/ingress/email"
}
},
{
"id": "classify_email",
"type": "ai.classify",
"params": {
"labels": [
"billing",
"technical",
"complaint"
]
}
},
{
"id": "create_ticket",
"type": "http.request",
"params": {
"method": "POST",
"url": "https://tickets.example.com/api/v1/tickets"
}
}
],
"draft_edges": [
{
"from": {
"node_id": "trigger_email",
"port": "out"
},
"to": {
"node_id": "classify_email",
"port": "in"
}
},
{
"from": {
"node_id": "classify_email",
"port": "out"
},
"to": {
"node_id": "create_ticket",
"port": "in"
}
}
],
"trigger_ids": [
"trig_email_ingress"
],
"default_trigger_id": "trig_email_ingress",
"primary_agent_profile_id": "agent_support_router",
"agent_profile_ids": [
"agent_support_router",
"agent_quality_assistant"
],
"supports_concurrent_instances": true,
"max_concurrent_instances": 1000,
"default_timeout_ms": 600000,
"default_retry_policy": {
"max_attempts": 3,
"backoff_strategy": "exponential"
},
"editor_state": {
"zoom": 0.9,
"pan_x": 120,
"pan_y": -40
},
"latest_version_id": "flow:email-classify-and-post@v3",
"version_counter": 3,
"compiler_hints": {
"preferred_worker_pool": "standard",
"enable_optimistic_compilation": true
}
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}按查询选择器获取算子。
GET /workflow-orchestration/control-plane/operator-registry/operator/{queryselector}
返回与查询选择器匹配的算子数据。使用“catalog”从编排器获取实时目录,并附带各租户的授权信息;使用“catalog-slug”按 slug 获取单个算子;使用“entitlements”列出某个组织的授权。
认证: Bearer 令牌
参数
-
queryselectorenum 路径 必填 -
此查询的筛选条件
idorganization-idallstatusescatalogcatalog-slugentitlements -
searchstring 查询 -
用于搜索实体的关键字。
-
organization_idstring 查询 -
用于补充授权信息的组织 ID(与 catalog、catalog-slug、entitlements 配合使用)。
-
versionstring 查询 -
要解析的语义化版本(与 catalog-slug 配合使用)。默认为最新版本。
-
include_statusstring 查询 -
可选的状态参数,用于包含指定状态的模板。
-
exclude_statusstring 查询 -
可选的状态参数,用于排除指定状态的模板。
响应
-
200成功。 -
500执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/operator-registry/operator/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/operator-registry/operator/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/workflow-orchestration/control-plane/operator-registry/operator/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": {}
}创建触发器。
POST /workflow-orchestration/control-plane/trigger-configuration/trigger/
返回根据所提供数据创建的触发器。
认证: Bearer 令牌
请求体
要创建的 Trigger 对象。
-
organization_idstring 必填 -
该触发器关联的 OrganizationModel 标识符。
-
slugstring 必填 -
在目录中唯一标识该触发器的稳定语义键(例如 trigger:webhook.incoming)。
-
namestring 必填 -
在编辑器和文档中使用的可读名称。
-
typestring 必填 -
触发器类型,例如 "webhook"、"schedule"、"message"、"manual" 或 "external"。
-
descriptionstring -
外部事件源的详细说明,以及何时应使用该触发器。
-
target_flow_definition_idstring -
目标为流程定义时,该触发器关联的 FlowDefinitionModel 标识符。
-
target_flow_version_idstring -
目标为特定版本时,该触发器直接激活的 FlowVersionModel 标识符。
-
payload_mappingobject -
可选的映射规则,将外部输入(HTTP 请求体、消息载荷、cron 元数据)转换为 Sommatic AI 内部使用的信封结构。
-
securityobject -
可选的安全规则,描述入站事件所需的认证、允许的来源、密钥校验或租户约束。
-
webhookobject -
触发器类型为 "webhook" 时使用的配置块。
-
methodstring -
接受的 HTTP 方法(GET、POST 等)。
-
pathstring -
用于入口路由的 HTTP 路径。
-
require_signatureboolean -
请求是否必须包含签名请求头。
-
allowed_originsarray<string> -
可选,用于请求校验的允许来源列表。
-
-
scheduleobject -
触发器类型为 "schedule" 时使用的配置块。
-
cronstring -
驱动周期性激活的 cron 表达式。
-
timezonestring -
解析 cron 表达式时使用的时区。
-
-
messageobject -
基于消息的触发器(队列、主题、事件总线)的配置块。
-
channelstring -
要监听的消息队列、主题或订阅名称。
-
decodestring -
可选,用于解码入站消息的编解码器或格式(json、protobuf、base64 等)。
-
-
manualobject -
由用户或系统管理员手动启动的触发器配置。
-
allowed_rolesarray<string> -
可选,允许调用该触发器的用户角色列表。
-
-
externalobject -
外部系统触发器(如 CRM、ERP、IoT 或身份事件)的配置块。
-
source_systemstring -
发出事件的外部系统名称。
-
event_typestring -
从外部系统消费的事件类型。
-
-
default_instance_contextobject -
可选的默认上下文对象,会附加到通过该触发器启动的所有实例。
-
tagsarray<string> -
可选的自由格式标签列表,用于分组、发现和分析。
-
is_enabledboolean -
表示该触发器是否处于启用状态,能否启动或恢复流程。
-
is_systemboolean -
表示该触发器是否为内置系统触发器而非用户定义。
-
is_deprecatedboolean -
表示该触发器是否已弃用,新设计中应避免使用。
响应
-
200成功。 -
500执行此操作时出错。
curl -X POST https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "<organization_id>",
"slug": "<slug>",
"name": "<name>",
"type": "<type>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "<organization_id>",
"slug": "<slug>",
"name": "<name>",
"type": "<type>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "<organization_id>",
"slug": "<slug>",
"name": "<name>",
"type": "<type>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org.1234567890",
"slug": "trigger:webhook.incoming-email",
"name": "Incoming Email Webhook",
"type": "webhook",
"description": "Trigger activated when an external service posts an incoming email event.",
"target_flow_version_id": "flow.email_classify_and_route@1.3.0",
"payload_mapping": {
"map": {
"subject": "$.payload.subject",
"body": "$.payload.body",
"from": "$.payload.from"
}
},
"security": {
"require_signature": true,
"allowed_origins": [
"https://mailhooks.example.com"
]
},
"webhook": {
"method": "POST",
"path": "/ingress/email",
"require_signature": true,
"allowed_origins": [
"https://mailhooks.example.com"
]
},
"default_instance_context": {
"channel": "support",
"classification_mode": "enhanced"
},
"tags": [
"webhook",
"email",
"ingress"
],
"is_system": false
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}更新现有触发器。
PATCH /workflow-orchestration/control-plane/trigger-configuration/trigger/
使用所提供的数据更新现有触发器。
认证: Bearer 令牌
请求体
要创建的 Trigger 对象。
-
organization_idstring 必填 -
该触发器关联的 OrganizationModel 标识符。
-
slugstring 必填 -
在目录中唯一标识该触发器的稳定语义键(例如 trigger:webhook.incoming)。
-
namestring 必填 -
在编辑器和文档中使用的可读名称。
-
typestring 必填 -
触发器类型,例如 "webhook"、"schedule"、"message"、"manual" 或 "external"。
-
descriptionstring -
外部事件源的详细说明,以及何时应使用该触发器。
-
target_flow_definition_idstring -
目标为流程定义时,该触发器关联的 FlowDefinitionModel 标识符。
-
target_flow_version_idstring -
目标为特定版本时,该触发器直接激活的 FlowVersionModel 标识符。
-
payload_mappingobject -
可选的映射规则,将外部输入(HTTP 请求体、消息载荷、cron 元数据)转换为 Sommatic AI 内部使用的信封结构。
-
securityobject -
可选的安全规则,描述入站事件所需的认证、允许的来源、密钥校验或租户约束。
-
webhookobject -
触发器类型为 "webhook" 时使用的配置块。
-
methodstring -
接受的 HTTP 方法(GET、POST 等)。
-
pathstring -
用于入口路由的 HTTP 路径。
-
require_signatureboolean -
请求是否必须包含签名请求头。
-
allowed_originsarray<string> -
可选,用于请求校验的允许来源列表。
-
-
scheduleobject -
触发器类型为 "schedule" 时使用的配置块。
-
cronstring -
驱动周期性激活的 cron 表达式。
-
timezonestring -
解析 cron 表达式时使用的时区。
-
-
messageobject -
基于消息的触发器(队列、主题、事件总线)的配置块。
-
channelstring -
要监听的消息队列、主题或订阅名称。
-
decodestring -
可选,用于解码入站消息的编解码器或格式(json、protobuf、base64 等)。
-
-
manualobject -
由用户或系统管理员手动启动的触发器配置。
-
allowed_rolesarray<string> -
可选,允许调用该触发器的用户角色列表。
-
-
externalobject -
外部系统触发器(如 CRM、ERP、IoT 或身份事件)的配置块。
-
source_systemstring -
发出事件的外部系统名称。
-
event_typestring -
从外部系统消费的事件类型。
-
-
default_instance_contextobject -
可选的默认上下文对象,会附加到通过该触发器启动的所有实例。
-
tagsarray<string> -
可选的自由格式标签列表,用于分组、发现和分析。
-
is_enabledboolean -
表示该触发器是否处于启用状态,能否启动或恢复流程。
-
is_systemboolean -
表示该触发器是否为内置系统触发器而非用户定义。
-
is_deprecatedboolean -
表示该触发器是否已弃用,新设计中应避免使用。
响应
-
200成功。 -
500执行此操作时出错。
curl -X PATCH https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "<organization_id>",
"slug": "<slug>",
"name": "<name>",
"type": "<type>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "<organization_id>",
"slug": "<slug>",
"name": "<name>",
"type": "<type>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.patch(
"https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "<organization_id>",
"slug": "<slug>",
"name": "<name>",
"type": "<type>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org.1234567890",
"slug": "trigger:webhook.incoming-email",
"name": "Incoming Email Webhook",
"type": "webhook",
"description": "Trigger activated when an external service posts an incoming email event.",
"target_flow_version_id": "flow.email_classify_and_route@1.3.0",
"payload_mapping": {
"map": {
"subject": "$.payload.subject",
"body": "$.payload.body",
"from": "$.payload.from"
}
},
"security": {
"require_signature": true,
"allowed_origins": [
"https://mailhooks.example.com"
]
},
"webhook": {
"method": "POST",
"path": "/ingress/email",
"require_signature": true,
"allowed_origins": [
"https://mailhooks.example.com"
]
},
"default_instance_context": {
"channel": "support",
"classification_mode": "enhanced"
},
"tags": [
"webhook",
"email",
"ingress"
],
"is_system": false
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}按 id 删除触发器。
DELETE /workflow-orchestration/control-plane/trigger-configuration/trigger/
根据所提供的 ID 删除触发器。
认证: Bearer 令牌
请求体
要删除的触发器 ID
-
idstring
响应
-
200成功。 -
500执行此操作时出错。
curl -X DELETE https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "<id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.delete(
"https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"id": "<id>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Trigger successfully deleted",
"result": null
}{
"status": 500,
"success": false,
"message": "Something went wrong while performing this action",
"result": null
}按查询选择器获取触发器。
GET /workflow-orchestration/control-plane/trigger-configuration/trigger/{queryselector}
返回与路由中指定的查询选择器和搜索条件匹配的触发器信息。
认证: Bearer 令牌
参数
-
queryselectorenum 路径 必填 -
此查询可用的筛选条件
idorganization-idall -
searchstring 查询 -
用于搜索实体的关键字。
-
include_statusstring 查询 -
可选的状态参数,用于包含指定状态的触发器。
-
exclude_statusstring 查询 -
可选的状态参数,用于排除指定状态的触发器。
-
pageinteger 查询 -
页码,从 1 开始(默认 1)。
-
pageSizeinteger 查询 -
每页记录数(默认 25)。
响应
-
200成功。 -
500执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org.1234567890",
"slug": "trigger:webhook.incoming-email",
"name": "Incoming Email Webhook",
"type": "webhook",
"description": "Trigger activated when an external service posts an incoming email event.",
"target_flow_version_id": "flow.email_classify_and_route@1.3.0",
"payload_mapping": {
"map": {
"subject": "$.payload.subject",
"body": "$.payload.body",
"from": "$.payload.from"
}
},
"security": {
"require_signature": true,
"allowed_origins": [
"https://mailhooks.example.com"
]
},
"webhook": {
"method": "POST",
"path": "/ingress/email",
"require_signature": true,
"allowed_origins": [
"https://mailhooks.example.com"
]
},
"default_instance_context": {
"channel": "support",
"classification_mode": "enhanced"
},
"tags": [
"webhook",
"email",
"ingress"
],
"is_system": false
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}创建部署。
POST /workflow-orchestration/lifecycle/deployment/
返回根据所提供数据创建的部署。
认证: Bearer 令牌
请求体
要创建的 Deployment 对象。
-
organization_idstring 必填 -
部署该流程版本的 OrganizationModel 标识符。
-
flow_version_idstring 必填 -
正在部署的 FlowVersionModel 标识符。
-
flow_slugstring 必填 -
稳定的流程键,用于在不同版本和环境之间对同一逻辑流程的部署进行归组。
-
environment_idstring 必填 -
部署该流程版本的 EnvironmentModel 标识符。
-
environment_keystring 必填 -
语义化环境键,例如 "dev"、"staging"、"prod-eu",用于路由和配置。
-
deployment_statusstring 必填 -
当前部署生命周期状态:"pending"、"rolling_out"、"active"、"paused"、"failed"、"decommissioned"。
-
rollout_strategystring -
该部署采用的发布策略:"immediate"、"canary"、"blue-green"、"shadow" 或 "manual"。
-
is_activeboolean -
表示该部署当前是否可在其环境中接收流量。
-
is_defaultboolean -
为 true 表示该部署是此环境中该流程新实例的默认版本。
-
traffic_percentageinteger -
可选,使用金丝雀或多版本策略时路由到该部署的流量百分比。立即发布或单版本发布时通常为 100。
-
shadow_modeboolean -
为 true 时,该部署仅接收镜像流量用于观察,其结果不影响主流程的结果。
-
created_from_deployment_idstring -
可选,当该部署是作为另一部署的升级、克隆或蓝绿对应部署而创建时,引用先前的 DeploymentModel。
-
deployed_atinteger -
部署记录首次创建时的 Unix 时间戳。
-
activated_atinteger -
部署首次开始承接线上流量时的 Unix 时间戳。
-
deactivated_atinteger -
部署被停用或完全下线时的 Unix 时间戳。
-
notesstring -
可选,关于该部署的自由格式备注,例如变更摘要或发布理由。
响应
-
200成功。 -
500执行此操作时出错。
curl -X POST https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "<organization_id>",
"flow_version_id": "<flow_version_id>",
"flow_slug": "<flow_slug>",
"environment_id": "<environment_id>",
"environment_key": "<environment_key>",
"deployment_status": "<deployment_status>"
}'const response = await fetch('https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "<organization_id>",
"flow_version_id": "<flow_version_id>",
"flow_slug": "<flow_slug>",
"environment_id": "<environment_id>",
"environment_key": "<environment_key>",
"deployment_status": "<deployment_status>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "<organization_id>",
"flow_version_id": "<flow_version_id>",
"flow_slug": "<flow_slug>",
"environment_id": "<environment_id>",
"environment_key": "<environment_key>",
"deployment_status": "<deployment_status>"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org_1234567890",
"flow_version_id": "flow-def-email-routing:v1.3.0",
"flow_slug": "flow.email_classify_and_route",
"environment_id": "env_prod_us",
"environment_key": "prod",
"deployment_status": "rolling_out",
"rollout_strategy": "canary",
"is_active": true,
"is_default": false,
"traffic_percentage": 20,
"shadow_mode": false,
"created_from_deployment_id": "dep_flow.email_classify_and_route_v1_2_0_prod",
"deployed_at": 1735695600000,
"activated_at": 1735695660000,
"deactivated_at": null,
"notes": "Canary rollout of v1.3.0 with improved routing rules and PII redaction."
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}按查询选择器获取部署。
GET /workflow-orchestration/lifecycle/deployment/{queryselector}
返回与路由中指定的查询选择器和搜索条件匹配的部署信息。
认证: Bearer 令牌
参数
-
queryselectorenum 路径 必填 -
此查询可用的筛选条件
idorganization-idall -
searchstring 查询 -
用于搜索实体的关键字。
-
include_statusstring 查询 -
可选的状态参数,用于包含指定状态的部署。
-
exclude_statusstring 查询 -
可选的状态参数,用于排除指定状态的部署。
-
pageinteger 查询 -
页码,从 1 开始(默认 1)。
-
pageSizeinteger 查询 -
每页记录数(默认 25)。
响应
-
200成功。 -
500执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org_1234567890",
"flow_version_id": "flow-def-email-routing:v1.3.0",
"flow_slug": "flow.email_classify_and_route",
"environment_id": "env_prod_us",
"environment_key": "prod",
"deployment_status": "rolling_out",
"rollout_strategy": "canary",
"is_active": true,
"is_default": false,
"traffic_percentage": 20,
"shadow_mode": false,
"created_from_deployment_id": "dep_flow.email_classify_and_route_v1_2_0_prod",
"deployed_at": 1735695600000,
"activated_at": 1735695660000,
"deactivated_at": null,
"notes": "Canary rollout of v1.3.0 with improved routing rules and PII redaction."
}
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}