Flow Controls

Each Action has an “Advanced” tab in the Edit Panel where you can control the behavior of an action for more advanced needs.


You can set a timeout value when configuring an action. By default, the timeout value is set to 10 minutes which means the action will be stopped after 10 minutes regardless of whether it finished its execution. If an Action is stopped due to a timeout, its status is marked as ‘failed’. There is no maximum timeout per action, but there is a maximum timeout for the entire pipeline’s execution which is 6 hours.


If the action fails, you can choose how many times to retry executing the action. This is set to 0 by default.

Stop Pipeline on Failure

Choose whether the entire pipeline’s execution should stop when a particular Action fails to execute. This is set to True by default.


Kaholo allows you to use conditional If / Else statements in JavaScript to control whether a particular Action should or shouldn’t execute. You can condition an action based on a previous action’s status, its final result payload, or based on a particular pipeline Configuration that was triggered for the current execution.

Condition fields have access to the same JavaScript context and Kaholo SDK as the main Code Layer and Action Parameter Fields. For example, within the Condition field, you can invoke a function from the main Code Layer.

Condition Example 1: Previous Action’s Status

Here’s how to conditionally trigger an Action based on the status of a previous Action:


Condition Example 2: Previous Action’s Final Result

In this example, we’re setting the condition for an Action to run only if a previously created EC2 instance is running. This is achieved by accessing the previous Actions final results, which in this case is AWS’s response after creating the Instance.

actions.createEC2.result.Reservations[0].Instances[0].State.Name == "running")


Loops enable you to execute an Action or a set of Actions repeatedly until a certain condition is met. To create a loop, start dragging the circle on the right side of an Action and link it either to the starting point (left side) of the same action, or the starting point of another Action.

After linking to create the Loop, you can use the Condition field to set a JavaScript condition that determines if the Action should be executed.

timesTried < 10

Flow Control – Action Coordination

Whenever there is more than one incoming link into an Action, an additional setting is displayed in the “Advanced” tab of that action where you can determine when how many times an Action is executed in relation to actions that come before it.

  • Wait for all: Only appears when there isn’t a loop on that Action
  • Run once for first: Will execute the Action only once
  • Run for each in link: Will execute the Action every time a previous Action is executed


Hooks allow you to execute any JavaScript function before or after an action is executed. The Hooks are executed under the same context as the main Code Layer and have the same access to the Kaholo SDK.

Pre-Execution function

This function runs with agent context before the action is executed. You can enter the function directly in the code field or call it from the Code layer. The result will be added to the same context.

Post-Execution function

This function runs with agent context after the action is executed. You can enter the function directly in the code field or call it from the Code layer. The result will be added to the same context.

Note: When using a Loop, you typically create a Post-Execution function to increment a variable to determine how many times the Action should be executed.

Another example of using Post-Execution functions is to transform the Action’s Final Result like from Text to JSON to be used in any subsequent Action.

Page Contents