Skip to main content

Build your First Flow

Create a flow from scratch

Holly Conrad Smith avatar
Written by Holly Conrad Smith
Updated over a month ago

Let’s build a simple flow to get started! Follow along to build your own.

For this demonstration, we will create a rectangle that is re-colored based on its area:

The skills you learn from creating this flow are transferrable to any other parametric design you may wish to create.

Get Started

Start with a saved project.

  1. Draw a generic Rectangle on your map canvas. It can be any size for now.

  2. Click to select the rectangle you drew.

  3. Open the flow builder by clicking the Flow Editor icon.

    You will see a list of suggested basic flows.

  4. Select Identity

Identity applies the most basic flow - one input and one output. Your flow will look like this:

Essentially, this flow doesn’t do anything (yet). It simply reads the feature (your rectangle) and then writes that feature back to the map.

Let’s add some nodes in between to make this rectangle into something new.

Add Instructional Nodes

To make the flow do something interesting, we need to add nodes and connect them with wires.

First, Calculate Area

In this section, you will calculate the area, and apply logic to determine if the area is larger or smaller than a value you choose.

  1. Double click anywhere on the canvas to search nodess.

  2. Search “area,” then click “geometric operations → area.

    The area node has been added to the canvas.

    Note the Green Feature input, and the Red area output. This node calculates the area of the Feature, then outputs the area as a Number.

  3. Click the output connector on “read feature,” then click the input connector on “area.”

    It may appear as if nothing has happened on your map canvas, but the flow is now calculating the area of the rectangle you drew.

  4. To preview the result, add an inspector panel to the flow, and connect it to the Red A connector.

    Then, click the Glasses in the toolbar to show the properties of the selected feature.

    The area of your rectangle displays in the inspector panel!

Now, let’s do something with the area.

Add “Greater than or Equal To”

Our goal with this node is to identify if the rectangle’s area is greater than or equal to a value we specify.

  1. Add the greater than or equal node

    This node is more complex than Area, with multiple inputs. Let’s explore what this node requires to perform the comparison.

    A and B both expect numbers (red connector).

    The node will check whether the first value (A) is greater than or equal to the second value (B).

  2. Connect the Area output to the A input.

  3. Input a desired number (say, 1000) into the B box.

    The node will now compare the Area of the rectangle to the number you input in the B box. The result returned is a true/false (boolean) - true if the Area is greater than or equal to B, false if the area is less than B.

Now, let’s tell the flow what to do with that true/false result.

Add “Ternary If”

Our goal with this node is to tell the flow what to do, based on the results of our greater than or equal to node’s result.

  1. Add the ternary if node.

    This node also has multiple input connectors.

    Let’s explore what each input expects:

    • C - condition (boolean)

    • a - What to do if the result of the boolean is true

    • b - What to do if the result of the boolean is false

    The result is either action a or action b, based on the boolean condition.

  2. Connect the output of the Greater than or Equal node to the C input of the Ternary If.

  3. Then, connect the R output of the Ternary If to your original Write Feature node.

You may notice that your rectangle on the map is now invisible. That’s because we need to give instructions to the a and b inputs.

Let’s do that now.

Apply a Color

The goal of this step is to apply a color to the rectangle. You will have 2 copies of this step - one connected to a and one connected to b of Ternary If.

  1. Add the write feature property node.

    • F - the feature you want to write the property to. In this case, it’s the original rectangle!

    • P: the property to write

    • V: the value to write to that property

  2. For P, you can type into the box. Type “color” - the name of the property we want to write.

  3. For V, we have to add another node. Add the string node and type a color name into it (i.e. green). You could also use a more complex node like construct color if you wish.

  4. Then, connect the Read Feature node to the F input. It will look something like this:

    Note that Read feature has two wires coming from its output now! That’s correct - you are doing multiple things with the same node.

  5. Now connect the F output from Write Feature Property into the a input of Ternary If. Your flow will look something like this

    If you rectangle meets the conditions of your Greater than or Equal node, the rectangle will have changed color!

    If not, no worries! We just need to create the b condition now.

  6. Hold shift and select the write feature property and string nodes on your canvas. Use ctrl + c and ctrl + v to duplicate those 2 nodes.

  7. Input a different color into the new string node.

  8. Then, connect the output of the new write feature property node to the b input on Ternary If.

Test it out!

The flow is complete. Test it out by adjusting the size of the rectangle.

You’ll see its color change based on the area!

Make it Pretty

Now that we have a working flow, let’s clean it up for easier re-use.

Rename it

Click the rename button in the toolbar, and give the flow a unique and descriptive name. This will make it easier to add to other geometries in a future step, and it makes it easier to select a flow to edit from the dropdown.

Organize It

The best practice for visual programming is to organize nodes from left to right, as they operate in the flow.

Your flow may look a bit jumbled, like this:

Take a moment to re-organize it so wires don’t cross and it visually tracks left to right.

You can select 2 or mode nodes and click “align to top” in the canvas toolbar if you like to have nodes aligned.

Set it up for Distribution

You are brave, being willing to dive into a new type of interface to build parametric designs. Everyone on your team may not want to, have time to, or have the skills required to learn Flow.

That’s okay! You have tools in your (node-based) toolbox to make it easier for your team to use the flows you’ve created.

There are 3 parameters within the flow we just created that you might want to change on the fly - the Greater than or Equal to number, and the 2 color options.

In its current state, you have to edit these inputs in the Flow editor. However, by using the Input Parameter node, you can expose these in the Properties palette under the flow controls section!

Let’s do it

Add the Input Parameters Node

The input parameters node is a special input that allows you to create a custom user-input that appears in the Properties Palette.

  1. Add the Input Parameter node.

    • Name = the name of the field that appears in the properties palette

    • Description = the mouseover help text

    • Type = the type of data the input accepts

      The data types available are:

      • String: text or symbols

      • Number: A number (double)

      • Color: hex code with a color selector

      • Boolean: true/false, displayed as a toggle

  2. Let’s create the input parameter for the Greater than or Equal to node:

    We chose to name the parameter greater than or equal to because it is very clear what that means to the end user You can name it anything you like, though.

  3. Connect it to the greater than or equal to B input:

  4. For the 2 colors, we chose to create the following inputs:

    We chose to use the color type for more end user control, but you could also use the string type to more closely mimic the original flow design.

Edit in Properties!

Once the input parameter nodes are connected into the flow, the parameters appear in the properties palette like this:

End users can edit these inputs without opening the flow editor!

Did this answer your question?