Working with webhooks
An automation can be triggered by using the webhook URL of the automation or by native webhooks. To trigger an automation using its webhook URL, set the start block run mode to Triggered. To trigger an automation using a webhook connector, set the start block run mode to Webhook.
Triggered webhooks
Triggered webhooks make API calls to the Qlik Cloud service from another platform through its webhook URL.
Refer to platform limitations to see the API call limits.
For a visual demo about how to set up triggered webhooks, see:
Triggered WebhooksGetting the automation URL
Automations are exposed through a REST API endpoint, which means they can be called with a webhook URL to trigger the automation. To get the webhook URL, set the start block run mode to Triggered. The block configuration pane displays a GET
and POST
curl command with the webhook URL.
The automation webhook URL contains a token that should be kept secret. Do not share it publicly and do not store it on public version control repositories.
Renewing the execution token will immediately break any reference to the automation via API or button object. Token renewal cannot be undone.
Viewing the webhook payload
When you call the automation with a webhook URL, the start block receives input from the webhook. To view the payload, use an output block and set the start block as the input.
You can change the input field to retrieve a specific part of the JSON payload, for example {$.Start.name}
. Alternatively, you can use input blocks to specify part of the JSON payload.
Defining input parameters
You can add an input block below the start block to receive the payload from the webhook URL. Below the input block, you can add other blocks that retrieves part of the data.
For example, you could use the input block to receive the full payload, which is a JSON array, and select only the required field from the input block output.
Native webhooks
Native webhooks use an API call to create an event in the platform you select under Connector. Native webhooks include preconfigured connectors, like the Qlik Cloud connector.
For a visual demo about how to set up native webhooks, see:
Working with native webhooksSet the start block run mode to Webhook to use native webhooks.
You must authenticate the data connector of the selected webhook. Once it is authenticated, select which event triggers the automation. In the image below, the automation runs whenever a Qlik Cloud app is created.
Tenant admins have access to all events, while other security roles only have access to a subset of the events.
Native WebhooksFiltering
By using filters, you can limit the webhook to trigger only on specific apps or apps in specific spaces. The filter can include multiple apps and spaces. Use the do lookup function to easily add the ID of an app or a space.
The events App Created and App Published can only be filtered by space ID because the app ID is not known before these events have occurred.
Modifying the test payload
You can modify the test payload to include objects that you want to retrieve during a test run. The actual payload can be different from the test payload.
For example, here is a simple automation that outputs the name of the app when that app is reloaded. The start block is set to Webhook and the event that triggers the automation is an app reload.
The test payload field is edited to only include the data
object.
{
"data": {
"id": "94a789ad-d967-4049-8aaf-9abac267c222",
"name": "MyApp"
}
}
When you run this automation and look at the start block output, it shows only the test payload. When the automation is triggered through the Qlik Cloud webhook, the start block output shows the actual payload.
{
...
},
"data": {
"duration": 1345,
"endTime": "2021-09-14T18:30:06.288Z",
"errors": [],
"id": "ff241d45-6605-432d-9ec5-8cf4e9a64807",
"name": "JIRA app",
"peakMemoryBytes": 4985984,
"reloadId": "6140ea2554b901cc5a122461",
"size": {
"memory": 16845
},
"status": "ok",
"warnings": []
}
}
Managing webhooks as an administrator
Automations with a webhook in the start block are listed under Webhooks in the Administrowanie activity center. Only tenant administrators can access this section.
To learn how to manage webhooks from the Administrowanie activity center, see Webhooks.