UiPath Documentation
getting-started
latest
false
Getting started developer guide
  • Introduction
    • Overview
    • Environment set up
  • Getting Started with UiPath Agents
  • Getting Started with UiPath Agents using LangGraph
  • Building a Low-Code Agent in Studio Web
  • Adding Tools to Your UiPath Agent
  • Getting Started with UiPath Maestro Flow
    • Introduction
    • Build the flow
    • Verify the flow
    • Test the flow
    • Deploy the flow
    • Run the flow

Build the flow

Build the Price Watch Flow using VS Code by adding each of the 6 nodes and configuring them.

Open PriceWatch/PriceWatch.flow and you will see one Manual trigger node named start on the canvas. We will now cover the foundational building blocks, and then add the five remaining nodes, the three trigger inputs, and the one output variable for our Flow.

We will be using the terms "downstream" and "upstream" for the rest of this tutorial, and you should familiarize yourself with them:

  • Upstream: the nodes that come before a given node in the flow's execution path. A node's upstream nodes are everything it depends on: their outputs feed into it, and they must complete before it can run.
  • Downstream: the nodes that come after a given node in the flow's execution path. A node's downstream nodes are everything that depends on it: they consume its outputs and are affected if it fails, changes, or is re-run.

How to rename a node ID

You will do this five times on this page, so it is worth reading once. A node's label and its ID are two different fields, and the ID has its own editor. A node added from the palette takes its ID from the node type's default label, so the first End node is end1 and the second end2. Setting the label on the Advanced tab does not change the ID.

To change an ID:

  1. Select the node on the canvas. An inline toolbar appears over it: Edit, Replace node, More options.
  2. Select the pencil, Edit.
  3. Open the Advanced tab. The ID field is displayed read-only, with a pencil beside it, Rename node ID.
  4. Select that pencil. A Rename node ID dialog opens with a New ID field.
  5. Enter the new ID and select Rename.

The dialog states the rules and, above the buttons, how much it is about to rewrite: for a wired node it reads "1 reference will be updated" and "1 connection". Rename stays disabled until you actually change the value. So the rename is a refactor, not a text edit: expressions that name the node are updated with it.

Important:

Why the canvas needs a rename step and the CLI does not: uip maestro flow node add --label derives the ID from the label, using --label "Fetch rate" produces fetchRate1 in one command. The canvas takes the label and the ID separately, and defaults the ID from the node type and adds a number to the end, starting at 1. Rerunning the same command to add another node with the label "Fetch rate" will set its ID to fetchRate2.

This page renames each node immediately after adding it, before any expression references it, so every rename reports zero or one reference and there is nothing to untangle later.

Step 2.1 - Declare the trigger inputs

The flow needs its three inputs before the HTTP Request node can reference two of them.

  1. Select the Manual trigger node on the canvas.

  2. Open the properties of the node with the "Edit" button.

  3. Use the + Add input argument button to add baseCurrency with type String and default value USD.

  4. Use the + Add input argument button to add quoteCurrency with type String and default value EUR.

  5. Use the + Add input argument button to add alertThreshold with type Number and default value 0.9.

  6. Confirm your input variables match the following:

Step 2.2 - Add the HTTP Request node

The HTTP node type will be used to call the Frankfurter API to retrieve the exchange rate data. Create it with the following steps:

  1. Select the + on the outgoing handle of the Manual trigger node.

  2. Search the node palette for HTTP Request and select it.

  3. Open the properties of the new node with the "Edit" button.

  4. Set the node Label to Fetch rate.

  5. Rename the ID field from httpRequest1 to fetchRate1.

  6. In the properties panel, leave Authentication set to Manual authentication.

  7. Set the HTTP Method to GET.

  8. Set the URL to https://api.frankfurter.dev/v2/rates.

  9. Under the Query parameters section, use + Add pair twice to add two empty key/value pairs.

  10. For the first pair, set the key to base and value to $vars.start.output.baseCurrency.

  11. For the second pair, set the key to quotes and value to $vars.start.output.quoteCurrency.

Confirm the node's ID in the properties panel reads fetchRate1 under the Advanced tab and that both query parameters are saved. At run time the node requests https://api.frankfurter.dev/v2/rates?base=USD&quotes=EUR and exposes exactly three keys:

  • $vars.fetchRate1.output.body - the parsed response body
  • $vars.fetchRate1.output.code - the HTTP response status code
  • $vars.fetchRate1.output.headers - the HTTP response headers

Under the hood, any HTTP Request node requires an Integration Service to make an API call. As the Frankfurter API does not require authentication, setting the Authentication method to Manual authentication creates an implicit connection using the configuration we provided instead of requiring explicit creation of the connection first, and then selecting it from the dropdown.

Step 2.3 - Reshape the response with a Script node

We will use a Script node to use the data from the body of Frankfurter API's response JSON array. It returns an array with one entry per quoted currency - we are only requesting one for each of our API calls, so the array will always contain only 1 result:

