# Maestro BPMN (Preview)

> Maestro BPMN process orchestrations authored, validated, published, run, and diagnosed with a coding agent.

A Maestro BPMN process is an executable Business Process Model and Notation (BPMN) 2.0 diagram. Your coding agent builds a runnable `.bpmn` project with the `uipath-maestro-bpmn` skill (see the [Skills catalog](skills-catalog.md)). To install the skill, see [Install and set up](install-and-set-up.md).

Use it when steps and branches are known at design time, such as invoice processing.

## What a process is built from

- **Events:** start, end, message, timer, error, boundary.
- **Gateways:** exclusive, parallel, inclusive, event-based.
- **Tasks:** human-in-the-loop, Integration Service connectors, Orchestrator jobs and queues, scripts.
- **Subprocesses:** multi-instance and event subprocesses.
- **Data:** variables, bindings, conditions.

## The full lifecycle

| Stage | What the agent does | Example prompt |
| --- | --- | --- |
| Author | Writes TypeScript (`.bpmn.ts`) and compiles it to `.bpmn`. Edits leave unchanged parts alone. | *Model an onboarding process as BPMN.* |
| Validate | Checks layout and canvas rules. Structural only: doesn't prove the process runs correctly. | *Validate this process and fix errors.* |
| Publish | Uploads to Studio Web, or deploys to Orchestrator when you ask. | *Upload this process to Studio Web.* |
| Run | Runs or debugs on your approval. Pauses, resumes, cancels, retries, or migrates an instance when you ask, each on your approval. A debug run is real: it calls connectors, starts child processes, changes queues, and sends messages. | *Debug this process with a sample invoice.* |
| Evaluate | Creates and runs evaluation sets and evaluators. A run uploads the solution and overwrites the matching Studio Web solution; the CLI doesn't prompt. Passing both `--solution-id` and `--project-id` skips the upload. Each unsimulated connector step runs once per data point. | *Create and run an evaluation set.* |
| Diagnose | Maps a failed run to the failing BPMN element. Changes nothing until you agree. | *This instance faulted. Which element failed, and why?* |

Validation runs locally first. Publish, deploy, and run wait for your approval. Uploading to Studio Web needs no approval when the agent created the solution in the same session.

:::warning
An evaluation run doesn't ask. It uploads the solution and overwrites the matching Studio Web solution, unless the agent passes both `--solution-id` and `--project-id`.
:::

## Model an invoice approval process

> Model an invoice approval process as a Maestro BPMN: receive an invoice, extract its fields, route it to a manager for approval when the amount is over 5,000, and post it to the finance system once approved. Add error handling so a failed posting notifies a supervisor.

Ask for a debug run before you rely on the process. The run posts to the finance system, so use test connections.

## Edits to an existing process

- Add a manager approval for requests over a set amount, with a reminder after a day.
- Add a parallel branch that notifies the requester while the approval runs.

More: [Build a Maestro BPMN with a coding agent](https://docs.uipath.com/maestro/automation-cloud/latest/user-guide/building-maestro-bpmn-with-coding-agents).
