Im new to n8n and I follow some tutorials on how to automate invoices from Gmail to extract file from PDF and later to Basic LLM Chain but in this step when I excute, it takes so much time then I ran out of memory, even though in the tutorial I followed literally all so I don’t think the error from the nodes. is it possible due to my self-hosting Render in Hobby Plan Build Pipeline: 2 CPU 8 GB RAM
Includes 500 free minutes
What is the error message (if any)?
n8n may have run out of memory while running this execution
Please share your workflow
Share the output returned by the last node
the final output should be sending the invoice data to airtable
First, why your loop node do not have an input connector?
second your gmail trigger can get multiple messages with attachments. i think it can take a lot of time and resources when you have multiple mails with large attachments
for debugging, isolate your gmail trigger (create a workflow with gmail trigger node only) and test it, disable Download Attachments, How many emails does it recieve?
You could be running into an error due to the same workflow being triggered too many times in one time span, but just like @ramin1 pointed out, there are other issues with your workflow as well.
The loop node does nothing because the last node that is ran has to point back to the start of the loop. Because of this error, you will not be properly batching the input. Additionally, I’m not entirely sure what the nature of the workflow is, but if you need to run individual PDFs through the LLM, you need to connect the Airtable node back to the loop node in order to get anything. The trigger you set is also polling your inbox every minute which is pretty inefficient as far as batching goes, plus you have no type of filter or guardrail in case there are more than one (or no) attachments which could cause problems later on depending on the nature of what the inbox your’e working with looks like. Most importantly, running any type of workflow that hits an LLM or other AI tool is going to take longer to run. I don’t know what the average execution time looks like for you, but if you are processing a lot of files in one run it could lead to a backup of executions and you could hit an active execution limit, especially if you only have two CPUs allocated for this like you said.
My recommendations would be:
Change the trigger to be ran every 5-10 minutes (or longer if your average execution time is high) to create a bigger buffer between executions allowing the workflow task to complete
- Add the connector from the Airtable node back to the loop node to complete the batching circuit
- Add an if block before the loop node to prevent attachment-less (or multi-attachment) emails from breaking the workflow due to error catching in the export pdf node
hey @ramin1 thanks for your reply and suggestions. I did like what you suggested and I received 1 items. all the process go through and still when it gets to Basic LLM Chain it ran out of memory again before it gets to the airtable.
Also, what I did I connected to new Gmail account that only has 1 email with the 2 attachments which has 35 kb size per file
Hi @NCione thanks for your reply. I did all your recommendations as well. all works well until it gets to the LLM Chain and keep excuting until it sends error: Execution stopped at this node
n8n may have run out of memory while running this execution. More context and tips on how to avoid this in the docs