# Flows in Maestro

> Process orchestrations that route work between people, agents, RPA, and systems.

Your coding agent authors a flow in TypeScript and compiles it to a runnable `.flow` with the `uipath-maestro-flow` skill (see the [Skills catalog](skills-catalog.md)). The agent installs the Maestro builder SDK (`@uipath/maestro-builder-sdk`) on first use.

## What a flow is built from

- **Process control:** triggers, decisions, subflows, human approvals.
- **Processing:** connectors, scripts, agents, document extraction with Intelligent Xtraction and Processing (IXP).

Use flows for work that spans systems and time.

## The full lifecycle

| Stage | What the agent does | Example prompt |
| --- | --- | --- |
| Author | Edits `.flow.ts`, compiles to `.flow`, validates locally. | *Add an approval step after extraction.* |
| Operate | Publishes to Studio Web or deploys to Orchestrator, triggers runs, reports job status. | *Publish this flow and run it with a sample invoice.* |
| Diagnose | Traces a failed run to a node from its incidents and runtime state. | *My flow run faulted overnight. Find out why.* |
| Evaluate | Builds and runs evaluation sets, and compares results across runs. | *Set up and run an eval set.* |

## Build an expense approval flow

> Build a flow in Maestro for our expense approval process: pull the expense details, send them to a manager to approve or reject with a reason, then log the outcome.

## Other flow requests

- Build a flow that extracts new SharePoint invoices with IXP and posts them to SAP.
- Build a flow that classifies new Outlook emails by urgency and routes urgent mail to Slack.
- My deployed flow faulted on the approval step. Pull the incident and explain why.

More: [UiPath Maestro documentation](https://docs.uipath.com/maestro).
