Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/uipath-agents/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
- Treat "build/create/scaffold/implement a UiPath agent" as the full One-Prompt Flow by default. Do not stop after file creation or local run unless the user explicitly says to stop there.
- A normal completion point is after smoke eval and the mandatory Delivery fork question. A final build summary before that is premature unless run/eval is blocked or the user opted out.
<!--skill-flavor:solution-verb-probe:start-->
- **Probe the `solution` verb once per session before the first scaffold or deploy.** Run `uip solution init --help --output json`. Result `Success` → use `solution init` and `solution deploy run --parent-folder-path` / `--parent-folder-key` (post-rename, default). `unknown command` / non-zero exit → CLI predates the rename; substitute `uip solution new <Name>` and `--folder-path` / `--folder-key` (same arguments otherwise) wherever this skill calls those.

Check warning on line 16 in skills/uipath-agents/SKILL.md

View workflow job for this annotation

GitHub Actions / skills/uipath-agents

Possibly stale `uip solution new` (valid prefix: `solution`)
<!--skill-flavor:solution-verb-probe:end-->
- **Greenfield coded agents — scaffold with `uip codedagent new`, never hand-author the project.** Building a NEW coded agent from scratch: always create it with `uip codedagent new <name>`, then generate schemas with `uip codedagent init` — never hand-write `pyproject.toml` / `main.py` / `langgraph.json` / `entry-points.json` yourself, even for a trivial agent. Hand-authoring skips required project structure and produces invalid packages. (Existing or Studio Web local-workspace projects: do NOT run `uip codedagent new` — follow the project-state gating in [coded/quickstart.md](references/coded/quickstart.md).)
- **Greenfield coded agents — scaffold with `uip codedagent new`, never hand-author the project.** Building a NEW coded agent from scratch: install the framework package in the active venv first, then always create the project with `uip codedagent new <name>` and generate schemas with `uip codedagent init` — never hand-write `pyproject.toml` / `main.py` / `langgraph.json` / `entry-points.json` yourself, even for a trivial agent. Hand-authoring skips required project structure and produces invalid packages. The installed framework package selects the scaffold; after `new`, confirm `<framework>.json` exists — recovery is in [coded/lifecycle/setup.md](references/coded/lifecycle/setup.md) § Verify the Scaffold. (Existing or Studio Web local-workspace projects: do NOT run `uip codedagent new` — follow the project-state gating in [coded/quickstart.md](references/coded/quickstart.md).)
- **Coded agents only — bindings are always derived from UiPath Python SDK calls and must never be hand-authored.** To derive them, always run the sync workflow in [coded/lifecycle/bindings-reference.md](references/coded/lifecycle/bindings-reference.md) — scan code, regenerate `bindings.json`. Without this, resources cannot be overridden per execution environment and will always default to the hardcoded values in the SDK calls. Derive bindings whenever you add, remove, or modify any UiPath SDK resource call — for instance `assets`, `queues`, `processes`, `buckets`, `indexes`, `connections`, `apps`, `MCP servers`, or `InvokeProcess|CreateTask|CreateEscalation(...)`.

## Project Type Detection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Reference for comparing **coded** (Python) and **low-code** (agent.json) agents.
| Language | Python | Declarative JSON (`agent.json`) |
| CLI | `uip codedagent` | `uip agent` + `uip solution` |
| Project marker | `pyproject.toml` + `.py` files | `agent.json` + `project.uiproj` |
| Frameworks | LangGraph, LlamaIndex, OpenAI Agents, Coded Function | None (prompt + tools config) |
| Frameworks | LangGraph, LlamaIndex, OpenAI Agents | None (prompt + tools config) |
| Deployment | `uip codedagent deploy` | `uip solution pack/publish/deploy` |
| Local testing | `uip codedagent run` | Studio Web only |
| Evaluations | `uip codedagent eval` (13 evaluator types) | Not available |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Chat-style coded agents where the UiPath runtime feeds **one message per turn** and threads history across turns.

