Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Raju_6952
Creator III
Creator III

Automation In Qlik Cloud Analytics

Hi,

I am using one of of the automation as a task chain where I have configured with 30 app reloads in a single automation but the problem is its getting timed out at 4 hrs. so planning to split the automation into two parts like 15 and 15.My idea here is that my second automation would triggered based on the first automation run is successful.

Any suggestions would be highly appreciated.

Regards,

Raju

Labels (3)
1 Solution

Accepted Solutions
marksouzacosta

Hi @Raju_6952,

This is the reviewed and tested code:

SUB ReloadApp(AppID)

    TRACE Starting reload for AppID: $(AppID);

    // Create JSON body with AppID
    LET vJSONBody = '{""appId"":""$(AppID)"",""partial"":false}';
    
    LIB CONNECT TO 'ReloadsAPI';
   
    // Make API call to trigger app reload
    REST_Reload:
    SQL SELECT 
        "id"
    FROM 
        JSON (wrap on) "root"
        WITH CONNECTION (
            BODY "$(vJSONBody)"
        )
    ;
    
    // Capture the reload ID from API response
    LET vReloadID = Peek('id', 0, 'REST_Reload');

    // Log success or failure
    IF Len(Trim('$(vReloadID)')) > 0 THEN
    	TRACE Reload triggered successfully for AppID: $(AppID), Reload ID: $(vReloadID);
    ELSE
    	TRACE Reload failed for AppID: $(AppID);
    ENDIF
    
END SUB

Call ReloadApp('45bdff00-c8cf-41ca-8738-6ec27928c31e'); // The AppID of the next Application

 

This is my ReloadsAPI Connection - just for your review.
The green arrows indicates where I made changes.

marksouzacosta_0-1742304224572.png

 

Regards,

Mark Costa

 

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

View solution in original post

24 Replies
Dave_Channon
Employee
Employee

Hi @Raju_6952 

There are several ways of achieving this, one is to use a runner such as documented here: https://qlik.dev/manage/reloads/task-chaining-automations/

 

marksouzacosta

Hi @Raju_6952 ,

You may find some help on this topic.
Re: Trigger second automation when the first autom... - Qlik Community - 2507964

One other thing, if possible, you can run your App Reloads in parallel instead of sequentially. This will reduce the automation time.

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Raju_6952
Creator III
Creator III
Author

Hi @marksouzacosta ,

Thanks for sharing the details but the problem is when we use webhook option to trigger the second part of automation ist getting timedout at 15minutes so we are not able to proceed further.

even we cant use single aumotaion runs as our app reloads take more than 4 hrs but the timeout for each automation is 4 hours

 

Please let me know if any alternative ways are there.

 

Regards,

Raju

marksouzacosta

Hi @Raju_6952,

Can you please share a screen shot of both of your Automations?
In the second automation, what is the block that is timing out in 15min?

Regarding the 1st Automation, you don't need to hold your automation to wait for the application to reload. You can call the Do Reload block but setting it to not stop the flow of the Automation. If you have some dependency on the Application Reload, you can create another Automation that triggers when the App Data is updated (webhook). However, 4h is a long run even for the application. Maybe I can also help to improve the performance of this application.

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Raju_6952
Creator III
Creator III
Author

Hi @marksouzacosta ,

here we are reloading 35 apps in sequence as a task chain as its getting timedout we are spltting that automation to two parts .

in the second automation as we are depending on the webhook the timeout is 15 mins so basically the second automation will work until 15 mins and it fails.

 

Regards,

Raju

marksouzacosta

Maybe there are better options for you but I need to understand better the problem.

Why are you running the apps in sequence? They do depend on each other?
The 15min timeout is odd. Which block is timing out?

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Raju_6952
Creator III
Creator III
Author

Hi @marksouzacosta ,

We are  running the apps in sequence as  They do depend on each other. as we have automation time limit is set to 4 hrs we have spillited them into two which contains 18 and 17 but the problem is when we trigger second automation once the first automation completed then the second automation is getting timeout at 15 minutes as we dependent on the webhooks.

Platform limitations for automation execution time

Raju_6952_0-1742113168368.png

 

 

Thanks for the hint.

Regards,

Raju

 

 

marksouzacosta

Interesting...

One solution that I have used with success in some customers was to add a Procedure at the end of the Load Script of each application that will reload the next application.

This is how it works:

Step 1: Create a REST Connection - check Allow With Connection - to the Qlik Cloud Post Reload API - https://qlik.dev/apis/rest/reloads/#post-v1-reloads

Step 2: Create an external QVS file. Inside this QVS file you have a Procedure/Sub - let's call it ReloadApp - that has as parameter AppID. This code only executes the REST Connection created on Step 1.

Step 3: In your Qlik App Load Scripts, you have to include the QVS file created on Step 2.
https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemVariable...

Step 4: The last line of your Load Script will be:
Call ReloadApp('yournextappid');


You can start simple like I have suggested, but you can make this as advanced as you like. You can track the progress of the tasks writing QVDs/Parquets as logs, write try/catch methods on the ReloadApp procedure - I have a very fancy code that mimics Polly (https://www.pollydocs.org/), you can even do AWS Lambda functions, create a multi-dependency, etc.

 

Regards,

Mark Costa

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Raju_6952
Creator III
Creator III
Author

Hi @marksouzacosta ,

Thanks for providing this option, while creating a rest connection using post command its not working without specifying the appid.

 

 

Regards,

Raju