Unable to add mail message to orchestrator queue

Hello Everyone,

We are having a requirement where we need to add mail messages to orchestrator queue and assign multiple robots to handle the queue items.

When we trying to add the mail message to Queue we are facing a JSON error . Can anyone please help on this ASAP?

The contents of queue items need to be serializable, and MailMessage objects aren’t.
You can write your own serializer for MailMessage or extract the information you want from the MailMessage and then save that into the queue item: How to create Orchestrator Queues for emails in a mailbox? - #6 by Mateus_Cruz

Hi, This may not be the perfect solution but you can give it a try. First you can move the emails that are to be processed for that run to a dedicated Email folder say “EmailsToBeProcessed” and then the dispatcher process can have a For each loop to read through the emails and store the emails in a List of type mailMessage and also have a counter say ‘indexCounter’ to keep track of the position of a particular email in the List. On every loop the indexCounter gets added to the queue and email gets added to List. On the performer process you shall read the same set of emails and this time use the indexCounter from the queue item to pick the exact email that needs to be processed so that multiple bots can work on emails just based on the indexCounter. This way we get to work on the email as mailMessage instead of reading all the details of the email before adding to queue and also helps in forwarding the email if required.
As I sad this may be just a workaround :slight_smile: hope this helps.

@SriramUi Could you please explain how we can process mails by having multiple BOTs without getting duplicated. If you any sample work could you please share?

I have tried this approach and it worked.

  1. Add message ID of the mail to transaction item of the queue in the dispatcher process.

Message ID = <Mail.Message .headers(“UID”).To string

  1. In performer process, extract the Message ID from the queue.

  2. Use Message ID in Get Mail by ID activity to get the Mail Message which you can use for further processing like Reply to Outlook Mail Activity.

Please mark it as solution if this helps. Cheers!

1 Like