UiPath - Stop Job activity

Hi All,

Hope all is well within the community!

Im working on a process where I need to send a stop command to the Job in Orchestrator after X transactions have been processed. Correct me if I’m wrong, but I believe the best approach for achieving this to be the “Stop Job” activity. However, I am having difficulty getting this to work.

I have used a “Get Jobs” activity with a custom filter. When I run the process, the Get Jobs activity is properly returning values (checking the IEnumberable during process run). However, when I attempt to pass the IEnumerable value to the “Stop Job” activity I’m continuously seeing a “Stop Job: Operation returned an invalid status code ‘BadRequest’” response.

I’ve ensured that the Robot has accurate permissions within its Role in orchestrator: View, Edit, Create for Jobs.

Is there a specific value of the IEnumerable that needs to be passed rather than the whole thing?

is it ensured that the particular job is passed to stop job activity?
How did you implement /filtered the retrieval of the particular job from the get jobs output?

When you say particular job, im not sure what that means. I’ve checked the results being returned in the IEnumerable. The job I want is the first index in the IE. I pass the IE(0) to the “Stop Job” activity.

Its not entirely clear what really needs to be passed. Does the whole IE value get passed or is it a specific value within the list of IE index?

as indicated in the hover a job item of datatype OrchestratorJob is expected

As the IEnumerable output from Get Jobs can have more items, so it is suggested to evaluate which particular job is to use for the stopping.

So for a debug / analysis round the Use of an index/First()/Elementat(pos) YourReturnedJobsIE is quite OK. Later it should be more dynamic /exact

for more details you can refer to the doc as well:

1 Like

I’m just going to go a different route. Nesting a counter into the General Business Process Get Trasnaction Data workflow. If the counter is meet then it will follow the “Should Stop” path.

Thanks for the help

doing it on this level is a valid approach and also recommendable. Perfect. Happy Automations

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.