false, which would cause the Action to never execute. If you leave it blank the Action will always execute.
Example 1: Execute the Action only if a previous Action in the Pipeline was skipped
Here’s how to conditionally trigger an Action if a previous Action in the Pipeline was skipped.
If the Action with ID “attachNewVolume” was skipped, this evaluates to
true, so this Action will execute.
Example 2: Execute an Action based on an earlier Action’s final result
In this example, we have an action that will start an Amazon EC2 instance only if it is not already running. The previous action ID is “getServerStatus”, and the final result is a JSON document that comes from the “describeInstances” method of the Amazon EC2 plugin.
(actions.getServerStatus.result.describeInstances.Reservations.Instances.State.Name != "running")
Pre and Post-Execution Functions
Pre and Post-Execution Functions are simply code functions that execute immediately before and after the Action, respectively. You can use this for nearly anything – gathering information for Conditional Code, gathering or assembling Action’s parameters, triggering external systems in preparation for the Action, or publishing the Action’s results to external systems. These functions are also very useful to execute logical loops and stash results in variables along the way.
Action Coordination determines if an Action runs only once or potentially many times. It allows you to control when the Action is executed in relation to Actions that come before it.
You will see this in the Advanced tab of an Action’s edit panel only when more than one flow is connected to the front end of the Action, for example when Action is looping back upon itself. There are up to three options for this:
- Wait for all – the Action will run only when every inbound flow has successfully arrived. This is not an option for Actions that start loops.
- Run once for first – the Action will run only once, when first triggered by any upstream Action.
- Run for each in link – the Action will run every time any upstream Action triggers it, or a loop re-enters it.
The Action Coordination can be used in combination with Conditional Code, for example skipping an execution whenever the code evaluates to
false. However, if the Action Coordination does NOT run the action, then the Conditional Code has no effect at all. A loop, for example, cannot work if we have configured Action Coordination to “Run once for first”.