Selecting and Configuring the Workflow Trigger
  • 24 Nov 2024
  • 8 Minutes to read
  • Dark
    Light
  • PDF

Selecting and Configuring the Workflow Trigger

  • Dark
    Light
  • PDF

Article summary

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.

TriggerType

Selecting and Configuring an Event Trigger

To select and configure an Event trigger

  1. 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.

  2. 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.
    TriggerEventNode

  3. 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.

EventTriggerSelectAsset

  1. 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

  1. In the Trigger Type right pane, select Manual. The top node displays a Manual label.
  2. 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

  1. In the Trigger Type right pane, select Scheduled. The top node displays a Scheduled label.
  2. 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.
      RepeatEveryXHours

      • 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.
      RepeatEveryXDays

      • 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.
      RepeatDaysOfWeek

      • 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.
      RepeatDaysOfMonth

      • 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.
  3. 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.
  4. 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.
ECSchedule-time.png

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:

  1. The query defined in the Workflow runs and returns a list of assets.
  2. The Workflow runs against that list of assets.
  3. 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.

Note:

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.

Note:

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

  1. In the left Workflow pane, hover under the Trigger By - Scheduled or Manual node, and click Add Action AddActionButton to add an Action node.
  2. 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.
  3. 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.
      ActionTriggerSelectQuery
    • 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.
  4. 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.

TriggerActionConfig

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.



Was this article helpful?