Purge previous module results form memory when not needed

Information on your n8n setup

  • **n8n version:**1.71.3
  • **Database (default: SQLite):**Postgres
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):**main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**Docker
  • **Operating system:**Ubuntu 22.04

I use a form to upload a PDF, run a module that reads and prepares a large amount of text from the PDF document, a subsequent module then splits that into chunks, another then sends that data to an OpenAI endpoint, and a final one receives and saves the OpenAI responses to a Google Doc.

This isn’t related to one specific workflow, but more broad. Is it logical and possible to purge the content from each previous step from memory, after the data has been processed, or am I thinking wrong about how n8n handles the data? I could use a simple ‘edit fields’ module to empty the original fields, but wanted to know if it’s worth it. I’m trying to reduce the memory load from running a large workflow where every step of data is retained in memory until the workflow is completed it’s run.

Hey @PowerBoot , the momory is cleared once the workflow is completed. You could break the workflow into subwokflows. That would mean the data from the subwokflow is cleared once the subworklfow is finished. This way you can minimize the memory imprint. In fact, we recommend to split large workflows into subworkflows (you can call them modules), Memory-related errors | n8n Docs.

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