How to avoid previously loaded queue items when we run a process

Hi All

In our process we have a queue. There are multiple schedules of that process. Sometimes after loading a queue due to exception the process gets stopped in one schedule.
But when the process runs in the next schedule the previously loaded items start processing first. How to avoid this ? It should run only the current schedule items.

1 Like

Hey @kkpatel ,

As far as I understood, You have two bots run on schedule.

One to upload queue items and the other to process it.

Possible solution to your scenario,

When the queue items are uploaded, you need to add a unique tag for every schedule in reference or any other param to make sure the next bot process only the items with specific tag.

Hope this helps.

#nK

No, we have one bot. Simple: If queue already contains some items before a process starts then it will run the old items first.

How to avoid this ?

1 Like

Hey @kkpatel ,

So you want your process to upload its own item and run instead of processing old queue items.

is it so ?

Thanks
Nithin

Yes.

1 Like

So @kkpatel, what about the old items. Will it be left as it is ?

It should be removed from the queue.

1 Like

Hey @kkpatel,

This flow should help.

Let me know if any more queries.

#nK

Thanks.
Actually I am also using Delete Queue Items after Get Queue Items, if any old items exist. But I am getting Forbidden error. May be we dont have access to delete items.

So asked thinking there might be any other ways as well.

1 Like

Hey @kkpatel ,

Understood.

One possible way of handling it will be this.

Hope this help.

#nK

1 Like

Thanks @Nithinkrishna.

Yes its good to use Set Transaction Status activity and change its status to Failed. But as we need to handle this in the Init state. the status will be New. And in Uipath we can’t change the status of the queue item to Failed from New.

We are getting error: This queue item has not been processed yet. error code 1852

Hope you got the point.

1 Like

Nope, I guess you can. Only thing is you need to use get transaction item (not get queue item) as mentioned in the thread.

Could you please confirm…

All these things can be done in init.

Hope this helps.

#nK

1 Like

Thanks @Nithinkrishna. Will check this and let you know.