本页内容
Sommatic 文档
打开控制台

工作流设计 Beta

流程定义、版本、发布、部署、触发器与算子目录。

以 Markdown 查看
在以下应用中打开

按查询选择器获取流程版本。

GET /workflow-orchestration/control-plane/flow-compilation/flow-version/{queryselector}

返回与路由中指定的查询选择器和搜索条件匹配的 FlowVersion 信息。

认证: Bearer 令牌

参数

queryselector enum 路径 必填

此查询可用的筛选条件

idorganization-idflow-definition-idall

search string 查询

用于搜索实体的关键字。

include_status string 查询

可选的状态参数,用于包含指定状态的流程版本。

exclude_status string 查询

可选的状态参数,用于排除指定状态的流程版本。

page integer 查询

页码,从 1 开始(默认 1)。

pageSize integer 查询

每页记录数(默认 25)。

响应

  • 200 成功。
  • 500 执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/flow-compilation/flow-version/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
响应
{
  "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"
  }
}

创建流程定义。

POST /workflow-orchestration/control-plane/flow-design/flow-definition/

返回根据所提供数据创建的流程定义。

认证: Bearer 令牌

请求体

要创建的 FlowDefinition 对象。

name string 必填

在 Sommatic AI 中显示的流程定义名称(可读)。

slug string 必填

在多个版本和部署之间标识同一逻辑流程的稳定语义键。

description string

较长的自由文本描述,说明该流程的业务与运营目的。

business_purpose string

简要说明该流程旨在支撑的组织职能或结果。

cognitive_role string

该流程在组织认知体系中的总体角色,例如 "orchestration"、"monitoring"、"remediation"、"classification" 或 "decision_support"。

category string

可选的类别或领域标签,用于在 Sommatic AI 工作区中对相关流程分组。

tags array<string>

可选的标签列表,用于对流程定义进行分类、搜索和筛选。

organization_id string 必填

拥有该流程定义的组织(租户)标识符。

project_id string 必填

用于将该流程与相关自动化资产归组的项目标识符。

draft_graph object

描述该定义草稿流程结构的有向无环图。

nodes array<NodeDefinitionModel>

NodeDefinitionModel 实例列表,定义该流程定义中各节点的行为。

edges array<NodeEdgeModel>

NodeEdgeModel 实例列表,描述该定义中节点之间的控制流。

trigger_ids array<string>

可启动或恢复该流程定义的 TriggerModel 标识符列表。

default_trigger_id string

作为该流程默认入口的 TriggerModel 标识符。

primary_agent_profile_id string

为该流程提供默认 AI 行为的主 AgentProfileModel 标识符。

agent_profile_ids array<string>

可选,以多智能体编排方式执行时可参与该流程的 AgentProfileModel 标识符列表。

supports_concurrent_instances boolean

表示在同一业务上下文中该流程的多个实例能否并行运行。

max_concurrent_instances integer

可选,该流程定义允许的并发实例数上限。

default_timeout_ms integer

可选,节点未设置超时时应用于流程实例的默认执行超时(毫秒)。

default_retry_policy object

可选,流程级默认重试策略,为未单独覆盖的节点提供重试基线行为,通常包括最大尝试次数和退避策略。

editor_state object

可选,持久化的编辑器状态,例如画布位置、缩放级别和节点坐标,使可视化构建器能够恢复设计者上次使用的布局。

latest_version_id string

从该定义编译出的最新 FlowVersionModel 的标识符(如有)。

version_counter integer

用于从该定义生成连续 FlowVersionModel 版本号的单调递增计数器。

compiler_hints object

可选的编译器提示和优化标志,影响该定义如何编译为 FlowVersionModel 实例,例如首选的 worker 池或执行策略。

execution_state object

控制流程是否接受新执行的运营闸门,按执行模式(test、prod)分别设置。某一模式下为 paused: true 时,所有分发入口(webhook、chain、scheduled、manual)都会跳过编排器执行。test 模式下不创建 FlowInstance(返回 423 Locked);prod 模式下会创建状态为 paused 的 FlowInstance 用于审计,但不会调用编排器。

test object
paused boolean
paused_at string
paused_by string
paused_reason string
prod object
paused boolean
paused_at string
paused_by string
paused_reason string
output_config array<object>

定义查看工作流运行结果时,哪些节点输出作为有意义的结果展示。每个条目固定一个节点,并控制提取和显示哪些数据(output、metrics、meta)。

node_id string

其输出需纳入所配置结果的节点标识符。

label string

该输出条目在结果视图中显示的可读标签。

display string

显示模式:"full" 显示完整输出,"fields" 仅显示所选字段。

fields array<string>

当 display 为 "fields" 时,要提取的输出字段名列表。

include_metrics boolean

是否包含该节点的执行指标(延迟、token 用量)。

include_meta boolean

是否包含 meta 对象(评估详情、路由决策)。

order integer

在结果视图中的显示顺序(数值小者在前)。

git_binding object

该资源同步来源 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_id string

可选,引用一个载荷存储(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>"
  }'
响应
{
  "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
    }
  }
}

更新现有流程定义。

PATCH /workflow-orchestration/control-plane/flow-design/flow-definition/

使用所提供的数据更新现有流程定义。

认证: Bearer 令牌

请求体

要创建的 FlowDefinition 对象。

name string 必填

在 Sommatic AI 中显示的流程定义名称(可读)。

slug string 必填

在多个版本和部署之间标识同一逻辑流程的稳定语义键。

description string

较长的自由文本描述,说明该流程的业务与运营目的。

business_purpose string

简要说明该流程旨在支撑的组织职能或结果。

cognitive_role string

该流程在组织认知体系中的总体角色,例如 "orchestration"、"monitoring"、"remediation"、"classification" 或 "decision_support"。

category string

可选的类别或领域标签,用于在 Sommatic AI 工作区中对相关流程分组。

tags array<string>

可选的标签列表,用于对流程定义进行分类、搜索和筛选。

organization_id string 必填

拥有该流程定义的组织(租户)标识符。

project_id string 必填

用于将该流程与相关自动化资产归组的项目标识符。

draft_graph object

描述该定义草稿流程结构的有向无环图。

nodes array<NodeDefinitionModel>

NodeDefinitionModel 实例列表,定义该流程定义中各节点的行为。

edges array<NodeEdgeModel>

NodeEdgeModel 实例列表,描述该定义中节点之间的控制流。

trigger_ids array<string>

可启动或恢复该流程定义的 TriggerModel 标识符列表。

default_trigger_id string

作为该流程默认入口的 TriggerModel 标识符。

primary_agent_profile_id string

为该流程提供默认 AI 行为的主 AgentProfileModel 标识符。

agent_profile_ids array<string>

可选,以多智能体编排方式执行时可参与该流程的 AgentProfileModel 标识符列表。

supports_concurrent_instances boolean

表示在同一业务上下文中该流程的多个实例能否并行运行。

max_concurrent_instances integer

可选,该流程定义允许的并发实例数上限。

default_timeout_ms integer

可选,节点未设置超时时应用于流程实例的默认执行超时(毫秒)。

default_retry_policy object

可选,流程级默认重试策略,为未单独覆盖的节点提供重试基线行为,通常包括最大尝试次数和退避策略。

editor_state object

可选,持久化的编辑器状态,例如画布位置、缩放级别和节点坐标,使可视化构建器能够恢复设计者上次使用的布局。

latest_version_id string

从该定义编译出的最新 FlowVersionModel 的标识符(如有)。

version_counter integer

用于从该定义生成连续 FlowVersionModel 版本号的单调递增计数器。

compiler_hints object

可选的编译器提示和优化标志,影响该定义如何编译为 FlowVersionModel 实例,例如首选的 worker 池或执行策略。

execution_state object

控制流程是否接受新执行的运营闸门,按执行模式(test、prod)分别设置。某一模式下为 paused: true 时,所有分发入口(webhook、chain、scheduled、manual)都会跳过编排器执行。test 模式下不创建 FlowInstance(返回 423 Locked);prod 模式下会创建状态为 paused 的 FlowInstance 用于审计,但不会调用编排器。

test object
paused boolean
paused_at string
paused_by string
paused_reason string
prod object
paused boolean
paused_at string
paused_by string
paused_reason string
output_config array<object>

定义查看工作流运行结果时,哪些节点输出作为有意义的结果展示。每个条目固定一个节点,并控制提取和显示哪些数据(output、metrics、meta)。

node_id string

其输出需纳入所配置结果的节点标识符。

label string

该输出条目在结果视图中显示的可读标签。

display string

