# Coded agent

> Call an AI agent that a developer wrote in code, such as Python, and deployed to UiPath, as a step in a workflow.

A coded agent is an AI agent that a developer writes in code, for example in Python with a framework such as LangGraph, and deploys to UiPath. A workflow can call it as a step, pass it data, and continue with its answer. Unlike the [Autonomous Agent](node-agent.md), a coded agent isn't built on the canvas: you call one that already exists.

## When to use it

| Your situation | Use |
|---|---|
| You need full control over how the agent works, such as its reasoning pattern and the actions it takes, and a developer has built it in code | **Coded agent** |
| You want to build the agent on the canvas, with a prompt, tools, and escalations | [Autonomous Agent](node-agent.md) |
| The decision follows fixed rules, with no reasoning | [Decision](node-decision.md) or [Switch](node-switch.md) |

## Add a coded agent

1. Select **+** on the handle of the node it follows, then select **Agent**.
2. Pick the agent:
   - **In this solution** lists coded agent projects in the same solution as the workflow.
   - **Published** lists agents deployed in your organization, with their folder and version.

Coded agents appear in these lists together with other agents, so look for the agent by its name.

Set its inputs in the properties panel, like any other node. When you test the workflow, the coded agent runs as part of the debug run.

[About coded agents](/agents/automation-cloud/latest/user-guide/about-coded-agents) describes coded agents, and [Building and deploying coded agents](/agents/automation-cloud/latest/user-guide/building-and-deploying-coded-agents) describes how a developer creates one.

## Next steps

- [Autonomous Agent](node-agent.md): build an agent on the canvas instead.
- [Third-party agent](node-third-party-agent.md): call an agent that runs outside UiPath.
- [Agent](agent-nodes.md): the other agent nodes.
