This can happen for various reasons. Please try executing the node again. If the problem persists, you can try the following:
Reduce the number of items processed at a time, by batching them using a loop node
Increase the memory available to the task runner with ‘N8N_RUNNERS_MAX_OLD_SPACE_SIZE’ environment variable.
Above error i get in the below code , please let me know need to change the code or something in the hosting time?It occure first time , my flow is on the production from 8 month.
@NISHANT_GARG you’re loading the full workbook just to read sheet names—that’s blowing runner memory on big files. Pass bookSheets: true so xlsx parses metadata only, skipping cell data.
I would also add a few defensive checks before reading the workbook, because this may not be only a memory issue. Since the flow has been running for months and failed for the first time, I would check whether this specific email attachment is larger than usual, corrupted, password protected, or not really an XLSX file. So I would first confirm whether the latest attachment is unusual, add input validation, and only then decide whether the Azure Docker setup needs more memory.
Hey @NISHANT_GARG, great to see you’ve been running this in production for 8 months - that alone says you built the workflow well!
The suggestions above are all solid. I just want to add one more angle since this is a production flow: the fact that it worked for months and suddenly failed is a strong signal that something changed about the input file, not the code.
A few quick things to check before touching your environment config:
Check the attachment size first - add a quick IF node before the Code node to verify the binary size is within expected range. Something like {{ $binary.data.fileSize > 5000000 }} to catch unusually large files and route them differently.
Wrap the xlsx parsing in try/catch so instead of a hard failure you can log the error and notify yourself: