- Get started
- Build
- Deploy and run
- Examples
- Reference
Your first workflow
Build an order intake workflow with two API calls, an AI agent that decides, and two branches, then test it and deploy it, with a coding agent or on the canvas.
In this tutorial, you build the order intake workflow that What is Maestro Automate? describes. For every new order, the workflow checks the stock and the customer's credit, lets an AI agent decide whether to accept the order, and then either creates the order or notifies a sales representative.
The tutorial takes about 15 minutes. The stock and credit checks call dummyjson.com, a free sample API, so you don't need an account or an API key for another app. The last two steps are scripts that stand in for the customer relationship management (CRM) and Slack, so the workflow runs without connections to those apps. The screenshot above shows Notify sales rep as a Slack connector, which is what it would be in a real workflow.
You can build the workflow in two ways. Pick one, and the rest of the page follows your choice:
- With a coding agent: describe the workflow, and the agent builds it for you.
- Manually on the canvas: add and set up each node yourself.
Before you start
- A UiPath account. Sign up describes how to create one.
- A coding agent with the UiPath CLI and skills. Set up your coding agent gets it ready in three steps.
- VS Code with the UiPath Maestro extension, to see the workflow on the canvas. Build in VS Code describes how to install it.
- A UiPath account. Sign up describes how to create one.
- VS Code, Studio Web, or Studio Desktop. Studio Web runs in your browser and needs no installation. Where to build compares them.
1. Build the workflow
-
Create an empty folder for the project, and open it in VS Code.
-
Start your coding agent in that folder. For example, for Claude Code, run
claudein the VS Code terminal. -
Paste this prompt:
Create a Maestro Automate project named OrderIntake with a workflow that does exactly this. Don't add, remove, or rename nodes. 1. Rename the Manual trigger to "New order", set its ID to newOrder, and add two input arguments: productId (number) and customerId (string). 2. Add an HTTP Request node "Check stock" (ID checkStock), GET, with the URL as an expression: "https://dummyjson.com/products/" + $vars.newOrder.output.productId 3. Add an HTTP Request node "Check credit" (ID checkCredit), GET https://dummyjson.com/users/1 4. Add an Autonomous Agent node "Review order" (ID reviewOrder) with the default model. System prompt: "You review new customer orders. Accept an order only if the product has stock greater than 0 and the customer record is present. Otherwise reject it. Always give a short reason." Give the agent the response body of Check stock as the product, and the response body of Check credit as the customer. Output variables: accepted (boolean) and reason (string). 5. Add a Decision node "Accepted?" (ID accepted) with the condition $vars.reviewOrder.output.accepted 6. On True, add a Script node "Create order in CRM" (ID createOrderInCrm): return { orderCreated: true, productId: $vars.newOrder.output.productId }; 7. On False, add a Script node "Notify sales rep" (ID notifySalesRep): return { notified: true, reason: $vars.reviewOrder.output.reason }; The order is: New order → Check stock → Check credit → Review order → Accepted? → True: Create order in CRM, False: Notify sales rep. dummyjson.com is a public sample API, so these URLs work as they are. Then validate the workflow and fix any problems.Create a Maestro Automate project named OrderIntake with a workflow that does exactly this. Don't add, remove, or rename nodes. 1. Rename the Manual trigger to "New order", set its ID to newOrder, and add two input arguments: productId (number) and customerId (string). 2. Add an HTTP Request node "Check stock" (ID checkStock), GET, with the URL as an expression: "https://dummyjson.com/products/" + $vars.newOrder.output.productId 3. Add an HTTP Request node "Check credit" (ID checkCredit), GET https://dummyjson.com/users/1 4. Add an Autonomous Agent node "Review order" (ID reviewOrder) with the default model. System prompt: "You review new customer orders. Accept an order only if the product has stock greater than 0 and the customer record is present. Otherwise reject it. Always give a short reason." Give the agent the response body of Check stock as the product, and the response body of Check credit as the customer. Output variables: accepted (boolean) and reason (string). 5. Add a Decision node "Accepted?" (ID accepted) with the condition $vars.reviewOrder.output.accepted 6. On True, add a Script node "Create order in CRM" (ID createOrderInCrm): return { orderCreated: true, productId: $vars.newOrder.output.productId }; 7. On False, add a Script node "Notify sales rep" (ID notifySalesRep): return { notified: true, reason: $vars.reviewOrder.output.reason }; The order is: New order → Check stock → Check credit → Review order → Accepted? → True: Create order in CRM, False: Notify sales rep. dummyjson.com is a public sample API, so these URLs work as they are. Then validate the workflow and fix any problems.The agent creates the project, adds the nodes, and validates the workflow. It may ask you questions along the way. Answer them from the prompt.
-
When the agent finishes, open the
.flowfile from the Explorer. It opens on the Flow canvas. -
Check the result:
- The canvas matches the workflow at the top of this page.
- No node shows a warning icon, and the Problems panel is empty.
- The bottom toolbar shows Maestro Automate. If it shows Maestro Orchestrate, select it and choose Maestro Automate.
If something doesn't match, tell the agent what's different, for example: "Check credit is missing. Add it between Check stock and Review order."
Result: your canvas matches the workflow at the top of this page.
Create the project
Create a Maestro Automate project wherever you build:
| Where you build | How to create the project |
|---|---|
| VS Code | Open the UiPath Maestro view with the UiPath icon in the Activity Bar. Select Create New, then select Maestro Automate in the New Project list. |
| Studio Web | Select the arrow next to Create New, then select Flow under Maestro Automate. |
| Studio Desktop | Open a solution. In the Explorer, select Add a project, then select Maestro Automate under Add to Solution. |
The project opens on the Flow canvas, with a Manual trigger already on it. The bottom toolbar shows Maestro Automate as the build mode.
Each tool also offers a project for Maestro Orchestrate: Maestro Orchestrate in VS Code, Flow under Maestro Orchestrate in Studio Web, and Maestro Flow in Studio Desktop. Make sure you select the one for Maestro Automate.
Start with a trigger
When building a workflow, the first question to answer is how it starts. A trigger is the step that starts every run. This workflow starts on demand, which is the easiest way to test it, so it uses the Manual trigger that is already on the canvas.
- Double-click the name of the Manual trigger and type New order. You rename every node the same way.
- On the Advanced tab, set its ID to
newOrder. Expressions in later steps use this ID. - On the Parameters tab, select Add input argument twice to add the order's details:
productId, of type number.customerId, of type string.
Result: the workflow accepts a product ID and a customer ID each time it starts.
Check the stock
The first question about an order is whether the product is in stock. An HTTP Request node asks another system by calling its API, the interface that apps use to exchange data.
-
Select the + on the outgoing handle of New order, search for HTTP Request, and select it.
-
Rename the node Check stock, and on the Advanced tab set its ID to
checkStock. -
On the Parameters tab, leave Authentication set to Manual authentication and Method set to
GET. -
Switch the URL field to expression mode, so that it shows
=at the start, and enter:"https://dummyjson.com/products/" + $vars.newOrder.output.productId"https://dummyjson.com/products/" + $vars.newOrder.output.productIdThe web address is in quotes, and
$vars.newOrder.output.productIdadds the product ID from the trigger to the end of it. You can add the$varspart with { } Insert instead of typing it.If the editor suggests
productIdas you type, accept the suggestion withEnterinstead of typing the name, or it's entered twice.
$vars holds the output of earlier nodes. An expression reads it as $vars.<node ID>.output. A field in expression mode is JavaScript, so text such as a web address goes in quotes. Variables and data flow describes how data moves between nodes.
Test what you have so far
- Select Run Debug (▶) in the bottom toolbar of the canvas, enter
1for productId andc-100for customerId, then start the run. In Studio Web, start it with Save & Debug. - In the panel below the canvas, on the Variables tab, expand Check stock. Its Outputs show
codeset to200, and the product's data inbody, including itsstock.
If Check stock fails, select it in the Execution trace to see the error. The most common cause is a URL expression without quotes around the web address.
Result: the workflow already reads real data from an API. You can run it again the same way after each node you add.
Check the customer's credit
- Select the + on the outgoing handle of Check stock, add another HTTP Request, rename it Check credit, and set its ID to
checkCredit. - Leave Method set to
GET, and in URL, enterhttps://dummyjson.com/users/1.
In this tutorial, the sample user record stands in for the customer's credit record.
Let an agent decide
An agent is an AI model that you give instructions and tools. Instead of following fixed rules, it reads the data and decides.
-
Select the + on the outgoing handle of Check credit, open the Agent category, and select Autonomous agent.
-
Rename the node Review order, and set its ID to
reviewOrder. -
Leave Model set to the default model.
-
In System prompt, enter the agent's instructions:
You review new customer orders. Accept an order only if the product has stock greater than 0 and the customer record is present. Otherwise reject it. Always give a short reason.You review new customer orders. Accept an order only if the product has stock greater than 0 and the customer record is present. Otherwise reject it. Always give a short reason. -
In User prompt, enter
Product:, add$vars.checkStock.output.bodywith { } Insert, then enterCustomer:and add$vars.checkCredit.output.bodythe same way. Each inserted value appears as a chip in the prompt. -
Under Outputs, select Add output variable twice:
accepted, of type boolean.reason, of type string.
Result: the agent returns accepted and reason, which the next nodes can read.
Branch on the decision
-
Select the + on the outgoing handle of Review order, open the Control category, and select Decision. Rename it Accepted? and set its ID to
accepted. -
In the condition, enter
$vars.reviewOrder.output.accepted. The Decision node gets a True and a False handle. -
On the True handle, add a Script node named Create order in CRM, with the ID
createOrderInCrm, and enter this code:return { orderCreated: true, productId: $vars.newOrder.output.productId };return { orderCreated: true, productId: $vars.newOrder.output.productId }; -
On the False handle, add a Script node named Notify sales rep, with the ID
notifySalesRep, and enter this code:return { notified: true, reason: $vars.reviewOrder.output.reason };return { notified: true, reason: $vars.reviewOrder.output.reason };
In a real workflow, Create order in CRM and Notify sales rep would be connectors, ready-made connections to apps such as your CRM and Slack. Connector lists every connector.
Result: your canvas matches the workflow at the top of this page, and no node shows a warning icon.
2. Test it
Testing runs the workflow on the canvas with sample data.
- Ask the agent: "Debug the workflow with productId 1 and customerId c-100."
- The agent runs the workflow and reports the result. Each node should complete, and the run should take the True path to Create order in CRM, because the sample product is in stock.
- Check the agent's decision in the report:
acceptedistrue, with a short reason, such as "Product is in stock and customer record is present."
To see the run yourself, select Run Debug (▶) in the bottom toolbar of the canvas instead, and follow the steps on the Manually on the canvas tab.
-
Select Run Debug (▶) in the bottom toolbar of the canvas. A dialog asks for the values of the trigger's inputs.
-
Enter
1for productId andc-100for customerId, then start the run. In Studio Web, the dialog is Debug configuration, and you start the run with Save & Debug.In Studio Web, the values are saved for the next run.
-
Wait for the run to finish. Each node shows a green check mark, and the run takes the True path to Create order in CRM, because the sample product is in stock.
-
In the Execution trace, expand Review order and select Agent output. The Result tab shows the agent's decision,
accepted: true, and its reason.
Select Review order itself to see the data that the agent received: the full product record from Check stock and the user record from Check credit.
If a node fails, select it in the Execution trace to see the error. Debugging basics covers the debug tools in detail.
Result: your workflow runs from the trigger to the branch, and the agent's decision is visible in the trace.
3. Deploy and run it
So far, the workflow has only run as a test. Deploying it makes it a live workflow that runs without the canvas. Each run counts toward your plan's monthly runs.
-
Ask the agent:
Deploy this workflow, then start one run with productId 1 and customerId c-100, and tell me where I can see the run.Deploy this workflow, then start one run with productId 1 and customerId c-100, and tell me where I can see the run.The agent packages the project, deploys it, and starts a run with those inputs.
-
When the run has had time to finish, ask: "Is the run finished? Tell me its final status and which branch it took."
The agent reports that the run is Successful and took the True path to Create order in CRM.
- Deploy the workflow:
- Studio Web: select Deploy, and wait for Deployment successful.
- VS Code or Studio Desktop: follow Deploy a workflow.
- Open Start job:
- Studio Web: on the success screen, select Start job.
- VS Code or Studio Desktop: in Orchestrator, select Solutions, select the folder you deployed to, then select your solution. In its panel, select Start job.
- Under Input, enter
1for productId andc-100for customerId, then select Start. - To follow the run, select the product launcher, the grid icon at the top left of the page, then select Maestro.
- Select Flow instances, then the name of your workflow.
- Select the run to see each step it took on the canvas.
Result: your workflow is deployed, and its first run took the True path to Create order in CRM.
What you learned
- Triggers: every workflow starts with one, and input arguments carry the data that each run starts with.
- HTTP requests: a node calls another system's API and makes the response available to later nodes.
- Expressions:
$vars.<node ID>.outputreads the output of an earlier node. - Agents: an agent reads data, decides, and returns the output variables you define.
- Decisions: one condition sends each run down one of two paths.
- Testing: a debug run shows what every node received and returned.
- Coding agents: an agent can build the same workflow from a description, and you check it on the canvas.
- Deploying: a deployed workflow runs without the canvas, and each run is listed with its status.
Next steps
- Evaluations: check the agent's decisions against a set of sample orders. The Add to evaluations button on a trace entry is a quick way to start.
- Deploy a workflow: make the workflow run without you.
- Connector: replace the two scripts with real apps.
- Node reference: every node and how to configure it.
- Community: ask questions and share workflows with other builders.