Supported on **LangGraph** and **LlamaIndex**. Coded Function and OpenAI Agents are not conversational.
Supported on **LangGraph** and **LlamaIndex**. OpenAI Agents is not conversational.

## Contract (framework-agnostic)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If the user has not named one, your ENTIRE response must be a question that list

**Task vs Escalation is decided by the request's wording, not by preference — for both the create pair and the wait pair.** "Escalate" / "escalation" / must act on the approve-reject decision → `CreateEscalation` / `WaitEscalation`. "Review task" / "sign-off" / "not an escalation" / only carry the reviewer's input forward → `CreateTask` / `WaitTask`. Never substitute one for the other: they resume with different payloads (see § Escalation Variant).

OpenAI Agents has no first-class HITL support. Coded Function (no framework) has no checkpoint/resume — call `sdk.tasks.create()` then `sdk.tasks.retrieve()` synchronously if a synchronous human step is needed.
OpenAI Agents has no first-class HITL support — call `sdk.tasks.create()` then `sdk.tasks.retrieve()` synchronously if a synchronous human step is needed.

LangGraph models live in `uipath.platform.common`; LlamaIndex events live in `uipath_llamaindex.models.events`.

Expand Down
6 changes: 2 additions & 4 deletions skills/uipath-agents/references/coded/embedding-in-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ If the solution and flow project don't yet exist, run `uip solution init "<Solut
cd <CodedAgentProject>
uv venv --python 3.13
source .venv/bin/activate # .venv/Scripts/activate on Windows
uv pip install <FRAMEWORK_PACKAGE> # e.g. uipath for Coded Function
uv pip install <FRAMEWORK_PACKAGE> # e.g. uipath-langchain for LangGraph
uip codedagent setup --force
uip codedagent new <agent-name>
uv sync
```

For a simple stub with no LLM call, use the Coded Function framework
(`uipath` package). This avoids downloading the full LangGraph or
LlamaIndex stack and keeps the setup fast.
Confirm `<framework>.json` exists before continuing (see [lifecycle/setup.md](lifecycle/setup.md) § Verify the Scaffold).

2. Implement `main.py`. Use lazy LLM initialization (create clients inside functions, never at module level).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agent Patterns

Common implementation patterns for building UiPath coded agents, from coded functions to multi-agent orchestrations.
Common implementation patterns for building UiPath coded agents, from single-node graphs to multi-agent orchestrations.

> **Note:** These patterns are general architectural concepts. The code examples use **LangGraph** and the **UiPath Python SDK**. The same patterns apply to LlamaIndex and OpenAI Agents — see their respective integration references.

Expand Down Expand Up @@ -117,7 +117,7 @@ async def main(input: Input) -> Output:

Multi-step agent using LangGraph's `StateGraph` with nodes, edges, and conditional routing. Supports LLM-powered decisions.

> **Important:** LangGraph agents require `uipath-langchain` as a dependency and use a different project structure than coded function agents. See the LangGraph integration reference for project setup, `langgraph.json` configuration, and troubleshooting.
> **Important:** LangGraph agents require `uipath-langchain` as a dependency. See the LangGraph integration reference for project setup, `langgraph.json` configuration, and troubleshooting.

**When to use:** Classification workflows, multi-step reasoning, conditional branching based on LLM output.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ uip codedagent new my-agent

This generates `main.py` (with a StateGraph template), `langgraph.json`, and `pyproject.toml`. Then modify `main.py` to implement your actual agent logic.

> **Prerequisite:** `uipath-langchain` must be installed for the LangGraph template to be used. If you get a base template instead, install `uipath-langchain` first.
> **Prerequisite:** `uipath-langchain` must be installed in the active venv before `new` — the installed package selects the LangGraph template. Confirm `langgraph.json` exists after `new` (see [../lifecycle/setup.md](../lifecycle/setup.md) § Verify the Scaffold).

## Project Structure

LangGraph agents use a **different structure** from coded function agents. There are two supported patterns:
There are two supported project structures:

### Pattern A: `langgraph.json` (Recommended for LangGraph)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ uip codedagent new my-agent

This generates `main.py` (with a Workflow template), `llama_index.json`, and `pyproject.toml`. Then modify `main.py` to implement your actual agent logic.

> **Prerequisite:** `uipath-llamaindex` must be installed for the LlamaIndex template to be used.
> **Prerequisite:** `uipath-llamaindex` must be installed in the active venv before `new` — the installed package selects the LlamaIndex template. Confirm `llama_index.json` exists after `new` (see [../lifecycle/setup.md](../lifecycle/setup.md) § Verify the Scaffold).

## Project Structure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ uip codedagent new my-agent

This generates `main.py` (with an Agent + tool template), `openai_agents.json`, `AGENTS.md`, and `pyproject.toml`. Then modify `main.py` to implement your actual agent logic.

> **Prerequisite:** `uipath-openai-agents` must be installed for the OpenAI Agents template to be used.
> **Prerequisite:** `uipath-openai-agents` must be installed in the active venv before `new` — the installed package selects the OpenAI Agents template. Confirm `openai_agents.json` exists after `new` (see [../lifecycle/setup.md](../lifecycle/setup.md) § Verify the Scaffold).

## Project Structure

Expand Down
11 changes: 5 additions & 6 deletions skills/uipath-agents/references/coded/lifecycle/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ Load capability references **only if the task requires them** — do not preload
| Human approval / interrupt | `../capabilities/human-in-the-loop.md` | agent needs human-in-the-loop or pause/resume |
| RAG / context grounding | `../capabilities/context-grounding.md` | agent searches organization documents |
| Platform API calls | `../capabilities/sdk-services.md` | agent uses UiPath platform services directly |
| Tracing / monitoring | `../capabilities/tracing.md` | agent needs custom tracing (Coded Function only — LangGraph traces automatically) |
| Tracing / monitoring | `../capabilities/tracing.md` | agent needs custom tracing (LangGraph traces automatically) |
| File attachments (input or created) | `../capabilities/file-attachments.md` | agent takes a file as input, or creates an attachment |
| Conversational (chat-style) agents | `../capabilities/conversational-agents.md` | agent receives one message per turn; runtime threads history (LangGraph / LlamaIndex only) |

## Framework Reference

| Framework | Config File | Key Dependency | Entry Point |
|-----------|------------|----------------|-------------|
| Coded Function | `uipath.json` | `uipath` | `main.py` function |
| LangGraph | `langgraph.json` | `uipath-langchain` | `main.py` compiled StateGraph |
| LlamaIndex | `llama_index.json` | `uipath-llamaindex` | `main.py` Workflow instance |
| OpenAI Agents | `openai_agents.json` | `uipath-openai-agents` | `main.py` Agent instance |
Expand All @@ -45,11 +44,11 @@ Load capability references **only if the task requires them** — do not preload
## Additional Instructions

- **File/document input → `Attachment`, never a filesystem path string.** If the prompt says the agent "takes a CSV/PDF/file as input" (or similar), read `../capabilities/file-attachments.md` before defining the `Input` model. A `str` path field runs locally with `uip codedagent run` but breaks on Studio Web/Orchestrator, where no such path exists in the container.
- **Select a framework before writing any code.** Infer from the prompt if possible (tools/orchestration → LangGraph, RAG → LlamaIndex, simple LLM → OpenAI Agents, no LLM → Coded Function). If ambiguous, ask the user to choose.
- **Structured input contract → not OpenAI Agents.** OpenAI Agents always require a `messages` input field and cannot express an input contract without it (see `../frameworks/openai-agents-integration.md` § Input). When the user needs a strict typed/structured input (e.g. a single named field, no `messages`), choose LangGraph (custom `StateGraph` with arbitrary input state) instead. Do NOT silently fall back to a Coded Function to satisfy the input shape — a Coded Function produces `ProjectType: Function`, not a coded agent, so it does not fulfill a request for an agent.
- **Select a framework before writing any code.** Infer from the prompt if possible (tools/orchestration → LangGraph, RAG → LlamaIndex, simple LLM → OpenAI Agents). No LLM at all → not an agent; use [`uipath-functions`](/uipath:uipath-functions). If ambiguous, ask the user to choose.
- **Structured input contract → not OpenAI Agents.** OpenAI Agents always require a `messages` input field and cannot express an input contract without it (see `../frameworks/openai-agents-integration.md` § Input). When the user needs a strict typed/structured input (e.g. a single named field, no `messages`), choose LangGraph (custom `StateGraph` with arbitrary input state) instead. Do NOT satisfy the input shape with `uip function new` — a Coded Function produces `ProjectType: Function`, not a coded agent, so it does not fulfill a request for an agent.
- **Read ONLY the single framework reference** for the selected framework before writing code. Do NOT read other framework references or capability references unless the task explicitly requires that capability.
- **Clean generated scaffold code before schema init.** After `uip codedagent new` and before running `uip codedagent init`, inspect `main.py` and remove scaffold hazards: no module-level `UiPathChat`, `UiPathAzureChatOpenAI`, `UiPath`, or other auth-dependent clients; instantiate LLM/SDK clients inside graph nodes/functions only; ensure importing `main.py` works without UiPath auth.
- **Clean generated scaffold code before schema init.** After `uip codedagent new` and before running `uip codedagent init`, first confirm `<framework>.json` exists (see [setup.md](setup.md) § Verify the Scaffold), then inspect `main.py` and remove scaffold hazards: no module-level `UiPathChat`, `UiPathAzureChatOpenAI`, `UiPath`, or other auth-dependent clients; instantiate LLM/SDK clients inside graph nodes/functions only; ensure importing `main.py` works without UiPath auth.
- **NEVER instantiate LLM clients or SDK clients at module level.** `uip codedagent init` imports your Python file to introspect schemas — module-level `UiPathAzureChatOpenAI()`, `UiPathChat()`, `UiPathChatOpenAI()`, or `UiPath()` will fail because auth may not have happened yet. Always create these instances inside functions or graph nodes, never at the top level of the module.
- **Correct SDK import: `from uipath.platform import UiPath`** — not `from uipath import UiPath` (that does not exist). Instantiate inside functions only: `sdk = UiPath()`.
- LangGraph agents get tracing automatically — no `@traced()` needed on graph nodes.
- Simple function agents require `@traced()` on the `main` function.
- LlamaIndex and OpenAI Agents entrypoints require `@traced()` where custom tracing is wanted.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ The entrypoint name comes from `entry-points.json` (e.g., `main`, `agent`) — n

| Framework | Source of truth | Key in the file |
|---|---|---|
| Coded Function | `uipath.json` | `functions` |
| LangGraph | `langgraph.json` | `graphs` |
| LlamaIndex | `llama_index.json` | `workflows` |
| OpenAI Agents | `openai_agents.json` | `agents` |
Expand Down
27 changes: 13 additions & 14 deletions skills/uipath-agents/references/coded/lifecycle/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ Windows PowerShell fresh-machine setup: `irm https://download.uipath.com/uipath-

