Custom timeout

Hello!
Does anyone has an idea on how to create custom timeout workflow? I have an activity (ExecuteQuery) which sometimes is stuck forever, even if timeout is provided.
Maybe it’s possible to build some kind of “Parallel” composition, to escape this blocker after X seconds if it’s not completed?
I don’t know how to resolve this issue.
Greetings

I will suggest creating a workflow and adding your code/activities to this. Invoke it to your flow, and you can set a timeout property for those activities in the properties panel of the Invoke Workflow activity.
Place the workflow in try-catch to handle the timeout exception.

Like I have mentioned: the activity has timeout provided to 30 seconds, and this timeout is simply not working

Can you share a screenshot of timeout property?

Hi

You can use timeout property that is available in invoke workflow:
Put your executequeery in a workflow .

The “Timeout” property is not working at all.
The image shows the properties panel for the UiPath Database ExecuteQuery activity, with configurations including a connection string, existing connection, SQL query, and an output data table. (Captioned by AI)
Robot is working well for some time and then suddenly in random item iteration it’s stuck on this execute query (which was working very well X times till this random iteration).
That’s why I was asking for any other solution to create custom timeout in UiPath.

I’ll try to put ExecuteQuery in invoke

1 Like

which version of database activities are you using?

This field accept values in seconds. Please make it 30. You are adding in ms.

1.7.1, the newest possible

Nope, it’s in miliseconds
This image shows the properties panel for the UiPath.Database.Activities.ExecuteQuery activity in UiPath Studio, detailing various settings such as Common, Connection Configuration, Input, Misc, and Output with specific attributes like timeout, parameters, and data table. (Captioned by AI)

Have you tried Timeout Scope? Activities - Timeout Scope

4 Likes

Will definitely try this one, if timeout set on Invoke will not help
Note: timeout scope is only in System package ver. minimum 23.10.1

@olgu

if timeout is not available then use parallel activity with a delay of 30 seconds or any timeout you need and then set a boolean variable to true and use that boolean in parallel activity condition

you can set same boolean as true on other side as well so that if it completes early even then the parallel would end

cheers

cheers

But Parallel in UiPath Studio does not work parallelly. When you run it or debug, it has set order of completing parallel branches, so if it gets stuck on my activity with database, I can’t do nothing in other branch until it’s completed.

If you don’t mind, please post your SQL query.

I ran into this issue with a oracle database when the row I was updating had a lock on it. My assumption was that it would either wait for lock within the timeout or return a deadlock error, neither happened and the debug continued running for many minutes before I stopped it. I have not found a solution :frowning:

@olgu

No Parallel activity would work ideally in parallel , but they will work in separate thread…and left side generally takes priority so have the activities which can fail on right and have the delay and all on left…you can test it out this should work as expected

cheers

Hi Olga,

As you seem to have experienced, parallel isnt truly parallel and one thread can still totally lock up Studio. Highlight for example doesnt play well in parallel.

To debug if its possible to actually run in parallel on this I would suggest the following.

Add a parallel and in one side just have an infinite loop that displays a log message, the other side being your database query.

If the logging continues throughout then all good. You can add a delay or wait and cancel the parallel thread if it runs too long. If the logging locks up as the query runs then this starts to become more challenging (but not impossible perhaps).
At that stages I’d suggest trying the same, but putting the database into its own workflow and then running that workflow ‘isolated’. This should make it run in a different process and could perhaps then make the multi threading work as you need it to.

1 Like

Here is described how to run true parallel processes:

Cheers