- Introduction
- Getting Started with UiPath Agents
- Getting Started with UiPath Agents using LangGraph
- Building a Low-Code Agent in Studio Web
- Adding Tools to Your UiPath Agent
- Getting Started with UiPath Maestro Flow
Use your coding agent and UiPath skills to build, configure, and run a LangGraph agent locally.
With the CLI installed, skills in place, and your account authenticated, you are ready to scaffold the local project.
Step 4 - Set up the local project
Create a new folder for your agent project and open it in VS Code (File → Open Folder). All commands from this step onward run from the project folder root.
Create the Python environment
Create a virtual environment pinned to a supported Python version and activate it:
mkdir QuestIntake
cd QuestIntake
uv venv --python 3.13
source .venv/bin/activate
mkdir QuestIntake
cd QuestIntake
uv venv --python 3.13
source .venv/bin/activate
Windows: Use .venv\Scripts\activate instead of source .venv/bin/activate.
Python version: uv downloads and manages Python automatically if 3.13 is not on your PATH. Supported versions are 3.11, 3.12, and 3.13.
Install the LangGraph integration
LangGraph is a Python framework for building stateful LLM agents as graphs of nodes and edges. uipath-langchain is the UiPath integration layer that packages a LangGraph agent for deployment and evaluation on the UiPath platform.
Install the UiPath LangGraph package into the active venv. This also makes the framework available for project scaffolding in the next step:
uv pip install uipath-langchain
uv pip install uipath-langchain
Register Python with the UiPath CLI
Tell the CLI where the UiPath-compatible Python executable lives:
uip codedagent setup --force
uip codedagent setup --force
You should see "Result": "Success". This step is required once per machine (and after any venv changes) before using uip codedagent commands.
Scaffold the project
Create the UiPath project structure. uip codedagent new detects the installed framework and generates the right scaffold files:
uip codedagent new QuestIntake
uip codedagent new QuestIntake
This creates pyproject.toml, main.py, langgraph.json, uipath.json, entry-points.json, bindings.json, and coding agent context files (AGENTS.md, CLAUDE.md, .agent/). The main.py is a placeholder; your coding agent replaces it in Step 5.
Add the local dev server dependency and sync the lockfile:
uv add uipath-dev --dev
uv sync
uv add uipath-dev --dev
uv sync
Generate entry points
Run init to generate the entry point schemas from the scaffold code:
uip codedagent init
uip codedagent init
The project has a placeholder entry point at this stage. Re-run init in Step 5 after your coding agent writes the real agent code.
Step 5 - Build the agent with your coding agent
This is where the UiPath skills pay off. Open your coding agent and prompt it to create the agent logic. The prompt below is short: it describes what the agent should do, not how to build it.
The uipath-agents skill your coding agent has installed already knows the LangGraph integration patterns, correct SDK imports, Pydantic schema conventions, and relevant SDK requirements. Without these skills, you would need to specify all of this in the prompt itself.
Use the following prompt (or adapt it to your use case):
Update main.py to implement this UiPath coded agent using LangGraph as a single-node graph with no tools and no retry or error-handling logic.
The agent is a quest intake classifier for a fantasy adventurer's guild. Given a
description of an incoming quest, it classifies the difficulty as one of four tiers:
- Trivial: Simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: Moderate quests requiring some skill (e.g., escort a merchant caravan)
- Heroic: Difficult quests requiring significant expertise (e.g., slay a wyvern, infiltrate a thieves' guild)
- Legendary: Extreme quests requiring top-tier heroes and special approval (e.g., defeat a lich, close a planar rift)
Return the classification tier and a brief reasoning. Use these exact field names in the State schema:
- Input field: `description` (string)
- Output fields: `tier` (a Literal type constrained to exactly "Trivial", "Standard", "Heroic", "Legendary" — not a plain string, so the model can't emit an out-of-vocabulary tier) and `reasoning` (string)
Update the existing langgraph.json to point at the new graph, and create an input.json with this exact sample quest: {"description": "Clear the rats out of the inn cellar"}.
Only touch main.py, langgraph.json, and input.json.
Don't run any uip codedagent commands or otherwise verify that the agent runs — I will do this myself.
Update main.py to implement this UiPath coded agent using LangGraph as a single-node graph with no tools and no retry or error-handling logic.
The agent is a quest intake classifier for a fantasy adventurer's guild. Given a
description of an incoming quest, it classifies the difficulty as one of four tiers:
- Trivial: Simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: Moderate quests requiring some skill (e.g., escort a merchant caravan)
- Heroic: Difficult quests requiring significant expertise (e.g., slay a wyvern, infiltrate a thieves' guild)
- Legendary: Extreme quests requiring top-tier heroes and special approval (e.g., defeat a lich, close a planar rift)
Return the classification tier and a brief reasoning. Use these exact field names in the State schema:
- Input field: `description` (string)
- Output fields: `tier` (a Literal type constrained to exactly "Trivial", "Standard", "Heroic", "Legendary" — not a plain string, so the model can't emit an out-of-vocabulary tier) and `reasoning` (string)
Update the existing langgraph.json to point at the new graph, and create an input.json with this exact sample quest: {"description": "Clear the rats out of the inn cellar"}.
Only touch main.py, langgraph.json, and input.json.
Don't run any uip codedagent commands or otherwise verify that the agent runs — I will do this myself.
Why this prompt is so specific. It names the exact files to touch and tells the coding agent not to run any uip codedagent commands or verify its own work. That's deliberate here: the rest of this lab exercises those same CLI commands directly in the next steps, so verification is left to you instead of the coding agent running it first.
The prompt above is a good template to start from in your own projects, but you should remove the last two sentences to enable the coding agent to test its work and organize files to its own judgment.
Coding agents are non-deterministic. Your generated code will differ from any examples shown here; that is expected. What matters is that main.py runs without errors and returns a classification.
And note that if your coding agent presents a 'Delivery' question (Studio Web, local dev server, or skip), select Skip - I'm done for now. Connect to Studio Web in Step 10.
After the coding agent finishes, re-run init to pick up the updated entry points from the new Pydantic schemas:
uip codedagent init
uip codedagent init
You should see output confirming the entry point was detected along with an ASCII graph diagram:
Created 'entry-points.json' file with 1 entrypoint(s).
Created 'entry-points.json' file with 1 entrypoint(s).
Before continuing, open pyproject.toml and add an authors entry under [project] if one is not already there. UiPath requires this field to package the project:
authors = [{ name = "Your Name" }]
authors = [{ name = "Your Name" }]
With the agent running locally and the entry points registered, you are ready to run it in the next step.
Step 6 - Run the agent locally
Run the agent with the sample input file your coding agent created:
uip codedagent run agent --file input.json
uip codedagent run agent --file input.json
You should see the agent classify the request and return a tier with reasoning.
You can also pass input inline. These examples use Bash single-quote syntax; if you are in PowerShell, use --file with a JSON file instead:
uip codedagent run agent '{"description": "Clear the rats out of the inn cellar"}'
uip codedagent run agent '{"description": "Clear the rats out of the inn cellar"}'
Try your own inputs to verify the classifications make sense, for example:
uip codedagent run agent '{"description": "Slay the ancient red dragon terrorizing the countryside"}'
uip codedagent run agent '{"description": "Slay the ancient red dragon terrorizing the countryside"}'
With the agent classifying correctly, you are ready to give it something to verify its answers against.