Operation · Controlling how a Flow runs
Learn how to process video frames with While Loop and create branching paths with If-Then and Switch Case.
1. Overview
Before starting the Mini Projects, you will practise three Operation Nodes used throughout this course: While Loop, If-Then, and Switch Case.
The While Loop Node repeats a sequence of Nodes. A video Input can come from a Webcam or a video file through Server Media Input. It provides one Frame each time it runs. Placing the video processing steps inside a While Loop allows the Flow to read and process Frames continuously.
The other two Nodes create branching paths. If-Then directs the Flow to one of two main paths based on a condition, while Switch Case compares a value with several Cases and follows the matching path.
These Nodes control the order and direction in which a Flow runs rather than transforming the data itself. You can find all three in the Operation category of the NARA Node panel. To learn about transforming numeric data, see Process. Data storage is covered in Database Table, and connections to external systems are covered in IO.
Each topic in this chapter includes a small Flow to build, deploy, and test. You can complete the topics in order or return to a specific page while working on the Mini Projects.
2. Learning objectives
By the end of this chapter, you will be able to:
- Explain why a video Input provides one Frame each time it runs.
- Configure the While Loop Node, including Loop Delay, Break Loop, and Invert Break Condition.
- Use the Then, Else, and Skip outputs of the If-Then Node.
- Build a condition using a Data Type, comparison operator, and two values.
- Choose between Fixed Value and Reference.
- Use Switch Case to create several paths from one value and handle unmatched values with the Default output.
- Place Resize after a video Input so that downstream Nodes receive Frames of a consistent size.
3. Prerequisites
Before you continue
This chapter assumes that you can build and deploy a simple Flow. If you have not completed the Basic Course, start with Build Your First Flow.
Before starting this chapter, you should be able to:
- Add Nodes and connect them in a Flow.
- Create a Dashboard page and add a Widget.
- Use the Variable: Create and Variable: Modify Nodes.
4. Topics in this chapter
Each topic can be completed independently. Follow them in order if these Nodes are new to you, or open the topic you need as a reference. Links to the complete reference documentation are included where each Node is used.
1 · While Loop
Repeat a sequence of Nodes until a break condition is met, and process a video one Frame at a time.
2 · If-Then
Direct a Flow to the Then, Else, or Skip output based on a condition.
3 · Switch Case
Compare one value with up to four Cases and follow the matching output.
Start here
If these Nodes are new to you, begin with While Loop · Reading video Frame by Frame, then continue through the topics in order.
Course Introduction · Designing Flows for Different Tasks
Preview the three Mini Projects, compare their Flow patterns, and learn how Triggers determine when each Flow starts.
While Loop · Reading video frame by frame
Why a video Input reads only one frame, how the While Loop Node repeats the work to make it continuous, why the picture should be resized before anything else uses it, and what Loop Delay, Break Loop, and Invert Break Condition do.