[
  {
    "date": "2026-09-01",
    "base": "USD",
    "quote": "EUR",
    "rate": 0.86111
  }
]
[
  {
    "date": "2026-09-01",
    "base": "USD",
    "quote": "EUR",
    "rate": 0.86111
  }
]

Follow these steps to create the Script node:

  1. Select the + on the outgoing handle of the Fetch rate node.

  2. Search the node palette for Script and select it.

  3. Open the properties of the new Script node with the "Edit" button.

  4. Set the node's Label to Reshape rate.

  5. Rename the ID from script1 to reshapeRate1.

  6. In the script editor, enter the following:

    const rates = $vars.fetchRate1.output.body;
    const quote = $vars.start.output.quoteCurrency;
    const match = rates.find(function (entry) { return entry.quote === quote; });
    const rate = match.rate;
    
    return {
      pair: match.base + "/" + quote,
      rate: rate,
      asOf: match.date,
      belowThreshold: rate < $vars.start.output.alertThreshold
    };
    const rates = $vars.fetchRate1.output.body;
    const quote = $vars.start.output.quoteCurrency;
    const match = rates.find(function (entry) { return entry.quote === quote; });
    const rate = match.rate;
    
    return {
      pair: match.base + "/" + quote,
      rate: rate,
      asOf: match.date,
      belowThreshold: rate < $vars.start.output.alertThreshold
    };
    

The API returns an array that may contain multiple results, so the script shouldn't assume the value we want is the first entry. Instead of indexing into rates[0] or comparing against a hardcoded "EUR", we find the entry where quote matches the quoteCurrency value supplied at run time. The script then compares the current rate against the threshold and includes the result in the node's output object, keeping the comparison logic next to the code that consumes the API data rather than repeating it in the Decision node.

Warning:

Enter the body exactly as shown, with no function wrapper. A function main(input) { … } wrapper around the code will still execute successfully, but it will return null instead of the return object. This will prevent downstream nodes using the data - this is different from UiPath Coded Function, which does use the wrapper.

Downstream nodes can now read the output variables as:

  • $vars.reshapeRate1.output.pair
  • $vars.reshapeRate1.output.rate
  • $vars.reshapeRate1.output.asOf
  • $vars.reshapeRate1.output.belowThreshold

Step 2.4 - Route based on the result

A Decision node splits the flow into two paths based on the value of belowThreshold - it is a boolean, so can only be true or false. For each of these branches, we will add an End node to return the result using an output variable. We set the value of this output variable on each of the Decision node's branches, but first we need to create the variable, and then use it when adding our Decision node:

  1. Select the Variables tab in the properties panel with no node selected.

  2. Use the + next to "Outputs" to open the dialog to add an output variable.

  3. Create the variable with the name watchResult, type Object, and no default value.

  4. Select the + on the outgoing handle of the Reshape rate node.

  5. Search the node palette for Decision and select it.

  6. Open the properties of the new node with the "Edit" button.

  7. Set the node's Label to Below threshold.

  8. Rename the node's ID from decision1 to belowThreshold1.

  9. Set Condition to:

    $vars.reshapeRate1.output.belowThreshold === true
    $vars.reshapeRate1.output.belowThreshold === true
    

    No =js: prefix here, unlike the query parameters on the HTTP node. A Decision expression is a native Flow field that the Flow engine evaluates itself, so it is already JavaScript.

  10. Set the True branch label to Alert.

  11. Set the False branch label to No action.

    The labels appear on the node's two output handles, so the canvas and the execution trace both read as business rules rather than as true and false.

Step 2.5 - Add the Alert End node

The Decision node has 2 branches, first, add the Alert branch's one with:

  1. Select the + on the Alert branch.

  2. Search the node palette for End and select it.

  3. Open the properties of the new End node with the "Edit" button.

  4. On the Parameters tab, set the Expression for watchResult to:

    $vars.reshapeRate1.output
    $vars.reshapeRate1.output
    
  5. On the Advanced tab, set the Label to End alert.

  6. Rename the node's ID from end1 to endAlert1.

Step 2.6 - Add the No Action End node

Now add the No action End node for the other branch of the Decision node with:

  1. Select the + on the No action branch.

  2. Search the node palette for End and select it.

  3. Open the properties of the new End node with the "Edit" button.

  4. On the Parameters tab, set the Expression for watchResult to:

    $vars.reshapeRate1.output
    $vars.reshapeRate1.output
    
  5. On the Advanced tab, set the node's Label to End no action.

  6. Rename the node's ID from end2 to endNoAction1.

The canvas should now show six connected nodes and five edges, a single fork after the Decision node, and both End nodes carry a mapping for watchResult. Your Flow should now look similar to the one below, you can use the broom icon to arrange the nodes in the Flow, and the Fit to screen button to resize the Canvas to fit your screen.


Now that it is built, we will Verify the Flow using the uip maestro flow validate command.

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated