Advice on dynamic system and user prompt

Hey everyone,

I’m currently learning the process of building an Agentic Automation, and I wanted to know if it’s possible to keep the system prompt and user prompt dynamic?

An example:

  • A user sends an email containing the system prompt
  • That system prompt must be updated in the Agent Builder

An explanation would suffice, don’t need a workflow.

Yes, it is absolutely possible to make the system prompt and user prompt dynamic in an Agentic Automation setup — including one built with UiPath’s Agent Builder, OpenAI APIs, or similar tools.

An agent typically interacts with a large language model (LLM) like GPT using prompts that include:

  • System prompt: Defines the agent’s personality, role, and behavior.
  • User prompt: The actual request or instruction from the user.

To make both dynamic, you need a way to:

  1. Receive new prompts from the user (email, form, UI, etc.).
  2. Store and manage the system prompt state.
  3. Inject those prompts into your LLM interaction at runtime.

Happy Automation
Cheers

Hi @Anon_Robot

You could do it by using the Input Property of the Agent.

Here is my Approach:

  1. Create Input properties for System and User Prompt, and map them accordingly:

  2. After you’ve published and deployed your agent, You can use the Run Agent Activity in your process. Using this you can Invoke your Agent in the process:

Here, under the Input arguments, refer the documentation code:

In my example, it would become:

'VB.NET
New Email_Rewriter_Input() With {
    .systemPrompt = SystemPrompt, 
    .userPrompt = UserPrompt
}

If this helps your query, Do mark it as a solution
Happy Automation :star_struck:

1 Like

Hi @Anon_Robot

To add on to my previous approach

after you’ve published the Agent, If you are not using Run Agent, you can have another Approach:
Using Maestro you can design the following Flow:

The Prompts extracted from the “Extract Prompts from Email” task will become the Out-Property of that Task.
Which will become the In-Property for the Agent.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.