Stop Job Activity does not interrupt trailing activities directly

Hi,

So I just noticed that the UiPath.Core.Activities.StopJob does not stop “right away” there is 1-2 seconds(could maybe be more?) where there is time for other “flows” to execute.

I’m not sure if this is a bug or if this is the expected behaviour.

I have solved this by putting a delay after the Stop job activity so no other flows starts to execute.

Properties of Stop Job:


Dependencies:

Studio version: 2023.4.1

Hi @atomic

Can you send the properties panel screenshot of the Stop Job activity

Regards

Hi @vrdabberu

I attached the screenshot above/OP.

I believe this is indeed a rather old, but expected behaviour. The workaround is the correct one.

Having said so, I will check with the team to see if this can be improved. I assume what is happening is that the activity makes an API call to Orchestrator, but then gets marked as Completed and the workflow moves forward. As such, when you have other activities after the Stop Job, those would be executed in the small timeframe before the Orchestrator sends its own signal to the robot to actually Stop the job.

I’m not sure what the use case is here, but if you want to kill the current job,then you could also consider using the https://docs.uipath.com/activities/other/latest/workflow/kill-process activity.

If it’s another job that you want to stop, there is also Activities - Should Stop, which you can use to check if you want to continue processing before you pick up a new item or something

Hi, @loginerror @ijanszen1

I created this topic 1 year ago, if i remember correctly i think this could be irrelevant or maybe you have encountered this issue in some form?

I think i had the flows setup up badly and that was the reason that caused this issue.