Component Workflow: ‘Change Variable Value’ Action does not list component variables

I created a component action workflow Init currentStep that should initialize the component variable getCurrentStep on mounted. But I can’t select component variables in the Change variable value workflow action. I am offered to create new component variables though, but if I create one (e.g. test comp var) it’s can’t be selected either.

Feels like weweb should either not imply that you can use component variables in that context, or it should be listed in the select.


Description: Component vairables and actions


Description: Select not showing component variables, but option to create one.

What does work is of course setting up the workflow in the component workflow panel (not as workflow action).

It’s actually a bit confusing that you can do (nearly) the same thing in two different places, but have different context. Is there documentation on differences between component workflows and component workflow actions?

Also I find the nomenclatur confusing. Is it called component actions because they offer onExecution and are supposed to be called as actions in other workflows? But then again, global workflows are not called actions.

Do you prefer calling it component actions or component workflow actions?

Hi Riko :waving_hand:

Thanks for sharing the details and screenshots, this is a good question because it touches on a subtle distinction in how components work in WeWeb.

Here’s the difference:
Component workflows live inside the component itself. They have direct access to that component’s variables, so you can initialize or update them there.
Component workflow actions are designed to be triggered from outside the component. For that reason, they don’t automatically list or manipulate the internal variables of the component, those are scoped locally to keep the component self-contained.

That’s why you don’t see your component variables in the “Change Variable Value” action when you’re inside a component workflow action. If you want to update component variables, the right place is still the component workflow panel.

As for terminology:
• We usually say “component workflows” when we mean workflows that live inside the component.
• We say “component actions” when those workflows are explicitly marked as allow execution from outside. This is what lets you call them via Execute component action in another workflow.

So in short:

  • Use component workflows to manage component variables.

  • Use component actions when you want to expose certain workflows to the outside world.

I agree it can feel confusing at first because the UI looks similar, but the scope and purpose are different. I’ll pass along your feedback about the wording, it’s helpful to know where this feels unclear.

1 Like

@Agustin_Carozo Thanks for the response!

Just to make it super clear:

  • We have component workflows in the workflow panel, that live inside the component and therefore have access to the component variables, dropzone data etc.

  • We have component actions in the component workflow section that can be explicitly exposed to be called outside the component. They don’t have access to the component’s internals.

  • And then we have a third case, where I have a workflow action that is not exposed. Would that be an action or a workflow?

Also, aren’t properties part of the component? But the onPropertyChange Trigger is only available in component actions. Is that, because they are changed from outside?