Skip to main content

Triggers

An Automation runs when it is prompted by one of the following triggers:

Event-based: An Automation that is triggered by an event that occurs on an external service provider.

Scheduled: An Automation that is triggered at a pre-set time and can be repeated at any frequency.

On-Demand: An Automation that is triggered when a user requests it from the Self-service portal.

Creating an Automation based on an Event from an External Service Provider

An Automation runs when it is triggered by a specified event on an external service provider.

  1. Select the Event-based Automation trigger type.

  2. Select an external service provider, select a supported event > Continue. The Trigger setup popup will appear.

  3. In Connections, select an existing connection or Create new connection.

  4. To trigger the Automation only under certain conditions, enable Add condition . See How to use the Condition Builder for more details.

  5. Click Apply. When this event occurs and the conditions are met, the Automation is triggered.

Creating an Event-Based Automation using a Custom Webhook

The Automation runs when it is triggered by an event sent to predetermined URL by the webhook.

  1. Select the Event-based Automation trigger type.

  2. Select Custom webhook > Continue. The Webhook setup is displayed.

  3. Give the Webhook event a name. The Webhook URL displayed is the URL you need to notify when your custom event occurs.

  4. Copy the Webhook URL and API KEY and store it in a safe location, you will require it later on in the process, for the external service provider.

  5. Choose an authentication method: The API Key or Signature authentication method.

info

The API Key authentication method, allows the external provider to execute the webhook using only an api key which gets generated for the automation when using the the API Key method.

USAGE

curl -XPOST https://<sub-doamin>.app.blinkops.com/webhooks/<path>?apikey=<apikey>

or

curl -XPOST https://<sub-doamin>.app.blinkops.com/webhooks/<path> -H BLINK-API-KEY: <apikey>

The Signature authentication method involves generating a cryptographic signature for each request. This signature format is based on the following <timestamp>.<url>.<request body>, which is then signed with the API Key and included in the request to authenticate its authenticity.

USAGE

TS=$(date +%s)

BODY='{"foo": "bar"}'

URL=https://<sub-domain>.app.blinkops.com/webhooks/<path>

SIG=$(echo -n "$TS.$URL.$BODY" | openssl dgst -sha256 -hmac <apikey>)

curl -XPOST $URL -H "X-BLINK-SIGNATURE: ts=$TS;sig1=$SIG" -d $BODY

Please Note- some external service providers may not support the Signature authentication method.

Both authentication methods are crucial for providing an additional layer of security by confirming the identity of users or applications accessing the data. This ensures controlled access to sensitive information, reinforces authorization policies, and upholds trust between the client and server.

  1. The event received from the remote service provider is an unfamiliar JSON object to the system. Use one of the methods below to show the system what to expect:
  • Click Configure event schema > Get started. In Sample event click Listen. Send a sample event to the Webhook URL defined in the settings > Apply.

    OR

  • Click Configure event schema > Set manually. In Sample event , paste a sample event so the system knows what to expect > Apply.

  1. To trigger the Automation only under certain conditions, enable Add condition . See How to use the Condition Builder for more details.

  2. Click Apply.

Creating a Scheduled Automation

The Automation is scheduled to run at a certain time on a regular basis (hourly,daily, weekly, or monthly), or set custom intervals using Cron Expressions, enabling maximum flexibility for the user.

  1. Select the trigger type of your Automation to be Scheduled. The Editor page of the Automation opens.

  2. Under Trigger, click Click to schedule a run. The Trigger setup popup will appear.

  3. Click Every time period define when and the frequency at which the Automation will run. Either select a standard value (Hourly, Daily, Weekly, or Monthly), or select Custom to create custom scheduling. Use the Cron Expression Picker with Cron syntax as follows:

SymbolDescription
*any value
,value list separator
-range of values
/step values
info

The default value is every 5 minutes. Once configured, a preview of your custom schedule is displayed (a human readable string describing the Cron expression).

If an invalid expression is entered, it will be displayed in red font.

  1. Click Apply. The selected interval is displayed in the Trigger setup.

  2. Click Apply. The scheduled trigger is displayed under Trigger in the Edit screen of your Automation. The Cron expression can also be seen in the Automation YAML.

Creating an On-Demand Automation

The Automation runs when its selected in the Self-service portal and the relevant parameters are entered. Not all Automations require input parameters.

  1. When creating a new Automation, select the On-Demand trigger type.

  2. In the Automation Editor , under Trigger:On-Demand, click the + icon.

  3. Enter the requested input parameters.

  4. Optional- Click Configure how this parameter appears in the input form. Proceed by entering a display name, placeholder and a default value.

  5. Click the Add button.

Changing the Automation Trigger Type

In the Automation editor, you can change the Automation Trigger type.

  1. Hover over the Automation Trigger and click on the 3 dot menu > Change trigger type. The Automation Trigger type window is displayed.

  2. Select which automation trigger you want, and click Apply. The trigger in the canvas has changed to your selected trigger type.

info

When you change the Automation Trigger type, the previous Triggers are erased. If you decide to switch back, whatever setting you had for previous Triggers, will not be saved. However, you can revert changes using the Undo button in the editor.