- 24 Nov 2024
- 8 Minutes to read
- Print
- DarkLight
- PDF
Selecting and Configuring the Workflow Trigger
- Updated on 24 Nov 2024
- 8 Minutes to read
- Print
- DarkLight
- PDF
Each Workflow can be triggered by an Event (default), Scheduled Action, or Manual (on-demand) Action.
This section describes how to select and configure each type of Workflow trigger.
- Event (default) - Triggers the Workflow when the Event-based Action in the top node occurs.
- Scheduled Action - Triggers the Workflow when the selected time-based repeat Action in the second node is run according to the defined schedule in the first node.
- Manual Action - Triggers the Workflow immediately when the selected on-demand Action in the second node is manually run by clicking Save and Run in the Workflow configuration.
Selecting and Configuring an Event Trigger
To select and configure an Event trigger
In the Trigger Type right pane, select Event (the default). In the Workflow pane, the top node displays the system-generated UUID (preceded by #) as well as an Event label.
From the list of available Events in the Trigger Type pane, select an Event.
The selected triggering Event is displayed in the top Trigger By Event node of the workflow along with the default type of assets that this Event retrieves.
If the selected event can retrieve other assets, the Select the type of asset to be retrieved dropdown is enabled. From the dropdown, select an available asset type, if required. The selected asset type replaces the default one in the Trigger By node. The following workflow nodes will run on the selected asset type.
- Enable parsing an Event field into additional fields, if required.
Selecting and Configuring a Manual Action Trigger
To select and configure a Manual Action trigger
- In the Trigger Type right pane, select Manual. The top node displays a Manual label.
- In the second node, add the triggering action.
Selecting and Configuring a Scheduled Action Trigger
When you select a Workflow to be triggered by a Scheduled action (Trigger Type = Scheduled), configure when to run the triggering action under Select a Schedule Plan. Once you save the Workflow, it will automatically run according to the configured schedule.
To select and configure a Scheduled Action trigger
- In the Trigger Type right pane, select Scheduled. The top node displays a Scheduled label.
- Under Select a Schedule Plan, select one of the following from the Repeat schedule run dropdown:
Every global discovery cycle (default) - Runs the Workflow on the same schedule as the Global Discovery Cycle, at the end of the cycle. See Discovery Cycle for more information about Discovery Cycles.
Every x hours - Runs the Workflow every number of hours as defined in the Scheduled run every (hours) field.
In Scheduled run every (hours) (default:12), type every how many hours to run the Workflow.
The Workflow run time is determined based on the specified value, starting from midnight. For example, if the specified value is 6, the run times are: 24:00, 6:00, 12:00, 18:00, 24:00, etc.
The start time for the next Workflow run is the closest interval. For example, If the specified value is 6:00, and the scheduling configuration was saved at 10:00, the next Workflow run starts at 12:00.
The maximum possible value is 24.
Select the Wait until cycle ends checkbox to run the Workflow only after a Discovery Cycle in progress has completed. Learn more about the Wait until cycle ends option.
Every x days - Runs the Workflow every number of days as defined in the Scheduled run every (days) field.
- The Every x days scheduling option starts counting x days from January 1st, meaning that from January 1st, the Workflow runs every X days.
- The start time for the next Workflow run is the closest interval.
- In Scheduled run every (days) (default:1), type every how many days to run the Workflow.
- In Scheduled run time (default:13:00), select the time on the selected days to run the Workflow. Learn more about how to schedule the run time.
- Select the Wait until cycle ends checkbox to run the Workflow only after a Discovery Cycle in progress has completed. Learn more about the Wait until cycle ends option.
Days of week - Runs the Workflow on specific days of the week at a selected time of day.
- In Scheduled run day(s), a tile for each weekday is added by default. Click the x on a tile to remove that day. You can also click in the field and select or clear days from the list. The Workflow will run only on the days whose tile appears.
- In Scheduled run time, select the time on the selected days to run the Workflow. Learn more about how to schedule the run time.
- Select the Wait until cycle ends checkbox to run the Workflow only after a Discovery Cycle in progress has completed. Learn more about the Wait until cycle ends option.
Days of month - Runs the Workflow on specific days of the month at a selected time of day.
- In Scheduled run day(s) (default: 1), click in the field, and from the dropdown that opens, select a day of the month on which to run the Workflow. A tile with the selected day is added. Repeat for additional days of the month. Click the x on a tile to remove that day. The Workflow runs only on the selected days of the month.
- In Scheduled run time, select the time on the selected days to run the Workflow. Learn more about how to schedule the run time.
- Select the Wait until cycle ends checkbox to run the Workflow only after a Discovery Cycle in progress has completed. Learn more about the Wait until cycle ends option.
- Select the Run on added entities only checkbox (the default) to run the Workflow only on assets discovered since the last run. Learn more about how the Workflow runs on added entities only.
- In the second node, add the triggering action.
Scheduling the Run Time
You can schedule the Workflow run for a specific time by in the day by enabling the Scheduled run time option. Click in the field and select a time from the list. The Workflow runs on the days selected at the time selected here. If you have multiple Workflows, schedule them to run at different times to reduce network traffic.
Scheduling the Run for the End of the Cycle
You can set the Workflow to run only after a Discovery Cycle in progress has completed by enabling the Wait until cycle ends option. This means that all Workflows with this option enabled and that are scheduled to start while the Discovery Cycle is in progress, are postponed to run at the end of the Discovery Cycle. Before you enable this option, decide whether running the Workflow on up-to-date data significantly justifies delaying its execution.
Note:
The Wait until cycle ends option is not relevant when:
- No Discovery Cycle is running at the scheduled trigger time of the Workflow.
- The Workflow is configured to run at the end of Every global discovery cycle.
Running the Workflow Only on Added Entities
Every time a Workflow is triggered to run, the following happens:
- The query defined in the Workflow runs and returns a list of assets.
- The Workflow runs against that list of assets.
- The list of assets is saved.
When the Run on added entities only option is enabled, the list of assets returned in the query (from the second run onward) is compared to the previous run's asset list. Only assets that appear in the new list but were not in the previous list are included in this run.
The first Workflow run is always on all assets matching the query.
Example
A Workflow is configured to run on query "devices with AD admin permissions" at the end of every Discovery Cycle and the Run on added entities only option is enabled.
- At the end of the first Discovery Cycle (first run), the query returns assets A, B, and C. So the Workflow runs on assets A, B, and C.
- At the end of the second Discovery Cycle (second run), the query returns assets B, C, and D. So the Workflow runs only on asset D.
Adding the Triggering Action
For Scheduled and Manual triggers, you add the triggering Action to the second node of the Workflow. For a Scheduled trigger type, the added Action runs automatically according to the configured schedule.
For a Manual trigger, the added Action runs when you click Save and Run in the Workflow configuration.
The ID and Refine Data filter of the triggering Action are transmitted to all nodes in the Workflow. This means that successive actions are run only on asset entities not filtered out (using refine data) of the saved query.
To add the triggering Action to the Workflow
- In the left Workflow pane, hover under the Trigger By - Scheduled or Manual node, and click Add Action to add an Action node.
- In the Select Action pane that opens, select the triggering Action. The selected triggering Action is displayed in the second node (Action) of the workflow.
- Select the assets that the Workflow should run on: Under Run workflow on assets matching the following query, from the Module list, select the asset type you want to query. Then, from the Select Query list, do one of the following:
- Select a saved query from the list.
- Click + Add Query to create a new query using the Query Wizard. To learn more about creating a new query, see Creating a New Query.
- Select a saved query from the list.
- Click Apply. The query that the Action runs on is displayed in the Triggering Action node. You can click the Pencil icon to select another query.
Changing the Trigger Type
You can switch between trigger types Event, Scheduled, and Manual so long as you haven't yet configured the trigger node.
Once you have selected an Event for an Event trigger node, if you change the trigger type, all data configured for this node is deleted.
- When a triggering Event node is followed by another Event node, the Trigger Type buttons - Scheduled and Manual become disabled, as switching the trigger can break the workflow logic.
For more information about working with Workflows, refer to the following:
Viewing and Configuring Workflows Events Settings
Selecting and Configuring the Workflow Trigger
Selecting and Configuring a Workflow Event
Configuring an Event Condition
Selecting and Configuring a Workflow Action
Configuring an Action Condition
Deleting and Deactivating/Activating Workflows