When a Workflow is triggered by a query or event that returns multiple assets, Axonius offers two ways to process these assets:
- Split Run (default) - Each asset triggers a separate, independent Workflow run. While this ensures specific handling of each asset, it can limit data sharing across individual runs, making consolidated reporting and multi-asset Workflows more complex.
- Loop Run - The Workflow processes all assets in a single run by iterating through them. This method allows for seamless data sharing and collective handling across all assets, giving you greater control over how your Workflows process multiple assets. All assets are processed by the sub-workflow before the main Workflow continues.
This page explains how to implement Loop Runs by configuring sub-workflows within your main Workflows. A sub-workflow enables you to run a group of tasks on each asset returned from a query or on assets resolved from a previous node. This makes your Workflows more robust and versatile, especially for scenarios requiring iteration over lists or multiple objects.
- Each sub-workflow supports up to 100,000 assets.
- When a sub-workflow completes running on all specified assets, it exits back to the main Workflow (following the left branch).
- Nodes within a sub-workflow can use assets from previous nodes, both within the sub-workflow itself and from the main Workflow.
- Nodes in the main Workflow cannot run on assets from nodes within a previous sub-workflow.
Creating a Sub-Workflow
To create a sub-workflow
- Below an existing node in your Workflow, click the Repeat for Each button. This adds a Repeat for Each node to your Workflow, with two branches.
- In the Repeat for Each node configuration, select the assets on which to run the sub-workflow.
- In the right branch (the sub-workflow path), add the nodes that define the tasks to be run for each asset.
- In the left branch, add nodes that the main Workflow will proceed to after the sub-workflow completes running on all assets specified in the Repeat for Each node. You can start this branch with an Action, Delay, or Repeat for Each node.
Selecting Assets for a Sub-Workflow
In the Repeat For Each node, you specify the assets that the sub-workflow will run on. There are two methods for asset selection:
- Assets resolved from previous nodes - The sub-workflow will run on assets that were identified or processed by a prior node in the main Workflow.
- Assets returned from a query - Define a specific set of assets for the sub-workflow to run on by building a query using the query wizard.
You can always modify the sub-workflow assets by clicking the Edit Asset pencil icon next to the Runs on action within the Repeat for Each node configuration.
Running on Assets from Previous Nodes
To configure the sub-workflow to run on assets resolved by a preceding node
- From the Run action on resolved assets from previous nodes dropdown (open by default; if not, click Select Resolved Assets From Previous Nodes), select the desired set of resolved assets.
- You can expand the Workflow Data repository and view the resolved assets per Event node and Action node. However, you can only choose a resolved asset from the dropdown in the Repeat For Each drawer; you can't paste an asset from the Workflow Data repository.
- Data from bulk action nodes is not available in the Workflow Data repository for selection.
Running on Assets from a Query
To configure the sub-workflow to run on assets defined by a query
- Click Select Asset Using the Query Wizard.
- Under Run action on asset that matches the query, configure your desired query using the Query Wizard.
- Click Apply.
Building the Sub-Workflow
The sub-workflow always starts with an Action node. Each subsequent node within the sub-workflow supports all standard workflow features, with the exception of nesting another sub-workflow. This means you can add any node type (Condition, Action, Event, Delay) after any node in the sub-workflow, except for another Repeat For Each node.
To build the sub-workflow
- Configure the initial Action node for the sub-workflow, similar to how you would configuring any non-triggering workflow action.
- Continue adding subsequent nodes to the sub-workflow, similar to how you add nodes to a main Workflow. You can add any node except a Repeat For Each node within a sub-workflow.