Email IMAP Trigger giving not enough memory error

I am using N8N Cloud and I’m trying to use Email IMAP to listen for a new email on my Outlook account. However, when I try to run the workflow or even test the IMAP node, it runs for a long time even though new emails are being received by Outlook, it doesn’t register them and eventually gives me this error.
Please help, I have no idea why this is happening on N8N Cloud.
" ERROR: Execution stopped at this node

n8n may have run out of memory while executing it. More context and tips on how to avoid this in the docs"

Hey @Zain_Imdad,

Welcome to the community :tada:

Can you share your cloud username so I can take a look at the logs for your instance? Do you also have a lot of emails in that inbox or maybe a large file in an attachment?

@Jon Thanks for getting back to me. This is my cloud username. Also, I have around 1000 emails in my inbox, but no files larger than 50KBs.
user: efinancialtree.app.n8n.cloud

Hey @Zain_Imdad,

It looks like your cloud instance is hitting the memory limit fairly often. What happens if you try without attachments or by setting an email to change what is picked up?

Hey @Jon - Nothing is picked up. The node just runs perpetually and eventually times out with the error given above.

Hey @Zain_Imdad,

Was that with no attachments to find? Can you also try a folder with less in it?

Hey @Jon - I tried to set up a new IMAP node to try with a folder with less in it. But it seems, I can’t connect to my Email account now using the IMAP node.
I’m getting this error “User is authenticated but not connected.”

Those settings look like they should work, I have just given it a quick test with an outlook.com account I have and it was able to access it. Does that mailbox have imap enabled?

If you are using outlook or Microsoft365 using the Outlook node would probably be a better experience but you would have to build in the polling logic manually.

Yes, here are my Email settings, it seems I do have POP and IMAP enabled. But I’m still getting the error : “User is authenticated but not connected.”
Can you please give me the alternative solution you’re referring to i.e building the polling logic using Outlook nodes? I want to be able to trigger a workflow upon receiving a new email and download its attachments if it has any.
Thanks for your help!

Hey @Zain_Imdad,

That is interesting I am not sure why else Outlook would be returning that error message it could be something else account related sadly it is not our error message so it is hard to troubleshoot.

I don’t have an example to hand of a manual poll but something like the below would be a starting point however depending on your cloud plan you may still see memory issues if there are a lot of emails.

I am still having issues with my Workflow with emails that have multiple attachments. I am trying to loop over them, but it only processes the file for the first iteration, it provides errors for emails with more than 1 files. Can you help with this?

How many files and how big are they? As your cloud plan is hitting a memory limit it could be that the next cloud plan would be the best option which will give you more memory to work with but it depends on when you see the error in the workflow.

If it is still in the first node it will be a case of breaking it down into smaller chunks so maybe getting the email without attachments then calling a sub workflow in a loop to get the attachments using the message id.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.