studio-web
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

Studio Web 用户指南

上次更新日期 2025年10月31日

Integrating Snowflake Cortex API with API workflows

Snowflake Cortex Agents unlock natural language interaction with your data, helping you query, analyze, and act on enterprise datasets.

This workflow acts as an intermediary to run an "ORDERS_AGENT" in Snowflake. It takes a question as input, sends it to the Snowflake Cortex Agent API, and then returns the API response directly as the workflow output.

docs image

先决条件

First, you need to have a Cortex Agent set up in your Snowflake account.
  1. (可选)创建 API 工作流
  2. Define workflow inputs. Open Data manager and add a new Inputs parameter with the following configuration:
    • Name—Question
    • Type—String
    • Leave the Required checkbox empty.
  3. 添加HTTP活动并进行如下配置:
    • 方法— POST
    • Request URL—Provide the Cortex Agent run endpoint, specific to your Snowflake account and agent, for example "https://{your_snowflake_env}/api/v2/databases/SNOWFLAKE_INTELLIGENCE/schemas/AGENTS/agents/ORDERS_AGENT:run"
    • Headers
      {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer <Add your snowflake_token here>"
      }{
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "Bearer <Add your snowflake_token here>"
      }
    • Request body
      {
          "messages": [
              {
                  "role": "user",
                  "content": [
                      {
                          "type": "text",
                          "text": $workflow.input.Question
                      }
                  ]
              }
          ],
          "toolChoice": {
              "type": "auto"
          }
      }{
          "messages": [
              {
                  "role": "user",
                  "content": [
                      {
                          "type": "text",
                          "text": $workflow.input.Question
                      }
                  ]
              }
          ],
          "toolChoice": {
              "type": "auto"
          }
      }
  4. Add a Response activity and leave it as is. This captures and returns the output from the Cortex agent as a JSON.
  5. Run the integration. Once deployed, you can invoke the workflow with any natural language query. The workflow passes the question to the Cortex Agent, receives the streaming output, and returns a structured JSON response that can be used in downstream automations.

Key take-aways:

  • Streaming is seamless – Although Cortex API is streaming-only, the API workflow built-in support meant no additional coding was required to parse and collect results.
  • Consistent API contract – All Cortex Agents share the same request/response shape. Your integration does not need to change as your agents become more advanced.
  • Rapid prototyping – From setup to working integration took minutes. This speed allows teams to quickly validate use cases and iterate.
  • 先决条件

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。