显示模式:"full" 显示完整输出,"fields" 仅显示所选字段。

fields array<string>

当 display 为 "fields" 时,要提取的输出字段名列表。

include_metrics boolean

是否包含该节点的执行指标(延迟、token 用量)。

include_meta boolean

是否包含 meta 对象(评估详情、路由决策)。

order integer

在结果视图中的显示顺序(数值小者在前)。

git_binding object

该资源同步来源 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_id string

可选,引用一个载荷存储(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>"
  }'
响应
{
  "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
    }
  }
}

按 id 删除流程定义。

DELETE /workflow-orchestration/control-plane/flow-design/flow-definition/

根据所提供的 ID 删除流程定义。

认证: Bearer 令牌

请求体

要删除的流程定义 ID

id string

响应

  • 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>"
  }'
响应
{
  "status": 200,
  "success": true,
  "message": "FlowDefinition successfully deleted",
  "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 令牌

参数

id string 路径 必填

请求体

mode string
可选值 testprod
reason string
actor string

发起暂停的操作人 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>"
  }'

将当前草稿发布为新版本。

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 令牌

参数

id string 路径 必填

请求体

description string
git object

从 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": {}
  }'
响应 200
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {}
}

恢复指定模式(test 或 prod)下的工作流执行。

POST /workflow-orchestration/control-plane/flow-design/flow-definition/{id}/resume

清除所选模式的暂停标志;新的分派恢复正常处理。

认证: Bearer 令牌

参数

id string 路径 必填

请求体

mode string
可选值 testprod
actor string

发起恢复的操作人 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>"
  }'

按查询选择器获取流程定义。

GET /workflow-orchestration/control-plane/flow-design/flow-definition/{queryselector}

返回与路由中指定的查询选择器和搜索条件匹配的流程定义信息。

认证: Bearer 令牌

参数

queryselector enum 路径 必填

此查询可用的筛选条件

idorganization-idallstatuses

search string 查询

用于搜索实体的关键字。

include_status string 查询

可选的状态参数,用于包含指定状态的流程定义。

exclude_status string 查询

可选的状态参数,用于排除指定状态的流程定义。

page integer 查询

页码,从 1 开始(默认 1)。

pageSize integer 查询

每页记录数(默认 25)。

响应

  • 200 成功。
  • 500 执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/flow-design/flow-definition/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
响应
{
  "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
    }
  }
}

按查询选择器获取算子。

GET /workflow-orchestration/control-plane/operator-registry/operator/{queryselector}

返回与查询选择器匹配的算子数据。使用“catalog”从编排器获取实时目录,并附带各租户的授权信息;使用“catalog-slug”按 slug 获取单个算子;使用“entitlements”列出某个组织的授权。

认证: Bearer 令牌

参数

queryselector enum 路径 必填

此查询的筛选条件

idorganization-idallstatusescatalogcatalog-slugentitlements

search string 查询

用于搜索实体的关键字。

organization_id string 查询

用于补充授权信息的组织 ID(与 catalog、catalog-slug、entitlements 配合使用)。

version string 查询

要解析的语义化版本(与 catalog-slug 配合使用)。默认为最新版本。

include_status string 查询

可选的状态参数,用于包含指定状态的模板。

exclude_status string 查询

可选的状态参数,用于排除指定状态的模板。

响应

  • 200 成功。
  • 500 执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/operator-registry/operator/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
响应
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {}
}

创建触发器。

POST /workflow-orchestration/control-plane/trigger-configuration/trigger/

返回根据所提供数据创建的触发器。

认证: Bearer 令牌

请求体

要创建的 Trigger 对象。

organization_id string 必填

该触发器关联的 OrganizationModel 标识符。

slug string 必填

在目录中唯一标识该触发器的稳定语义键(例如 trigger:webhook.incoming)。

name string 必填

在编辑器和文档中使用的可读名称。

type string 必填

触发器类型,例如 "webhook"、"schedule"、"message"、"manual" 或 "external"。

description string

外部事件源的详细说明,以及何时应使用该触发器。

target_flow_definition_id string

目标为流程定义时,该触发器关联的 FlowDefinitionModel 标识符。

target_flow_version_id string

目标为特定版本时,该触发器直接激活的 FlowVersionModel 标识符。

payload_mapping object

可选的映射规则,将外部输入(HTTP 请求体、消息载荷、cron 元数据)转换为 Sommatic AI 内部使用的信封结构。

