How to: retry a failed app reload in Qlik Application Automation
This article explains a retry mechanism for Qlik Sense app reloads in Qlik Application Automation. If a reload fails, the automation described in this article will retry the reload until the reload succeeds or a max retry limit is reached.
Retry reload until it succeeds
Create a new automation and follow these steps to retry a QCS app reload 5 times until the reload is successful:
In the block picker menu, go to the basic blocks and search for the Loop block. Drag this block inside the automation editor and connect it to the start block.
On the Inputs tab in the Loop block's setting menu, click the input field of the "Loop over items of list" parameter. And click "Add Formula" from the dropdown, this will open a popup window with the formula picker, search for the Explode formula and select it.
Configure the Explode formula as follows and click Save:
Text: 1,2,3,4,5. The formula will turn this string into a list of 5 items and since the formula is specified as input for the Loop block, the Loop block will loop over this list.
Delimiter Character: ,
Search for the Qlik Cloud Services connector in the block picker and look for the block "Do Reload". Drag this block inside the automation editor and place it inside the loop.
Configure the Do Reload block as follows:
App Id: Id of the application that should be reloaded. Click the input field to show the Do Lookup function (optional)
Run Mode: Set this to "Wait for reload to complete".
Timeout: The maximum amount of seconds that this block should wait on the reload to finish. Keep in mind that the maximum execution time of an automation is 60 minutes.
Parital: Optional, specify if the reload should be partial (Yes) or not (No). Defaults to 'No' if left empty.
Go back to the block picker and search for the "Condition" block, drag this block in the editor, and connect it right below the Do Reload block. We'll use this block to check if the reload status equals SUCCEEDED.
Go to the inputs tab of the Condition block and specify the Status field from the Do Reload block's output as the first argument of the condition. The condition itself should be "equals" and the second argument should be "SUCCEEDED" without the double-quotes.
Now, when the Condition block is executed, and the reload status equals SUCCEEDED, the Yes part of the Condition block will be executed. In this scenario, the automation should stop since a successful reload was achieved. To do this, use the block Exit Loop and place this at the Yes part of the condition block.