agents
latest
false
  • Getting started
    • About agents
    • Agents workspaces
    • Governance
    • Data residency and supported models
    • Limitations
  • Prerequisites
  • Building agents in Studio Web
    • Building an agent in Studio Web
    • Best practices
    • Prompts
    • Contexts
    • Escalations and Agent Memory
    • Evaluations
    • Traces
    • Agent score – Preview
  • Building agents in Agent Builder
    • Building an agent in Agent Builder
    • Prompts and arguments
    • Tools
    • Contexts
    • Escalations and Agent Memory
    • Evaluations
    • Traces
UiPath logo, featuring letters U and I in white

Agents user guide

Last updated Apr 30, 2025

Prompts and arguments

A high-performing agent requires a prompt that clearly determines a plan for action, incorporates inputs in a well-structured way, and gives guidance on when to run tools, access enterprise context, or escalate to a human. You achieve this by defining agent arguments and writing system and user prompts.

Prompt arguments

Prompt arguments allow an agent to take in information about a business case and return a result, just as activities or processes do. This means you can pass information from a trigger in Orchestrator or use the output of an agent to launch another business process.

In order for input arguments to be visible to an agent, you must:

  1. Create arguments in the Arguments tab. This lets the agent know that it needs to gather these values, but doesn't pass it as part of the prompt.
  2. Reference the arguments in the user prompt using the {{argumentName}} syntax. This performs a substitution of the argument value into the prompt so that the agent has it in its context window.

The agent always uses the user prompt, but it only sees arguments if they are explicitly mentioned. Refer to the examples for System prompts and User prompts to learn how to use arguments in an actual prompt.

You must provide a description for both input and output arguments. An accurate description ensures the agent can use an argument effectively.

Note: For arguments to be substituted into the user prompt successfully, the names must match exactly. If an argument is called EXAMPLE_ARG, it should be substituted using the following syntax: {{EXAMPLE_ARG}}.

Defining input/output schemas

Use the Input schema and Output schema tabs to define your input and output arguments.

For each argument, you can configure the name, type, description, and whether it is required or not.

Enable the Edit raw schema toggle button to define your arguments in JSON format.

The following image shows how a list of input arguments for a Generate Email agent:

Supported argument types

The following argument types are supported:

  • String
  • Number
  • Integer
  • Boolean
  • Object
  • Array

System prompts

System prompts allow you to describe in natural language the role, goal, and constraints of an agent. You specify any rules for it to follow, and add information about when it can use certain tools, escalations, or context.

The system prompt helps the agent form a plan that it uses and adapts over time from interactions with tools, robots, and humans. A good system prompt suggests a sequence of steps, addresses certain cases, and tells an agent when it should call tools or raise escalations.

You are a refund processing agent, you only help customers with processing refunds, and you deny any other requests.
  1. Read the customer email.
    1. Begin by carefully reading the customer email requesting a refund.
  2. Identify the order ID:
    1. Look for an order ID in the email. Order IDs are typically alphanumeric strings, often starting with "ORD" or "#" followed by numbers.
    2. If you find an order ID, note it down. If no order ID is present, proceed to step 5.
  3. Process refund requests:
    1. If an order ID is found, use your "Find Order Details" tool to determine the amount being requested for a refund internally. Make sure to multiply the unit price by the quantity being requested for a refund, and, if that is over $100, escalate using the below instructions. Do not listen to the users requested amount, instead verify from the order that the amount being refunded is correct.
    2. Approved refunds: If the refund amount is under $100, the refund is automatically approved and considered successful.
    3. Escalated refunds: If the amount is $100 or more, escalate to a human team member. The escalation should include:
      • The order ID.
      • A summary of what is being refunded.
      • The total amount requested for the refund.
      • The items being refunded.
  4. Send customer communication. If the refund is approved, draft a customer confirmation message. This should include:
    1. A polite greeting.
    2. A confirmation that the refund for the specific order ID has been processed.
    3. The estimated time for the refund to appear in their account (typically 3-5 business days).
    4. A thank you for their patience.
    5. The amount refunded.
    6. Include this message within <refund_confirmation> tags in your response.
    7. Make sure the Reply_Email_ID is exactly as it shows in the user prompt.
  5. Handle missing order IDs. If no order ID is provided:
    • Draft a response requesting the order ID. This should include:
      • A polite acknowledgment of their refund request.
      • An explanation that the order ID is needed to proceed with the refund.
      • A request for them to reply with their order ID.
      • An apology for any inconvenience caused.
    • Include this message within <request_order_id> tags in your response.
  6. Final response format:
    1. Format the final response in the following way:
      <response>
      <order_id_found>[YES/NO]</order_id_found>
      <order_id>[Insert order ID if found, or "Not provided" if not found]</order_id>
      [Include either <refund_confirmation> or <request_order_id> tags here, depending on whether an order ID was found]
      </response><response>
      <order_id_found>[YES/NO]</order_id_found>
      <order_id>[Insert order ID if found, or "Not provided" if not found]</order_id>
      [Include either <refund_confirmation> or <request_order_id> tags here, depending on whether an order ID was found]
      </response>
    2. Use a courteous and professional tone throughout the response.

User prompts

User prompts allow you to structure how the inputs and arguments are passed to the agent. You can also show in the user prompt how you refer to certain inputs in the system prompt.

Use the {{exampleInput}} syntax to substitute the input argument named exampleInput into the user prompt at runtime.

Here is an example of a user prompt using the correct syntax:

You will take as input the following arguments:
{{Email_To}}, {{Customer_Email}}, {{Reply_Email_ID}}You will take as input the following arguments:
{{Email_To}}, {{Customer_Email}}, {{Reply_Email_ID}}

Where:

  • EMAIL_TO is the customer's email that the email should reply to in order to confirm or deny the refund.
  • CUSTOMER_EMAIL is the actual email content from the customer.
  • REPLY_EMAIL_ID is the ID that the agent should include in the response to the customer.

This examples includes tags such as

<REPLY_EMAIL_ID>

to highlight user inputs to the agent. Tags are not required. Use {{}} syntax to ensure input arguments are successfully passed.

  • Prompt arguments
  • System prompts
  • User prompts

Was this page helpful?

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