## Framework Selection

Pick the framework before starting. The package installed in the Workflow determines which scaffold `uip codedagent new` produces.
Pick the framework before starting: the package installed in the active venv selects the agent template. Install `<FRAMEWORK_PACKAGE>` before `new`, not after — with none installed, `new` fails with an error naming what to install.

With several installed, name the one to scaffold with: `uip codedagent new <PROJECT_NAME> --agent-framework <FRAMEWORK_PACKAGE>`. Without it, `new` fails and lists them.

| Agent Type | `<FRAMEWORK_PACKAGE>` | Framework config | Guide |
|---|---|---|---|
| LangGraph | `"uipath-langchain"` | `langgraph.json` | [langgraph-integration.md](../frameworks/langgraph-integration.md) |
| LangGraph | `uipath-langchain` | `langgraph.json` | [langgraph-integration.md](../frameworks/langgraph-integration.md) |
| LlamaIndex | `uipath-llamaindex` | `llama_index.json` | [llamaindex-integration.md](../frameworks/llamaindex-integration.md) |
| OpenAI Agents | `uipath-openai-agents` | `openai_agents.json` | [openai-agents-integration.md](../frameworks/openai-agents-integration.md) |

Expand All @@ -38,6 +40,7 @@ source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install <FRAMEWORK_PACKAGE>
uip codedagent setup --force
uip codedagent new <PROJECT_NAME>
# verify: <framework>.json must exist — see § Verify the Scaffold
uv add uipath-dev --dev # required by `uip codedagent dev` (local dev web server)
uv sync
uip codedagent init
Expand All @@ -47,19 +50,13 @@ uip codedagent init

