Is there something like global variable?

I want to have global variables when the workflow starts and be able to change a variable in the next node or add a new variable, is it possible?
I think of using set node when the workflow starts and he will act as global variables

1 Like

I think your approach of using a Set node might be the easiest (it’s what I tend to do in such cases). There is, however, also static workflow data which can be accessed through Function and FunctionItem nodes: Function | Docs, Function Item | Docs. This data would be stored across executions (which otherwise would not be possible).

do you have an example?

You mean for abusing the Set node as data storage? Sure:

First Set Node just creates an empty String value:

image

The Function nodes then add stuff to this particular value of the first (and only) item of the Set node:
image

The final Set node just writes the resulting string in a new result field.

Example Workflow

I use this very rarely though. In my only real case I put together a text-based report. The string field of the initial Set node just holds the result while all subsequent nodes fetch data and add it to the initial string. In most cases this wouldn’t be necessary because you can just write directly to (for example) a Google Doc

Edit: And even in the case described it’s not technically necessary (as I could just fetch the results from each node at the very end of my workflow). But it’s possible if needed :smiley:

1 Like

Thanks that was very helpful

Hey @Roney_Dsilva,

It looks like you have a post and a feature request open for this already, It might be worth sticking to those 2 instead of raising up an older post.

1 Like

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