Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
SandipAgarwalla
Active Contributor

You can check out my previous blog on how to handle Cookie Issue while working with iRPA, Blog Link 

I hope I can write more often regarding the new age BTP technologies. Today's blog will cover how you can handle timeout issues while calling APIs from iRPA, or ifyour entire Automation Jobs getting timed out because some of the API calls takes longer than usual. 

There are 3 places where you need to maintain the "Timeout" settings. These settings are very important, you need to keep them in mind while you develop. 

1) Overall Automation Job Timeout -

Once you develop the entire Automation, you need to get an idea how long the entire Automation is taking to execute end to end. 

e.g. I had an Automation which had quite a few functionality and was taking more than 10 mins to complete. However my Automation Job was getting timed out before completing. In this case, you need to set the max timeout duration for the entire Automation. 

Click on the Automation outer canvas, go to Tools & Info Section. There you will find "Maximum Duration for Automation" 

SandipAgarwalla_1-1709820301688.png

Check the "Automation" duration. By default this is 600 seconds or 10 mins. So if your job is taking more than this, you need to set this duration properly. So, in my case - I set it to 20 mins. 

2) Each Automation Activity Timeout - 

Each of the step you add in Automation are called Activity, like, call web service, log message, open excel cloud link etc. By default, the timeout for each activity is set to 30 seconds. So if you have any Activity which may take more than 30 seconds, you need to chage it. e.g. if any API call is taking more than 2-3 minutes, you need to set the Activity timeout duration accordingly. In my case, the POST API call took 6-7 mins. So I set it to 10 mins to be on the safer side. Refer the above image to know where to set it. 

3) iRPA Call Web Service Timeout - 

Last but not the least. Even if you set the Activity Timeout to let's say 2 mins, your API call (Call Web Service Activity) will get timed out because the default timeout defined for call api is set to 30 seconds. This comes from the API Param settings. 

This is as per SAP's help documentation, 

timeout.png

So, you need to maintain the timeout accordingly in the API param settings. This is how you do it, 

 

let apiParams = {
    method: 'GET',    
    url:<apiURL>,    
    timeout : 300000, // this is in milliseconds    
    usePassport: false,
    useWinCa:true,
    resetCookie: true,
    resolveBodyOnly: true,
    headers: {        
        "Content-Type": "application/json",
        'Accept': "application/json"
    }
};

 

Depending on how long your API call takes, set the timeout parameter accordingly. 

That's it, you have now maintained the different Timout parameters. If you have multiple Automation artifacts in your entire project, you need to do it for each one separately. 

I hope this was useful to you. I plan to write some more on these topics, next one I will write about how to call an API which is oAuth Token based. 

At the same time, if there is a better way to handle the timeout in iRPA - then feel free to let us know. I am always eager to learn. 

Take care, 

Regards

Sandip

 

Labels in this area