# Component fails within inactive branch - Unknown variable

**URL:** <https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840>\
**Category:** KNIME Analytics Platform\
**Created:** [April 28, 2024, 5:17am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840 "2024-04-28T05:17:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zovanti](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/c5a1d2/32.png) [@zovanti](https://forum.knime.com/u/zovanti)\
**Post date:** [April 28, 2024, 5:17am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/1 "2024-04-28T05:17:56Z")

</div>

After reviewing the posts [Issues related to node/component execution within inactive branches](https://forum.knime.com/t/issues-related-to-node-component-execution-within-inactive-branches/45317) & [Component is blocking downstream flow even though it is on an inactive branch](https://forum.knime.com/t/component-is-blocking-downstream-flow-even-though-it-is-on-an-inactive-branch/62141) 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:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/c/dce26b9a4e91dfad2a67d1ae16e46147b53fdce2.png)

---

<div class="post-metadata">

**Author:** ![mwiegand](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mwiegand/32/66896_2.png) [@mwiegand](https://forum.knime.com/u/mwiegand)\
**Post date:** [April 28, 2024, 5:44am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/2 "2024-04-28T05:44:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 28, 2024, 7:58am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/3 "2024-04-28T07:58:57Z")

</div>

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

> [@KNIME Bug means specific components cannot be used on Inactive Branch](https://forum.knime.com/t/knime-bug-means-specific-components-cannot-be-used-on-inactive-branch/74820/2):
>
> Having explained that I know of no workaround, I have now worked out a workaround for this specific component, which further demonstrates that the bug is as described above. By recoding the component so that the variable to be returned has a known prefix (in this case “path\_”, the Component Output node can be configured to return only flow variables with that prefix. As there is then no longer a requirement to configure the flow variables (on the “flow variables” tab) , the node no longer fails…

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.

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 28, 2024, 8:17am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/4 "2024-04-28T08:17:45Z")

</div>

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:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/8/983a9a8797e2663751eff4182a4b2ddf3486570e.png)

do this:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/d/dd1311518cf728c0cd119b0f41a4dfb5deb0f1b2.png)

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](https://forum.knime.com/uploads/short-url/8FccDncLLOMc3SHiXCDBocXhQ2E.knwf) (59.6 KB)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/0/d/0d6811955811120a8c425e634694c3ce4a1d37d7.png)

---

<div class="post-metadata">

**Author:** ![zovanti](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/c5a1d2/32.png) [@zovanti](https://forum.knime.com/u/zovanti)\
**Post date:** [April 29, 2024, 12:29am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/5 "2024-04-29T00:29:08Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [April 29, 2024, 10:53am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/6 "2024-04-29T10:53:28Z")

</div>

Glad you got it working @zovanti, and thanks for the coffee! ☕🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 6, 2024, 10:53am UTC](https://forum.knime.com/t/component-fails-within-inactive-branch-unknown-variable/78840/7 "2024-05-06T10:53:44Z")

</div>

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