How to run work items in state NEW with RPA.Robocorp.WorkItems

Hi yall.

Sorry, I tried several things with the library RPA.Robocorp.WorkItems but I still cannot get work items in state NEW to process them.

All keywords seem to take work items in state PENDING only.
Did I miss a keyword or argument here?

The NEW items has been generated by an API call.
My target is to iterate through all new items collected via the API (e.g. like RPA.Robocorp.WorkItems library keywords)

Thanks for your help. :smile:

Hi. I looked into our libraries and see which use cases they support and unfortunately this use-case doesn’t seem to be there. I will notify the team. The correct library for this would be RPA.Robocorp.Process since you would have to start a new run to get these items going

I will describe the use-case below what you need to do to get this working if you want to implement something until the library fully supports this. Documentation for the underlying API can be found at Robocorp Process API

  1. You need the ids of the work items in the new state. You can get those from this endpoint
  2. You need to start a new process run by providing the work item ids you want to start and specify type: workItemIds

Hopefully that helps

2 Likes

Hi @timo

thanks for your answer.

Yes, this is how I did it before.
But in this case I do not have the opportunity to change the state. So the item stays in state NEW even if processed. :slight_smile:

Maybe there will be a suitable keyword in the future. :blush:

Regards,
Chris

Hmm not completely following here. What do you mean by it staying in NEW? If you start the items via the API, they should move into processing

Argh…sorry. My mistake.
I used the wrong request.

Nevertheless, I does not really fullfil what I want to reach.

Maybe I have to explain a bit more:

  1. Collecting work items in the queue (x-times per day) - producer
  2. Starting consumer at a specific time and it processes all collected work items

I may solve this with a 3rd process what triggers the consumer but is there also another solution what would currently works without this 3rd process?

I also tried to use GET WORK ITEM and MARK WORK ITEM AS COMPLETED but the last one only handles failed work items.

I feel that you’re looking to schedule a trigger, if yes, then in Control Room you can Configure your process with this:

And you can even trigger the process by sending an e-mail as well. Some related docs:


Release Input Work Item - handles for you both successful and failed processed input items (so they get reported properly in Control Room)
All the processed input items are automatically released as DONE if you don’t explicitly release with the keyword above.

:scroll: We also recommend you this certificate if you haven’t gone through it already: RPA certification level III: Work data management

1 Like

Hi @cosmin

thank you for your reply.

Well, I guess I need to explain a bit more.

Just forget the producer.
The challenge is that there is actually just a consumer having new work items (coming from several sources) in the queue and the consumer is triggered each day at 8 o’clock. So it is not comparable with the examples in Cert3 where you just have two consecutive tasks.

There is currently no keyword in RPA.Robocorp.WorkItems to handle this case and trying to proceed the items with API calls via RPA.Robocorp.Process or RPA.HTTP is possible but not to change the state from NEW to COMPLETED. So the work items stay in state NEW…in this case forever.

Is this more understandable?

Sorry, maybe it is somehow easier to explain… :smile:

1 Like