Skip to main content

Simple Loops with Torq - Workflow Template

Example of using a loop over JSON data and loop over a range in a workflow. Results are collected with the "Collect" operator

Updated over a week ago

The "Simple Loops with Torq" workflow template is designed to demonstrate efficient data processing using parallel loops. It processes JSON data to categorize engine names based on their verdicts, while simultaneously iterating over a numerical range. This template is ideal for businesses looking to streamline data categorization and analysis, offering a practical example of how to manage and manipulate data sets effectively within automated workflows.

Workflow Breakdown

  1. Add a JSON object to the workflow context.

  2. Runs two different loops in parallel threads.

  3. Right branch loops over a list of JSON items, and creates a separate list of engine names by verdict.

  4. Left branch loops over a defined range from 1 to 10. Collects a text message about the loop count and wait 2 seconds before continuing the loop.

Vendors

Utils

Workflow Output

Simple output of each loop that is run

Tips

  • Review the output of the loop over JSON data and the collector contents.

  • Review the output of the loop over range. Modify the if step for the loop to break earlier or later in the loop.

Did this answer your question?