Hello,
Is there any storage in n8n, like a variable that is accessible from any node in my workflow execution?
I am aware of $getWorkflowStaticData(‘global’), but it’s global and has quite a small size limitation.
Something like $workflowContext.set(‘myData’, $json) that unfortunately was deprecated.
My use case: on the workflow start, I load some data from a DB and use various prompts from it, as well as update and use some arrays. Unfortunately, keeping it in the JSON is not feasible, as it gets lost after some nodes, and doing a merge overcomplicates an already complex workflow.
try two community nodes: n8n-nodes-globals - Global Constants
This will add ability to recal a static item. Unfortunetly you cannot dynamically save the item, but there are so many uses for it - i save all my most used expressions and use it as a notepad I can recall from any node and update one line to switch LLM model for entire all workflows, etc.. n8n-nodes-advanced-flow
This has the amazing pop and push nodes, where you can push data within a workflow and pop it anywhere, really cleans up the UI as you dont need workflows to be totally connected, such an amazing node.
What happens if two workflows are running in parallel, and if say, both will try to write/read a firstName variable? no collision?
From documentation: getWorkflowStaticData('global') allows you to persist data across executions, but it is not scoped to a single execution and is intended for small data only. It is not suitable for large or temporary variables within a single execution.
And in any case, what about the size limit? I need a bit more than 256 chars per variable, not GB, but still don’t want to count the length of the strings I try to save…
Thx! While it will not help me in this case, it might be helpful in the future.
I tried to find those nodes, and searching on the edit screen returned no results. Where do I find and how do I use community nodes?
Unfortunately, I can’t use it even as an index variable to control loop count because it’s global. I guess its use is similar to a counter of how many times your workflow has been called or something.
So I don’t really see a use for it.
Thx for trying though!