I had a developer working on some n8n workflows for me a while back before version 1, and one thing he intuitively did was use a Set node to create an empty object, then referenced and updated that same object throughout the workflow.
Note that he wouldn’t necessarily pass that variable’s new value from node to node. Instead, he referenced the same node and updated it/referenced it at will.
Back then, this approach actually worked. You could modify the output of a previous node directly, and it would stay forever changed.
What this meant, practically, was that you could create a sort of workflow-scoped variable that you could work with at any time. It made certain workflows easier. At some point, an update changed this behavior and now node outputs will return to their original state even if you modify them directly with code.
Now, I know we have both workflow static data and execution data, but these are limited in size and don’t show up in the UI, so they’re not adequate for this kind of use-case.
An example of something I’d use this for: if I’m building a long, multi-step workflow and I want to collect a list of things that might have gone wrong to alert the user at the end, I could create a workflow-level array of alerts that I could add to from anywhere in the workflow, then reference at the end. This is possible to do by referencing and chaining together outputs, but come on—it’s a pain and it’s not intuitive.
Now that it doesn’t work to update the output of a node directly, I don’t think there’s really a way around this. Am I missing something?