Skip to main content

Automation session delays

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Emile_Koslowski
Employee
Employee

Automation session delays

Last Update:

Apr 25, 2023 11:55:56 PM

Updated By:

AfeefaTk

Created date:

Feb 2, 2022 5:42:34 AM

You might have noticed that the actions of some blocks don't get synced to the Qlik Sense UI after executing an automation. This article explains this behavior. Please read our getting started article first if you're new to automations.

Content:

  • Current behavior
  • Change distribution
  • QIX API blocks

Current behavior

Most blocks in the Qlik Cloud Services connector use REST APIs. But not all features in Qlik Sense have associated REST APIs available. For these actions, the QIX API is used. A detailed explanation of this API can be found here.

You should know that the QIX API is not stateless. All actions happen in the context of a session. This is useful when you want to use blocks that depend on the currently active selections in that session. An example is the Get Straight Table Data block, which you might want to use to get a subset of a table. To do this, you'd first apply the selections with the Select Field Value block before you execute the Get Straight Table Data block.

The QIX API is a powerful tool that can do a lot more than making selections. At the end of this article, you'll find an overview of all the blocks in the Qlik Cloud Services connector that use the QIX API. Other than the Select Field Value block, you'll find blocks like Create Measure, Update Dimension, and Publish Sheet. When using these non-selection-related blocks, it's important to understand that, since they use the QIX API, their actions are scoped to the current session. This means that changes made by these blocks must be distributed to other sessions to make them available there. We call this process change distribution and it's explained in more detail in the next section.

The Qlik Sense UI uses the QIX API as well. You might have noticed that certain actions made in the UI are not immediately available for other users who are signed in at the same time. For example, when you publish a sheet or delete a measure, it takes some time before this change is visible/available to other users in your tenant.

As said at the beginning of this article, automations do also use sessions depending on the blocks inside the automation. If an automation uses one of these blocks, the following rule applies:

Automations create a unique session per automation, per run, per app.

For example, an automation that uses an engine block and loops over ten apps will create ten unique sessions on every execution.

Change distribution

Whenever a resource is created, updated, or deleted through the QIX API, that change must be made available in other sessions. This happens through the process of change distribution. It's an automatic process that distributes the changes to other sessions, which can take up to 40 minutes. 

Do Reload & Save App

Next to the automatic change distribution, there are two situations when session changes are distributed.

Whenever an app is reloaded or when the DoSave method is executed for an app, all open engine sessions of that app are loaded again in the engine. Reloading apps in the engine also distributes the session changes. In automations, this is done by executing the Do Reload block or the Save App block.

Note that loading all sessions for a certain app is computationally heavy, especially for big apps. During this process, the apps might not be available for other actions. Doing this merely to distribute a few changes, is a waste of resources. Note that changes are also distributed automatically after at least 20-40 minutes.

More information on the Save App block can be found here: How to use the Save App block.

Instant change distribution is not always necessary

Ask yourself if you really need these changes immediately in the UI or in other sessions. If you only want to distribute changes to the UI to get visual confirmation, you might be better off just executing a Get or List block in the automation.

Add Get and List blocks together with Condition and Output blocks to automate this validation process. You can even add a Mail, Slack, or MS Teams block to be alerted if something goes wrong.

QIX API blocks

The following blocks interact with the QIX API. Their actions are not accessible immediately in other sessions and the UI. But keep in mind that this does not mean that their actions weren't executed.

  • Get/Create/Update/Delete Measure
  • Get/Create/Update/Delete Dimension
  • Get/Create/Update/Delete Variable
  • Get/Create/Delete Bookmark
  • Publish Sheet
  • Get Object Properties
  • Get Load Script

The following is a list of all the other blocks from the Qlik Cloud Services connector that also use the QIX API. The difference is that the actions of these blocks are not distributed to other sessions by design.

  • Get Straight Table Data
  • Apply Bookmark
  • Clear (All) Selections
  • Get Expression Value
  • Lock Selections
  • Unlock Selections
  • Select Field Value
Labels (1)
Version history
Last update:
‎2023-04-25 11:55 PM
Updated by: