Skip to content

If-Else Node

The If-Else node is a tool for controlling workflow flow based on specific conditions.

This tutorial introduces a “workflow that branches processing based on chat text.”

if-else node

First, create a new workflow in Studio.

Add a If-Else node and configure the following settings:

  • IF
    • Select Variable: start.query
    • Condition: Contains, Constant, reply
  • ELIF
    • Select Variable: start.query
    • Condition: Contains, Constant, tell me

This allows you to execute different processes depending on whether the user’s input contains “reply” or “tell me”.

if-else settings

Next, add three new LLM nodes to the right of the If-Else node and copy and paste the following content into each prompt:

## Task to Execute
{start.query}
## My Information
- Name: Samurai Taro
- Company Name: Demo Corporation
## Task to Execute
{start.query}
## Considerations
- Output in English
## Task to Execute
{start.query}

text generation

The final workflow looks like this:

overall workflow

Now you’re ready! Click the debug button to run the workflow. A sample chat message is as follows:

Think of a reply to the following email
I recently purchased a product, but it broke. What should I do?

When executed, a reply email text that considers the pre-configured personal information was output 🚀

result workflow

For Answer Questions in English

Tell me the capital of America

output

The capital of the United States is Washington, D.C.

For Other Processing

I want to know about 3 popular anime in Japan

output

Here are 3 popular anime in Japan.
Demon Slayer (Kimetsu no Yaiba)
Set in the Taisho era, the story follows a boy named Tanjiro whose family was killed by demons, as he fights demons to turn his sister back into a human. It was a huge hit both domestically and internationally with beautiful animation and a moving story.
Attack on Titan (Shingeki no Kyojin)
A dark fantasy where humanity fights titans while struggling to survive in a world dominated by titans. Popular for its intricate storyline and powerful action.
Jujutsu Kaisen (Jujutsu Kaisen)
A work depicting the battles of jujutsu sorcerers fighting curses. Supported for its attractive characters, powerful battle scenes, and unique worldview.
These are particularly popular in Japan and are widely known among anime fans.