Component fails within inactive branch - Unknown variable

After reviewing the posts Issues related to node/component execution within inactive branches & Component is blocking downstream flow even though it is on an inactive branch I have altered my workflows to utilise Cases rather than the Empty Table Switch. However I have a component which fails because the component output is configured to use a variable for included_names and the variable in question isn’t created when the branch is inactive. Is this expected behaviour?

The screenshot below highlights that the variable (lv_rowcountname) is normally created by the String Configuration node:

Hi @zovanti,

have you tried double or right clicking on the component end node to configure it? I believe you added a variable to pass one level upwards which it expects but does not find.

The issue might be caused by the String Configuration node missing a default value.

Best
Mike

Hi @zovanti , from what you describe, this is the bug (AP-21669) that I reported here:

Can the workaround I described in the above post assist?

I’ve experienced this bug quite a few times over the past couple of years , and if you are able to upload a small demo flow containing your component I may (might) be able to give suggestions on making it work.

Actually @zovanti. I put together what I think is your component.

In this particular case, I think the way to resolve this may be straightforward.
Remove the flow variable link to the String Configuration node:

ie instead of:

do this:

Hope that helps.

The reason why this works is that any flow variables created within the component will get created regardless of whether the component is active or not, provided that the creation of the flow variable itself is not blocked within the component. In the first screenshot, creation of lv_rowcountname is blocked because the linking flow to String Configuration is blocked (inactive branch).

By removing that link, the variable is created even though the component itself is disabled. Weird but true. It is therefore then possible for the Component Ouput Node to “know” of lv_rowcountname, even though the component is inactive.

It’s a quirk of components (and I believe still a bug). Components which fail in this way (and are more difficult to fix), are those that contain logic within the component itself that causes a flow variable to be created only under specific conditions (rather than always). In your case, there is no need to join the Component Input to the String Configuration nodes - the config nodes will work fine unless they actively require information from outside (such as when using column filter/selection configuration nodes).

I’ve uploaded a flow containing (unlinked) components demonstrating the above.

Fix inactive branch component failure.knwf (59.6 KB)

2 Likes

Thanks @takbb your timely and thorough explanation makes sense and will work in this case (ie. the string configuration is not dependent on external variables).

I can see that a ticket was created off the back of your post on the matter so trust that a solution will be provided in due course (fingers crossed).

1 Like

Glad you got it working @zovanti, and thanks for the coffee! :coffee: :slight_smile:

1 Like

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