activities
latest
false
UiPath logo, featuring letters U and I in white

Integration Service Activities

Last updated Oct 9, 2025

Interact Agent

Description

This activity enables the use of Snowflake Cortex agents as participants in an automated process orchestrated by Maestro.

Creating the Snowflake Agent

Snowflake provides a no-code experience to create a Cortex Agent. As soon as it is saved, it becomes available for use in Maestro. The no-code experience includes the ability to test prompts and evaluate the agent output. The Cortex agent will reply to Maestro in the same way it replies to the user prompts in the Snowflake Dash Board. In most Maestro scenarios, you will prompt the agent to generate output in the form of a JSON structure. e.g. {"sku1": "9735A45", "sku2": "1735A50"}.

How to use the activity

To use this activity in a Maestro agentic process, follow these steps:

  1. Add a service task element to the canvas and open the task's Properties panel.
  2. Name the service task Snowflake Hello World.
  3. In the Implementation section, from the Action dropdown list, select Start and wait for external agent.
  4. Select the Snowflake Cortex connector.
  5. Select an existing connection or create a new one. For more information, see Snowflake Cortex authentication.
  6. From Activity, select Interact Agent.

  7. From Database, select a database, for example SNOWFLAKE_INTELLIGENCE.
  8. From Schema, select a schema, for example AGENTS.
  9. From Agent Name, select an agent previously created in Snowflake.
  10. In Prompt, enter "What can you do?". Make sure to include the quotes in the prompt.
    docs image
  11. Connect the start event to the service task, and the service task to an end event node in the canvas.

  12. Select Debug to run this process. After a successful run, review the global variables and look for the {:} response from the source: Snowflake Hello World. Take note of the structure of the reply.

    For example, this is the agent's response to the prompt "What can you do?":

    {
      "type": "text",
      "text": "\nI can help you analyze and optimize your manufacturing, inventory, order fulfillment, and sales forecasting processes. Here’s what I can do:\n\n- Query and analyze your inventory, orders, production forecasts, and sales forecasts using advanced SQL queries.\n- Answer questions about current inventory levels, order statuses, and customer orders.\n- Help you determine if current or future orders can be fulfilled based on available or forecasted inventory.\n- Provide insights into upcoming production and expected sales for specific products or SKUs.\n- Generate tables and visualizations (bar, line, and pie charts) to help you understand trends and patterns in your data.\n- Assist with business analytics, SaaS metrics, and research methodology for data-driven decision-making.\n\nYou don’t need to know SQL—just ask your business questions, and I’ll use the appropriate tools to get you answers!\n"
    }{
      "type": "text",
      "text": "\nI can help you analyze and optimize your manufacturing, inventory, order fulfillment, and sales forecasting processes. Here’s what I can do:\n\n- Query and analyze your inventory, orders, production forecasts, and sales forecasts using advanced SQL queries.\n- Answer questions about current inventory levels, order statuses, and customer orders.\n- Help you determine if current or future orders can be fulfilled based on available or forecasted inventory.\n- Provide insights into upcoming production and expected sales for specific products or SKUs.\n- Generate tables and visualizations (bar, line, and pie charts) to help you understand trends and patterns in your data.\n- Assist with business analytics, SaaS metrics, and research methodology for data-driven decision-making.\n\nYou don’t need to know SQL—just ask your business questions, and I’ll use the appropriate tools to get you answers!\n"
    }

The agent’s output must be assigned to a process variable so it can influence the progress of the Maestro process, for example to make a decision based on a boolean evaluation, or to use the answer from a classification task.

  1. In Design mode, select the agent from the design canvas.

  2. Select Properties.

  3. Under Output, select Add new and add a variable of type String named agent_reponse.

  4. For Value, select Snowflake Hello World > Response > Agent action text (string). This represents the text component of the reply.

Tip: In practice, specify the structured output of your choice from the agent, and then evaluate the output within Maestro using the Expression editor to extract the specific part of the output you need in the type necessary for your process flow.

Troubleshooting and Tuning

Beyond establishing connectivity, you should test prompts both in the Snowflake workspace as well as from Maestro. This ensures you achieve the desired output that can best be consumed by Maestro, assigned to variables, and passed on to other actors in the process.

We recommend that detailed prompts remain within the system prompts of the agent within Snowflake. The user prompt which is provided by Maestro to the agent at runtime should be brief and to the point. Its role is primarily to indicate the relevant variables needed by the agent to perform a specific tasks and generate an expected consistent output.

Output that is aimed at humans, for example the reasons for an escalation, can be easily passed as natural text for the human. Output that is expected for an API/robot action must be strictly composed. Here is an example user prompt that yields a specific output from an agent. Use the C# Expression editor within Studio to add variables as needed.
"What is the quantity on inventory of Order ID " + vars.orderId_1 + "respond only with a JSON object with the quantity in the key Order_Quantity. No explanations, only JSON""What is the quantity on inventory of Order ID " + vars.orderId_1 + "respond only with a JSON object with the quantity in the key Order_Quantity. No explanations, only JSON"

The agent will reply with:

{"Order_Quantity":"100"}{"Order_Quantity":"100"}
You can then turn the agent's response which is of type string into JSON using the js:JSON.parse(variable of type string) function. Pay special attention to types in your request to the agent and in the actual response. Even if the response looks like type JSON, it may actually be of type string.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo
Trust and Security
© 2005-2025 UiPath. All rights reserved.