Efficiently Retrieve Selected Branch Name from Text Classifier Node

I’m utilizing the Text Classifier node in my workflow, which directs the flow into over 20 different branches based on the classification. I’m seeking an efficient method to programmatically capture the name of the selected branch after the Text Classifier node.

Manually configuring a Set node for each branch is impractical due to the number of categories. Is there a streamlined approach or built-in function in n8n that allows for capturing the selected branch name without extensive manual setup?

Information on your n8n setup

  • n8n version: 1.77.1
  • Running n8n via: n8n cloud
1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

do you find any workaround for this?

It would be great if the output of the text classifer node included some kind of “category” property on it that could be referenced further down stream.

1 Like

Hello,

Did you find any solution to this ?

Thank you

Nope. I just put a individual edit field to define the name of each branch. Definitely not a good solution.

1 Like

Solved!

{{ $input.params.categories.categories[$prevNode.outputIndex].category }}
1 Like