Hi, I am using the Outlook Node to trigger when an unread email lands in a certain mailbox, works fine.
Nest step is to download the file attached and pass it on into the process using the Outlook Get node.
Issue is if more than one email arrives in at the same time the process triggers correctly but the Get Attachment node will download the attachments from all the unread emails, rather than just then first one, or the one I am passing the ID through for from the initial Trigger.
This then screws up the rest of the process which normally works fine until more than one file is passed through and then it falls over.
Has anyone any suggestions as to how I can stop this happening and make the process run either on each individual unread email, or at least only take one file at a time and pass it through rather than downloading all the attachments from multiple emails and trying to pass them all through?
Thanks in advance.
Neil.
Use the “Split In Batches” option
Insert a SplitInBatches node after the trigger.
https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/
https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftoutlook/
This separates emails one by one, allowing the flow to process each email and its attachment individually.
Outlook Trigger ➜ SplitInBatches (batchSize: 1) ➜ Get Attachment ➜ Rest of the flow
Validate that the nodes use the “item” parameter correctly.
Make sure the Get Attachment node is configured to retrieve the message ID correctly from the current item, not from a list or globally.
Using a Loop with IF and Set
If you need more control, you can build a loop that processes each email:
SplitInBatches node
IF node (checks if it has an attachment)
Get Attachment node
Continue/Merge node to resume processing
OK, so I added the loop, but and will test over the next few days, but I am not sure if this will work.
[[XPZznaQnkOhY3eBh]]
If 10 emails arrive into the box at once and I am using the trigger to pull a specific email ID, will it go back to the mailbox after it has trigger and pull the next one?
Surely once it fires it doesn’t then go back and check to take the next new email and then process it does it?
Thanks for your input.
Neil.