N8n static memory not working

after 10 runs its still apear 1. I have tried this on paid and self hosting .. same issue.

@fellybill Your static memory isn’t updating because staticData only persists across manual executions and won’t update when the workflow is run manually or isn’t active, so each run still shows the old value..

hi @fellybill

To make it work, ensure all three conditions are met:

  1. The workflow is activated
  2. It is triggered externally (Webhook / Trigger node), not via Execute workflow
  3. staticData is updated before the workflow finishes, for example:
const data = this.getWorkflowStaticData('global')
data.counter = (data.counter || 0) + 1
return [{ json: { counter: data.counter } }]

If any of these is missing, the value will stay the same.
This is expected behavior.

the workflow is running automatically. I have been troubleshoot this for 5 days straight .. same issue. memory not persistance .. i did not ran it manuelly . click publish at let it ran for hours, monitoring process in the active executions panel .. Am feedup

the workflow is running automatically. I have been troubleshoot this for 5 days straight .. same issue. memory not persistance .. i did not ran it manuelly . click publish at let it ran for hours, monitoring process in the active executions panel .. Am feedup

@fellybill

thanks for your patience — I can see why this has been frustrating.

The key point that hasn’t been made explicit yet is this:

staticData is only persisted when a workflow execution fully finishes successfully.
If an execution remains active (visible in Active Executions), the updated staticData is never committed, even though the code node runs.

That explains your symptom perfectly:

  • The counter increments in memory
  • The execution never truly ends
  • The value is discarded
  • Next run starts again at 1

This is expected behavior, not a bug.

Common reasons an execution never finishes:

  • A trigger that keeps the execution open (Webhook, Form, long-polling)
  • Long-running or streaming nodes (AI / agents)
  • Wait / delay nodes
  • Any node that keeps the execution “active” for hours

You mentioned monitoring the workflow in Active Executions for hours — that alone confirms why staticData never persists.

What you can do

  1. Ensure the workflow actually finishes
  • No waiting / streaming / open HTTP responses
  • Execution must disappear from Active Executions
  1. Only use staticData for short, finite executions
  • It’s not a general-purpose memory store
  1. For real persistence (recommended)
  • Use a database, Redis, n8n Data Store, or an external service
  • staticData is intentionally limited by design

So the behavior you’re seeing is expected, and your setup isn’t “broken” — it’s just hitting the documented limits of staticData.

Hope this clears it up. If you want to share what trigger or long-running node you’re using, we can confirm exactly what’s keeping the execution open.

1 Like