How do I modify my REFramework Attended Bot to run as an Unattended Bot using an Email Trigger?

Hi,
I have an attended automation built using REFramework, where the process downloads and reads Excel files from an SFTP website. In the current setup, users manually upload Excel files to the SFTP location at random times. I am using excel row data as transaction. The bot is triggered manually through UiPath Assistant, it uses UI automation to loop through all available files on the SFTP website and download required file.

Now I want to convert this attended bot into an unattended bot.
My plan is to use the “Email Received – Specific Subject” trigger so the process starts automatically whenever an email arrives.

I am confused about where the email‑related activities should be placed in REFramework. Should they go:

  • at the start of the Initialization state,
  • inside the Initialization state,
  • or in a separate XAML file invoked from the Framework?

Also, what adjustments do I need to make in REFramework to support this new unattended, email‑triggered flow?

Any guidance or best practices would be greatly appreciated.
Thanks!

Hi @amol.wakchaure

For unattended automation, don’t place email activities inside REFramework. Use the Email Received trigger as a separate process to start the job. That trigger process should only validate the email and start your main REFramework process.

Your existing REFramework can stay mostly the same, just remove any attended elements and make sure it runs fully unattended.

hi @amol.wakchaure

Configure the “Email Received – Specific Subject” trigger directly in Orchestrator Triggers tab (no XAML changes needed for trigger itself). In REFramework:

  1. Initialization state: Add Get IMAP/Outlook Mail Messages to fetch the triggering email + attachment details
  2. Use email attachment/body data to set in_TransactionData (replaces manual SFTP UI loop)
  3. Replace UI automation SFTP download with Download SFTP activity using Config.xlsx credentials
  4. Remove all attended elements (Assistant triggers, Message Boxes, Input Dialogs)

Config updates: Add SFTP credentials as Orchestrator Assets. Deploy with unattended robot license.

Test: Send trigger email → verify SFTP download → Excel row processing works end-to-end.

@amol.wakchaure

Actually if you have O365 integration services connection for email handling, you won’t require to make any changes. Just create a O365 email connection trigger to trigger the bot on the specified email received.

Hi,
Thank you for your response. Help appreciated.
I have set up a outlook Connection now. I will use Trigger to Run the Bot based on email received event with specific Subject line.
But I have a If condition inside the process, UpdateExcel or UpdateApp. I wanted to use email subject line to decide this. Subject line would be “Run a Bot-UpdateExcel or UpdateApp”. Accordingly I will set a Variable value and take the action in the Process.xaml.
So again confusion, how can I do this? I will use email Received activities in Initialization, get the subject line, validate it and set the variable for further processing?
As we are already using Trigger to run the bot so is it necessary to use email activities inside Initialization again and will it work as email has already received and we going inside the State Machine. and now there is no new email coming in to check the subject line again.

Do not use email activities inside REFramework. When you use an Email Received trigger, the email has already been handled by the trigger and the job is started because of it.

Use the trigger to decide what should happen and pass that decision as an input argument to your process, for example ActionType = UpdateExcel or UpdateApp.

In REFramework:

  • Add an In argument (e.g. in_ActionType) to Main.xaml
  • In Init, store it in a variable or Config
  • In Process.xaml, use your existing If condition based on that value

Do not check the mailbox again in Init. There may be no new email, and it is not needed.

Best practice is to either parse the subject in the trigger or use separate triggers for UpdateExcel and UpdateApp, each passing a different ActionType.

1 Like

If this helps, please mark this as the solution.