# Recipe: build a Maestro Flow

> Build and publish a Maestro Flow that extracts an invoice, routes it for approval, and posts the result.

This recipe builds a Maestro Flow that orchestrates an invoice-approval process: it extracts an invoice, routes it to a manager for approval, and posts the approved result to a downstream system. It shows the full loop from your prompt to a flow you can publish and refine.

## Prerequisites

- The `uip` CLI and skills installed, and an authenticated session (see [Install and set up](install-and-set-up.md)).
- An empty working folder.

## Build the flow

1. Open your coding agent in the empty folder.
2. Describe the process:

   "Build a Maestro Flow that extracts the total and vendor from an incoming invoice, routes it to a manager to approve or reject with a reason, and posts approved invoices to our finance system."

3. Review the flow the agent produces — the nodes, how they branch on the approval decision, and the human approval step.
4. Ask the agent to validate the flow and to explain any node it could not fully wire, such as a connection it needs you to confirm.
5. Ask the agent to publish the flow to Studio Web, where you can visualize and refine it.
6. Refine in conversation — for example, add a branch for rejected invoices or a notification step.

## Result

A validated, published Maestro Flow that extracts an invoice, gates it on human approval, and posts the approved result.

## Next steps

Before running the flow against real systems, ask the agent to set up an evaluation set with sample invoices and expected outcomes. This tests the branching and approval logic without live side effects. See [Maestro Flows](build-maestro-flows.md).

:::note
The generated nodes, file layout, and commands depend on your agent and prompt. Use the branching and approval behavior, not the exact files, as your signal of success.
:::
