studio-web
latest
false
- 发行说明
- 入门指南
- 面向 Administrator
- RPA 工作流项目
- 应用程序项目
- 智能体流程
- 智能体
- 解决方案
- API 工作流
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。

Studio Web 用户指南
上次更新日期 2025年11月20日
响应活动会终止 API 工作流,并向请求者发送结构化响应。响应通常包括状态和其他数据。
使用“响应”活动执行以下操作:
- 始终返回正确的状态和响应详细信息。
- 以清晰的结构化结果结束工作流。
- Handle errors gracefully, especially when combined with the Try/Catch activity.
“响应”活动应该是工作流中的最后一步,以确保流程提供预期信息。
备注:
Currently, schema validation is not enforced, so if the data returned in the Response activity includes more or fewer properties than those defined in the output schema, the workflow does not fail.
- Always configure your Output schema in the Data manager before adding a Response activity. When you define the schema first, the system automatically suggests aligning your Response activity with it.
- Use a Response step when your calling party, such as Maestro or an agent, expects a response.
- You can skip adding a Response when you are building system-to-system integrations or an unattended automation.
以下示例从 Workday 中检索工作器,并汇总有关其经理和直接下属的详细信息。
下图显示了示例工作流:
失败响应
如果任何检索步骤失败,工作流将返回“失败”状态,并显示一条错误消息。
为此,请执行以下操作:
- Wrap the retrieval steps inside a Try/Catch block.
- 如果发生错误,“捕获” 流程中的“错误响应” 步骤将返回结构化的失败响应。
- 类型— 失败
- 详细信息— 打开“表达式编辑器”,写入以下内容:
({ "error_message": $context.outputs.Try_Catch_3.error.title, "status": $context.outputs.Try_Catch_3.error.status })({ "error_message": $context.outputs.Try_Catch_3.error.title, "status": $context.outputs.Try_Catch_3.error.status })在这里,$context.outputs.Try_Catch_3.error提供来自Try-Catch活动的结构化错误输出。当“尝试”流程在执行期间遇到错误时,工作流将返回以下输出:
成功响应
工作流返回“成功”状态,以及汇总的工作器信息。即使只有一个匹配项, “按名称或 ID 搜索工作器”活动也会返回一个数组。在这里,我们使用遍历循环活动来处理每个结果,然后使用脚本活动合并数据。
使用以下详细信息配置“响应” :
- “类型” — 成功
- 详细信息— 打开“表达式编辑器”,写入以下内容:
({ "workers": $context.outputs.For_Each_2.results })({ "workers": $context.outputs.For_Each_2.results })在这里,workers包含“遍历 循环”的“脚本” 步骤的汇总输出。工作流将返回以下输出: