Existing robots become tools that agents can call, and every path an agent can take is still bounded by BPMN processes.
Key Points at a Glance
- Agents can only choose among branches BPMN allows; the engine holds the boundaries and reliability.
- Camunda 8 calls UiPath robots via queue items, so the BPMN model must poll for results and limit the number of attempts.
- In Maestro, verify which identity each subprocess runs as; also remember that Orchestrator tokens are valid for only one hour.
Camunda's documentation defines an agent in one sentence: a loop in which the model itself decides what to do next, which tool to call, and when to stop.
If a customer has a fleet of UiPath robots and BPMN processes that have run stably for years, this sentence is both enticing and unsettling. An autonomous decision-making loop will touch systems that the operations team spent years taming.
So when facing such customers, the Forward Deployed Engineer (FDE)'s first task is to decide where the agent is allowed to stand; which model to use is a later question. Place it wrong, and there are only two outcomes: either you break the audit records compliance depends on, or the agent degenerates into an expensive RPA robot that decides nothing.
The good news is that Camunda and UiPath have each already drawn this boundary. Understanding these two approaches tells you where to plug in and which failures to guard against.
The Agent Chooses the Path, but Doesn't Draw It
Camunda's division of responsibility is clear: the LLM picks a branch from the allowed options, while the engine owns process boundaries and execution reliability. This is the most useful lens when entering an existing system. The BPMN process still sets the rules, and the agent exercises judgment only where the rules permit.
Technically, Camunda reserves ad-hoc subprocesses as the place for judgment, calling them a "governed toolbox." The AI Agent connector is the primary building block for bringing agents into a process. Existing UiPath robots can absolutely become tools in that toolbox, because Camunda 8 ships with a connector that can orchestrate robots from a BPMN process.
This yields three layers. At the top is the BPMN process, governing sequence, deadlines, and incidents. In the middle is the agent, appearing only where judgment is needed. At the bottom are the RPA robots, executing actions on existing systems. The agent's arrival doesn't make the robots disappear; they become tools in the toolbox.
Three Integration Points, Three Different Behaviors
How robots are wired into the process depends on the platform the customer runs. Each integration point has its own runtime behavior, which you must understand before writing the first line of code.
| Platform | How the robot is invoked | What you must handle |
|---|---|---|
| Camunda 8 | The UiPath connector creates a queue item | Queue items don't execute immediately, so the BPMN model must poll for results and limit the number of attempts |
| Camunda 7 | The RPA Bridge passes service task inputs to the robot via Orchestrator | Robot failures appear as incidents in Cockpit |
| UiPath Maestro | A service task invokes a deployed RPA workflow or agent and waits for it to finish before continuing | Each subprocess is a separate Orchestrator job that, by default, runs as any idle identity in the folder |
UiPath Maestro runs in the opposite direction from Camunda: Maestro itself runs BPMN, orchestrating agents, robots, and humans within the same process.
The same type of service task can launch either a deployed RPA workflow or a UiPath agent. Third-party agents hosted separately have their own deployment type.
If the customer has gone all-in on UiPath, this is the path of least resistance for reusing legacy robots.
Invoice Mismatch: The Agent Stands Only on the Exception Branch
Here is a hypothetical scenario. The customer runs Camunda 8, has a vendor invoice process, and has a UiPath robot that looks up purchase orders in a legacy ERP. Matching invoices pass straight through; mismatched invoices currently just wait for manual handling by accounting.
The agent should be placed on the "invoice mismatch" branch and nowhere else. Model this branch as an ad-hoc subprocess containing three tools: the UiPath robot that queries purchase orders (invoked via the UiPath connector), a service task that reads payment history, and a user task that asks accounting a question.
The agent reads the invoice, decides which tools to call and how many times, then returns one of three conclusions: "approve," "reject," or "escalate to a human." These three outcomes map to the three branches already drawn after the subprocess. The agent cannot create a fourth.
The most fragile link is the robot. Queue items don't execute immediately, so after creating a queue item, the BPMN model must loop: wait on a timer, check the status, increment a counter, and exit to an error branch once the limit is exceeded. If the customer needs a separate integration service outside the connector, the waiting logic looks like this (the API-calling functions are omitted for brevity):
import time
TOKEN_TTL = 3600 # Orchestrator 令牌只有一小时有效期
REFRESH_MARGIN = 300 # 提前 5 分钟刷新
class TokenCache:
token = None
issued_at = 0.0
def get_token(cache: TokenCache) -> str:
if cache.token and time.time() < cache.issued_at + TOKEN_TTL - REFRESH_MARGIN:
return cache.token
# 外部应用必须申请 OR.Default 权限范围,才能获得基于角色的细粒度权限
cache.token = request_token(scope="OR.Default")
cache.issued_at = time.time()
return cache.token
def wait_for_queue_item(cache, item_id, max_polls=10, interval_s=30):
for attempt in range(max_polls):
status = get_queue_item_status(get_token(cache), item_id)
if status == "done":
return "done"
if status == "failed":
return "failed" # 交给 BPMN 触发事件,不要吞掉错误
time.sleep(interval_s)
return "timeout" # 单独的 BPMN 分支,由人工处理max_polls
The values of
interval_s
and are agreed between you and the operations team based on how long the robot usually takes. What's mandatory is an upper limit and a "timeout" branch leading to a human. An agent waiting indefinitely for a stuck robot is the kind of incident an operations team remembers for a long time.
With Real Customers, Start from the Process Diagram
Don't touch the model yet. List the existing BPMN steps, mark the ones that currently require human judgment, and treat only those as candidate locations for agents. Leave everything else as is.
Next, inventory the robots. For each robot you plan to put in the toolbox, record which integration point invokes it, which identity it runs as, how long it takes, and where it reports failures. In Maestro, subprocesses default to any idle identity in the folder, so confirm that identity's permissions are exactly sufficient—no more, no less.
Finally, choose a design pattern based on audit requirements. Besides the looping ad-hoc subprocess used in the invoice example, Camunda also offers the AI Agent subprocess connector pattern, which Camunda describes as more compact and easier to govern.
But Camunda itself cautions that the compact pattern isn't suitable when the customer needs detailed audit records. For customers in heavily regulated industries, stick with the invoice example's approach: an ad-hoc subprocess where every tool is visible on the process diagram.
Only consider the compact pattern after the compliance team confirms that level of detail isn't needed.
Mistakes That Send the Project Back to Square One
A common temptation in demos is to have the agent call the Orchestrator API directly, bypassing BPMN. Doing so throws away the very reason the customer chose BPMN in the first place: process boundaries, incidents, and execution history. Robots should always be invoked as tasks within the process.
A polling loop without an upper limit is the next trap. The next one is treating the token as a constant: Orchestrator tokens expire after one hour, and a service that has run smoothly all morning can suddenly start returning authentication errors mid-shift. In Maestro, if you keep the default identity, one day some subprocess will run with far more permissions than that step requires.
Career-wise, when reading FDE job postings, watch for whether RPA, BPMN, UiPath Orchestrator, or Camunda appears alongside the word "agent." That company's customers very likely already have robots and processes, and need someone to plug agents in without breaking them.
On a resume, a line like "introduced an agent into the exception branch of a BPMN process, reused existing UiPath robots, and preserved event and audit records" is more convincing than a full page of framework names.
Customers who already have robots and processes rarely need someone to replace them. What they need is someone who knows where to place the judgment—and who can then prove that everything else still runs as usual.
Was this article helpful to you?
Thanks for your feedback!