Skip to main content
Skip table of contents

Creating a Webhook Action

After you have created a query to find the data you want to send in a webhook, you can:

  • save that query as the input to a webhook

  • define how frequently you want to send the webhook

  • define which fields from the query results you want to include in the webhook payload

Saving a Query for Use with a Repeatable Webhook Action

To create a webhook action:

  1. Define the query. For details, see the chapter on Creating Queries.

  2. In the Query Builder page, click Show Result.

  3. In the Query Result page, click the kabab icon (…) in the lower right. Choose Create a recurring action with this query.

  4. In the Select Action Type page, select Webhook.

  5. The Create a new action page appears.

  6. In the Create a new action page, enter the following:

    • Action Type. This field will be pre-populated with Send Webhook.

    • Configuration Name. Select the configuration you defined in the chapter on Creating a Webhook Configuration.

    • Action Name. Provide a name for the webhook action.

    • Description. Provide a description for the webhook action.

    • Filters. This field is populated with the query you created in step 1. If you need to edit the filter, the Edit Filter button leads to the Query Builder, where you can re-define the query.

    • Schedule Settings. The options in this field specify how frequently to send the webhook

      • Recurrence. If you select this option, the Webhook is sent on a schedule. You can specify the interval (Repeat), the time (Start Time), and the frequency (Every).

      • After data ingestion. If you select this option, the Webhook will be sent at least once a day, because Lucidum performs data ingestion automatically every 24 hours. You can also manually trigger data ingestion from the Data Ingestion Trigger page (Monitoring > Data Ingestion Trigger). Each time you or another user manually trigger data ingestion from the Data Ingestion Trigger page, Lucidum will send the webhook again.

    • Do not trigger the action unless. If you selected Recurrence in the Schedule Settings field, this field appears. In this field, you can specify criteria for not sending a scheduled webhook. You can specify that if the number of results for the query do not meet the criteria in this field, do not send the scheduled webhook.

    • Output Fields. Lucidum includes a default set of fields for each query. However, you can delete fields from the default list and add fields to the list. To do this:

      • To delete a field from the payload, click on the x. in the field.

      • To add a field to the payload, click on an empty space and select from the list.

    • Payload template. This field formats the webhook payload before sending it. By default, the payload template includes logic that specifies:

      • For the value from each field in Output Fields, push the value through a program that converts the value to JSON, then add a new line character.

      • However, you can use any JINJA statements, expressions, and filters to modify this template to suit your needs. For details on JINJA, see https://jinja.palletsprojects.com/en/3.1.x/templates/.

    • Dedup previous jobs. In this field, you specify whether you want duplicates of asset IDs (if your query is for assets) or user IDs (if your query is for users). You can specify integers between 0 and the number specified in Settings > System Settings > General > Data Settings > Action Result Retention in Days. This setting specifies the number of days that Lucidum stores action results.

      • If you specify “0” (zero), Lucidum includes all the records from the query in each delivery of the webhook.

      • If you specify “1” (one), Lucidum examines the previous webhook payload and excludes records for asset IDs or user IDs that were sent in the previous webhook payload.

      • If you specify “2” (two), Lucidum examines the last two webhook payloads and excludes records for asset IDs or user IDs that were sent in the previous two webhook payloads.

  7. Click Save Changes.

Saving a Query for Use with a One-Time Webhook Action

To create a webhook action that uses selected records and runs only once:

Lucidum will immediately trigger the webhook action upon saving the webhook action.

  1. Define the query. For details, see the chapter on Creating Queries.

  2. In the Query Builder page, click Show Result.

  3. Select one or more records to include in the webhook action.

  4. In the Query Result page, click the kabab icon (…) in the lower right. Choose Create a one-time action with selected data.

  5. In the Select Action Type page, select Webhook.

  6. The Create a new action page appears.

  7. In the Create a new action page, enter the following:

    • Action Type. This field will be pre-populated with Send Webhook.

    • Configuration Name. Select the configuration you defined in the chapter on Creating a Webhook Configuration.

    • Action Name. Provide a name for the webhook action.

    • Description. Provide a description for the webhook action.

    • Selected Data. This field is pre-populated with the records you selected in query you created in step 3.

    • Output Fields. Lucidum includes a default set of fields for each query. However, you can delete fields from the default list and add fields to the list. To do this:

      • To delete a field from the payload, click on the x. in the field.

      • To add a field to the payload, click on an empty space and select from the list.

    • Payload template. This field formats the webhook payload before sending it. By default, the payload template includes logic that specifies:

      • For the value from each field in Output fields, push the value through a program that converts the value to JSON, then add a new line character.

      • However, you can use any JINJA statements, expressions, and filters to modify this template to suit your needs. For details on JINJA, see https://jinja.palletsprojects.com/en/3.1.x/templates/ .

    • Dedup previous jobs. In this field, you specify whether you want duplicates of asset IDs (if your query is for assets) or user IDs (if your query is for users). You can specify integers between 0 and the number specified in Settings > System Settings > General > Data Settings > Action Result Retention in Days. This setting specifies the number of days that Lucidum stores action results.

      • If you specify “0” (zero), Lucidum includes all the records from the query in each delivery of the webhook.

      • If you specify “1” (one), Lucidum examines the previous webhook payload and excludes records for asset IDs or user IDs that were sent in the previous webhook payload.

      • If you specify “2” (two), Lucidum examines the last two webhook payloads and excludes records for asset IDs or user IDs that were sent in the previous two webhook payloads.

  8. Click Save Changes.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.