- Introducción
- Primeros pasos con los agentes de UiPath
- Primeros pasos con los agentes de UiPath utilizando LangGraph
- Crear un agente de código bajo en Studio Web
- Añadir herramientas a tu agente de UiPath
- Getting Started with UiPath Maestro Flow
Utilice sus habilidades de agente de codificación y UiPath para crear, configurar y ejecutar un agente de LangGraph localmente.
Con la CLI instalada, las habilidades en su lugar y tu cuenta autenticada, estás listo para andamiar el proyecto local.
Paso 4: configurar el proyecto local
Crea una nueva carpeta para tu proyecto de agente y ábrela en VS Code (Archivo → Abrir carpeta). Todos los comandos a partir de este paso se ejecutan desde la raíz de la carpeta del proyecto.
Crear el entorno de Python
Crea un entorno virtual anclado a una versión de Python compatible y actívalo:
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: utiliza .venv\Scripts\activate en lugar de source .venv/bin/activate.
Versión de Python: uv y gestiona Python automáticamente si la versión 3.13 no está en tu RUTA. Las versiones compatibles son 3.11, 3.12 y 3.13.
Instalar la integración de LangGraph
LangGraph es un marco de Python para crear agentes LLM con estado como gráficos de nodos y bordes. uipath-langchain es la capa de integración de UiPath que empaqueta un agente de LangGraph para su implementación y evaluación en UiPath Platform.
Instala el paquete UiPath LangGraph en el paquete venv. Esto también hace que el marco esté disponible para el andamiaje del proyecto en el siguiente paso:
uv pip install uipath-langchain
uv pip install uipath-langchain
Registrar Python con UiPath CLI
Indica a la CLI dónde reside el ejecutable de Python compatible con UiPath:
uip codedagent setup --force
uip codedagent setup --force
Deberías ver "Result": "Success". Este paso es necesario una vez por máquina (y después de cualquier cambio en venv) antes de utilizar los comandos uip codedagent .
Andamio del proyecto
Crea la estructura del proyecto de UiPath. uip codedagent new el marco instalado y genera los archivos de andamio correctos:
uip codedagent new QuestIntake
uip codedagent new QuestIntake
Esto crea pyproject.toml, main.py, langgraph.json, uipath.json, entry-points.json, bindings.json y archivos de contexto del agente de codificación (AGENTS.md, CLAUDE.md, .agent/). main.py es un marcador de posición; tu agente de codificación lo reemplaza en el paso 5.
Añade la dependencia del servidor de desarrollo local y sincroniza el archivo de bloqueo:
uv add uipath-dev --dev
uv sync
uv add uipath-dev --dev
uv sync
Generar puntos de entrada
Ejecuta init para generar los esquemas de punto de entrada a partir del código de andamio:
uip codedagent init
uip codedagent init
El proyecto tiene un punto de entrada de marcador de posición en esta etapa. Vuelve a ejecutar init en el paso 5 después de que tu agente de codificación escriba el código de agente real.
Paso 5: crea el agente con tu agente de codificación
Aquí es donde las habilidades de UiPath valen la pena. Abre tu agente de codificación y pídele que cree la lógica del agente. La siguiente solicitud es breve: describe lo que debe hacer el agente, no cómo crearlo.
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.
Utiliza la siguiente solicitud (o adáptala a tu caso de uso):
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.
Los agentes de codificación no son deterministas. Tu código generado diferirá de cualquier ejemplo mostrado aquí; que se espera. Lo que importa es que main.py se ejecute sin errores y devuelva una clasificación.
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.
Después de que finalice el agente de codificación, vuelve a ejecutar init para recoger los puntos de entrada actualizados de los nuevos esquemas de Pydantic:
uip codedagent init
uip codedagent init
Deberías ver una salida que confirma que se detectó el punto de entrada junto con un diagrama gráfico ASCII:
Created 'entry-points.json' file with 1 entrypoint(s).
Created 'entry-points.json' file with 1 entrypoint(s).
Antes de continuar, abre pyproject.toml y añade una entrada authors en [project] si no hay una allí. UiPath requiere este campo para empaquetar el proyecto:
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.
Paso 6: ejecutar el agente localmente
Ejecuta el agente con el archivo de entrada de muestra que creó tu agente de codificación:
uip codedagent run agent --file input.json
uip codedagent run agent --file input.json
Deberías ver al agente clasificar la solicitud y devolver un nivel con razonamiento.
También puedes pasar la entrada en línea. Estos ejemplos utilizan la sintaxis de comillas simples de Bash; si estás en PowerShell, utiliza --file con un archivo JSON en su lugar:
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.