security object

可选的安全规则,描述入站事件所需的认证、允许的来源、密钥校验或租户约束。

webhook object

触发器类型为 "webhook" 时使用的配置块。

method string

接受的 HTTP 方法(GET、POST 等)。

path string

用于入口路由的 HTTP 路径。

require_signature boolean

请求是否必须包含签名请求头。

allowed_origins array<string>

可选,用于请求校验的允许来源列表。

schedule object

触发器类型为 "schedule" 时使用的配置块。

cron string

驱动周期性激活的 cron 表达式。

timezone string

解析 cron 表达式时使用的时区。

message object

基于消息的触发器(队列、主题、事件总线)的配置块。

channel string

要监听的消息队列、主题或订阅名称。

decode string

可选,用于解码入站消息的编解码器或格式(json、protobuf、base64 等)。

manual object

由用户或系统管理员手动启动的触发器配置。

allowed_roles array<string>

可选,允许调用该触发器的用户角色列表。

external object

外部系统触发器(如 CRM、ERP、IoT 或身份事件)的配置块。

source_system string

发出事件的外部系统名称。

event_type string

从外部系统消费的事件类型。

default_instance_context object

可选的默认上下文对象,会附加到通过该触发器启动的所有实例。

tags array<string>

可选的自由格式标签列表,用于分组、发现和分析。

is_enabled boolean

表示该触发器是否处于启用状态,能否启动或恢复流程。

is_system boolean

表示该触发器是否为内置系统触发器而非用户定义。

is_deprecated boolean

表示该触发器是否已弃用,新设计中应避免使用。

响应

  • 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>"
  }'
响应
{
  "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": "[email protected]",
    "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
  }
}

更新现有触发器。

PATCH /workflow-orchestration/control-plane/trigger-configuration/trigger/

使用所提供的数据更新现有触发器。

认证: Bearer 令牌

请求体

要创建的 Trigger 对象。

organization_id string 必填

该触发器关联的 OrganizationModel 标识符。

slug string 必填

在目录中唯一标识该触发器的稳定语义键(例如 trigger:webhook.incoming)。

name string 必填

在编辑器和文档中使用的可读名称。

type string 必填

触发器类型,例如 "webhook"、"schedule"、"message"、"manual" 或 "external"。

description string

外部事件源的详细说明,以及何时应使用该触发器。

target_flow_definition_id string

目标为流程定义时,该触发器关联的 FlowDefinitionModel 标识符。

target_flow_version_id string

目标为特定版本时,该触发器直接激活的 FlowVersionModel 标识符。

payload_mapping object

可选的映射规则,将外部输入(HTTP 请求体、消息载荷、cron 元数据)转换为 Sommatic AI 内部使用的信封结构。

security object

可选的安全规则,描述入站事件所需的认证、允许的来源、密钥校验或租户约束。

webhook object

触发器类型为 "webhook" 时使用的配置块。

method string

接受的 HTTP 方法(GET、POST 等)。

path string

用于入口路由的 HTTP 路径。

require_signature boolean

请求是否必须包含签名请求头。

allowed_origins array<string>

可选,用于请求校验的允许来源列表。

schedule object

触发器类型为 "schedule" 时使用的配置块。

cron string

驱动周期性激活的 cron 表达式。

timezone string

解析 cron 表达式时使用的时区。

message object

基于消息的触发器(队列、主题、事件总线)的配置块。

channel string

要监听的消息队列、主题或订阅名称。

decode string

可选,用于解码入站消息的编解码器或格式(json、protobuf、base64 等)。

manual object

由用户或系统管理员手动启动的触发器配置。

allowed_roles array<string>

可选,允许调用该触发器的用户角色列表。

external object

外部系统触发器(如 CRM、ERP、IoT 或身份事件)的配置块。

source_system string

发出事件的外部系统名称。

event_type string

从外部系统消费的事件类型。

default_instance_context object

可选的默认上下文对象,会附加到通过该触发器启动的所有实例。

tags array<string>

可选的自由格式标签列表,用于分组、发现和分析。

is_enabled boolean

表示该触发器是否处于启用状态,能否启动或恢复流程。

is_system boolean

表示该触发器是否为内置系统触发器而非用户定义。

is_deprecated boolean

表示该触发器是否已弃用,新设计中应避免使用。