**What `uip codedagent setup` does:** locates a Python that has `uipath` installed and caches its path, so later commands (`init`/`run`/`eval`/`pack`) can invoke the Python SDK. It searches PATH (`python3.x`, `python3`, `python`) and uses your `.venv` only when activated. So when using uv, always `uv sync` then activate the venv before the `setup` command.

## Coded Function Agents

`uipath.json` carries the entrypoint mapping:
## Verify the Scaffold

```json
{
"functions": {
"main": "main.py:main"
}
}
```
After `uip codedagent new`, check the directory before running anything else:

Edit the scaffolded `main.py`'s `Input` / `Output` models and `async def main` to fit the real agent.
1. `<framework>.json` present (`langgraph.json` / `llama_index.json` / `openai_agents.json`) → continue.
2. `No agent framework integration is installed` (or `The '<FRAMEWORK_PACKAGE>' package is required to scaffold a '<framework>' agent`) → nothing was generated. Fix: `uv pip install <FRAMEWORK_PACKAGE>`, confirm `uip codedagent setup --force` reports the same venv, then re-run `uip codedagent new <PROJECT_NAME>`.
3. `Multiple agent frameworks are installed` → re-run with `--agent-framework <FRAMEWORK_PACKAGE>`, or keep exactly one in the venv (`uv pip uninstall` the others).

