UiPath Documentation
maestro-automate
latest
false
Maestro Automate user guide

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.

1. Build the workflow​

  1. Create an empty folder for the project, and open it in VS Code.

  2. Start your coding agent in that folder. For example, for Claude Code, run claude in the VS Code terminal.

  3. 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.

  4. When the agent finishes, open the .flow file from the Explorer. It opens on the Flow canvas.

  5. 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.

2. Test it​

Testing runs the workflow on the canvas with sample data.

  1. Ask the agent: "Debug the workflow with productId 1 and customerId c-100."
  2. 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.
  3. Check the agent's decision in the report: accepted is true, 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.

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.

  1. 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.

  2. 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.

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>.output reads 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.

Was this page helpful?

Connect

Need help? Support(opens in new window)

Want to learn? UiPath Academy(opens in new window)

Have questions? UiPath Forum(opens in new window)

Stay updated