响应

  • 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>"
  }'
响应
{
  "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": "[email protected]",
    "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
  }
}

按 id 删除触发器。

DELETE /workflow-orchestration/control-plane/trigger-configuration/trigger/

根据所提供的 ID 删除触发器。

认证: Bearer 令牌

请求体

要删除的触发器 ID

id string

响应

  • 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>"
  }'
响应
{
  "status": 200,
  "success": true,
  "message": "Trigger successfully deleted",
  "result": null
}

按查询选择器获取触发器。

GET /workflow-orchestration/control-plane/trigger-configuration/trigger/{queryselector}

返回与路由中指定的查询选择器和搜索条件匹配的触发器信息。

认证: Bearer 令牌

参数

queryselector enum 路径 必填

此查询可用的筛选条件

idorganization-idall

search string 查询

用于搜索实体的关键字。

include_status string 查询

可选的状态参数,用于包含指定状态的触发器。

exclude_status string 查询

可选的状态参数,用于排除指定状态的触发器。

page integer 查询

页码,从 1 开始(默认 1)。

pageSize integer 查询

每页记录数(默认 25)。

响应

  • 200 成功。
  • 500 执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/control-plane/trigger-configuration/trigger/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
响应
{
  "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": "[email protected]",
    "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
  }
}

创建部署。

POST /workflow-orchestration/lifecycle/deployment/

返回根据所提供数据创建的部署。

认证: Bearer 令牌

请求体

要创建的 Deployment 对象。

organization_id string 必填

部署该流程版本的 OrganizationModel 标识符。

flow_version_id string 必填

正在部署的 FlowVersionModel 标识符。

flow_slug string 必填

稳定的流程键,用于在不同版本和环境之间对同一逻辑流程的部署进行归组。

environment_id string 必填

部署该流程版本的 EnvironmentModel 标识符。

environment_key string 必填

语义化环境键,例如 "dev"、"staging"、"prod-eu",用于路由和配置。

deployment_status string 必填

当前部署生命周期状态:"pending"、"rolling_out"、"active"、"paused"、"failed"、"decommissioned"。

rollout_strategy string

该部署采用的发布策略:"immediate"、"canary"、"blue-green"、"shadow" 或 "manual"。

is_active boolean

表示该部署当前是否可在其环境中接收流量。

is_default boolean

为 true 表示该部署是此环境中该流程新实例的默认版本。

traffic_percentage integer

可选,使用金丝雀或多版本策略时路由到该部署的流量百分比。立即发布或单版本发布时通常为 100。

shadow_mode boolean

为 true 时,该部署仅接收镜像流量用于观察,其结果不影响主流程的结果。

created_from_deployment_id string

可选,当该部署是作为另一部署的升级、克隆或蓝绿对应部署而创建时,引用先前的 DeploymentModel。

deployed_at integer

部署记录首次创建时的 Unix 时间戳。

activated_at integer

部署首次开始承接线上流量时的 Unix 时间戳。

deactivated_at integer

部署被停用或完全下线时的 Unix 时间戳。

notes string

可选,关于该部署的自由格式备注,例如变更摘要或发布理由。

响应

  • 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>"
  }'
响应
{
  "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."
  }
}

按查询选择器获取部署。

GET /workflow-orchestration/lifecycle/deployment/{queryselector}

返回与路由中指定的查询选择器和搜索条件匹配的部署信息。

认证: Bearer 令牌

参数

queryselector enum 路径 必填

此查询可用的筛选条件

idorganization-idall

search string 查询

用于搜索实体的关键字。

include_status string 查询

可选的状态参数,用于包含指定状态的部署。

exclude_status string 查询

可选的状态参数,用于排除指定状态的部署。

page integer 查询

页码,从 1 开始(默认 1)。

pageSize integer 查询

每页记录数(默认 25)。

响应

  • 200 成功。
  • 500 执行此操作时出错。
curl -X GET https://api.sommatic.ai/workflow-orchestration/lifecycle/deployment/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
响应
{
  "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."
  }
}

安装智能体工具

为你的编程智能体接入 Sommatic AI 官方文档:技能包、文档 MCP 服务器与 Markdown 页面,无需再抓取网页。

仅安装技能包,不会自动更新;需要时重新运行即可。

npx skills add https://docs.sommatic.ai
智能体如何读取本文档