## Generated Files

Expand All @@ -68,7 +65,7 @@ Edit the scaffolded `main.py`'s `Input` / `Output` models and `async def main` t
| `pyproject.toml` | Project metadata and dependencies |
| `main.py` | Agent entrypoint |
| `<framework>.json` | Framework config (LangGraph / LlamaIndex / OpenAI Agents) |
| `uipath.json` | Runtime options, pack options, `functions` map |
| `uipath.json` | Runtime options and pack options |
| `entry-points.json` | Input / output schemas from Pydantic models |
| `bindings.json` | Runtime bindings |
| `uv.lock` | Dependency lockfile |
Expand Down Expand Up @@ -126,4 +123,6 @@ When the agent project is registered in a solution and uploaded via `uip solutio
| `Project authors cannot be empty` | Missing `authors` in `pyproject.toml` | Add `authors = [{ name = "Your Name" }]` to `[project]` |
| `NameError` during `init` | Framework not installed when `init` imports `main.py` | Run `uv sync` before `uip codedagent init` |
| `No entrypoints found in uipath.json` | Framework config or package missing | Verify `uv pip install` succeeded, then re-run `uip codedagent init` |
| `No agent framework integration is installed` or `The '<FRAMEWORK_PACKAGE>' package is required to scaffold a '<framework>' agent` from `new` | No framework package in the active venv | `uv pip install <FRAMEWORK_PACKAGE>`, re-run `new` |
| `Multiple agent frameworks are installed` from `new` | More than one framework package in the venv | Re-run with `--agent-framework <FRAMEWORK_PACKAGE>`, or keep one |
| `ModuleNotFoundError` for a package you just installed, even after activating `.venv` | A shell `python` alias points at a different interpreter (uv-managed, system, etc.) | Use `.venv/bin/python` directly for sanity checks, or `unalias python` for the session |
Loading
Loading