Find answers from the community

Updated 6 months ago

Hi guys, I'm starting to study Workflows

At a glance
The community members are discussing the differences between using the Context and setting instance properties in a workflow. The main points are:

- The Context does not persist through multiple runs, while setting an instance property would persist the data. - The advantage of using Context is that in the future it will be able to persist across runs and be stored in a database. - The Context is not shared between nested workflows, so the community members suggest using the StartEvent to pass data between nested workflows instead. - The intention behind the design is to promote more modular and reusable workflows, as sharing the Context would make workflows too coupled.

Hi guys, I'm starting to study Workflows so I migrate a current Query Pipeline I have for this new way the framework made available.

I'm seeing I can pass data between steps through Context. But what's the difference of doing that and setting a instance property to my workflow? The only guess I have is that a single instance of Workflow is supposed to be used for many different users. Is that the case? Thanks!
C
L
5 comments
Another question:

Isn't Context shared between nested workflows? While debugging, I've seen they use different context objects.
Plain Text
I'm seeing I can pass data between steps through Context. But what's the difference of doing that and setting a instance property to my workflow?


The context does not persist through multiple runs (yet), while setting an attribute on self would

The advantage here is that in the near future, context will persist across runs, and will also be able to be persisted in a db

Isn't Context shared between nested workflows? -- it is not
ok, i'm going to pass data to nested workflows using the StartEvent then.

Just asking, is that something that makes sense this context to be shared? It would save some assignements in my code, but it probably has a reason to be designed like this.

Thanks for your reply!
I think the intention here is to promote workflows to be designed as more modular/reusable components.

Sharing the context would make two workflows extremely coupled, and not really reusable anywhere.
using the start event makes sense to me for this
Add a reply
Sign up and join the conversation on Discord