Skip to main content

 

Cisco Meraki Documentation

Logic Activities

Logic Activities

Automation includes logic activities to expand the capabilities of your workflows. Logic activities allow you to perform actions such as creating loops, setting conditions for branching, and choosing specific start and endpoints in a workflow.

Variable size is limited to 1 MB. As of October 4, 2023, the size of the Large String workflow variable type is limited to 10 MB.

Automation logic includes the following activities:

  • BreakUse the Break activity to stop a loop and proceed to the next activity. This activity can only be used within a loop to perform loop control.

    You can skip the rest of a single iteration of a loop or continue on failure using the Continue activity. You must first configure either a For Each Loop or a While Loop and then drag the Break activity into the loop. There are no additional properties to configure.

  • CompletedUse the Completed activity to stop a workflow and mark it as completed. You can insert a Completed activity anywhere in a workflow.
  • Condition BlockUse the Condition Block activity to specify multiple paths for your workflow based on a series of one or more conditions.  These are the same as a traditional if/then/else type statements in scripting. For more information, see the Conditional Block section.
  • ContinueUse the Continue activity to continue running a workflow after a condition branch in a loop fails. This activity can only be used within a loop and allows the workflow to continue running after a failure. An example use case would be for a loop that runs the maximum number of 500 times. When the loop attempts to run again, it will fail. Add a Continue activity to continue to the next activity in the workflow.

    You can also use the Continue activity to skip a single iteration of a loop.

  • For EachUse the For Each activity to create a loop that runs once for each item in a source array. For Each loops are one of the two types of loops available in Automation. This type of loop consumes an array of data and runs the content of the loop a single time for each item in the array. If you want to loop for an arbitrary number of times or while a condition is true, see the While Loop Help topic.
  • When naming the For Each activity, always specify the entity name which will be used in a loop (example: expand For Each to For each indicator)

  • You can stop a loop using the Break activity.

  • You can skip the rest of a single iteration of a loop or continue after a failure using the Continue activity.

  • The source data for a For Each loop must be an array. This often comes from activities such as Read Table from JSON/Text/XML or Split String. To provide the source data for the loop, you must choose the array variable. 
  • Within the For Each loop, you may want to use the values in the table columns. You can do this by using the variable browser to choose the Loop, Source Array, Items, and Column you want to use.
  • Two variables are available that enable a content author to set the state of observables in their incident response workflows that are intended for use by playbook tasks.

    In the Set Variables activity within a For Each loop, go to the activity properties, open the variable browser, search or navigate to choose Result Message (string) and Succeeded (true or false), and enter their values.

  • GroupUse the Group activity to create containers within your workflow for easier readability.
  • Parallel BlockUse the Parallel Block activity to create branches in your workflow that run at the same time (parallel).
  • Start PointUse the Start Point activity to define a non-default starting point for your workflow. By default, when you run a workflow, it starts at the top and works its way down. You can place Start Point activities throughout the workflow, and when you run the workflow, you can choose which Start Point you want to use.
  • While LoopUse the While Loop activity to create a loop that runs based on the conditions you configure. A While Loop is one of the two types of loops available in Automation. This type of loop will continue running as long as its control condition is true. If you want to iterate through a list of objects in a table, see the For Each Loop Help topic.
  • You can stop a loop using the Break activity. 

  • You can skip the rest of a single iteration of a loop or continue after a failure using the Continue activity.

A While Loop activity runs for as long as the control condition is true. This control condition functions the same way as a Condition Block in that its control condition is a logical statement. You can either:

  • Set this condition to something that will always be true and use a Break activity to stop the loop.
  • Use a loop control variable. When you use a loop control variable, you change the value of the variable when you want the loop to end.

If you forget to stop a While Loop, it will keep running for quite a while before automatically stopping. If you are iterating through a list of items, it is usually better to use a For Each Loop.

Using a Loop Control Variable

Use the following steps to create a loop variable that you can change to stop the loop:

  1. Create a local variable using the Boolean data type and set its value to true.
  2. Add a While Loop activity and set its condition to check whether or not the local variable you created is equal to true.
  3. Inside the loop, when you are ready for the loop to end, you can either set the local variable to false or use a Break activity.
  • Was this article helpful?