RNet AI
  • INTRODUCTION
    • About Rnet
    • Quickstart
    • Core Concepts
      • List of Model Providers
  • GETTING STARTED
    • Model
      • Add New Provider
      • Predefined Model Integration
      • Custom Model Integration
      • Interfaces
      • Schema
    • Application Orchestration
      • Overview
      • Interactive Chat Application
      • Agent
      • App Kits
    • Workflow
      • Core Concepts
      • Node Overview
        • Start
        • Question Classifier
        • Knowledge Retrieval
        • Variable Aggregator
        • LLM
        • Direct Reply
        • IF/ELSE
        • HTTP Request
        • End
    • Knowledge Base
Powered by GitBook
On this page
  • 1. Basic Structure:
  • 2. Extended Structure with ELIF (Else If):
  • 3. Execution Flow:
  • 4. Condition Types
  1. GETTING STARTED
  2. Workflow
  3. Node Overview

IF/ELSE

A conditional branching node, often referred to as an IF/ELSE node, allows you to split a workflow into two or more paths based on specific conditions.

1. Basic Structure:

  • IF Condition: This is the primary condition you define. You select a variable (e.g., user input or a calculated value), set a condition, and specify the value that the condition should meet.

    • Example: If the ticket message contains the word “refund”, then the condition is considered True.

  • ELSE Condition: If the IF condition is not met (evaluates to False), the workflow will follow this alternative path.

2. Extended Structure with ELIF (Else If):

  • ELIF Condition: This is an additional condition you can add after the initial IF condition. It works similarly to the IF condition but provides more flexibility by allowing multiple conditions to be evaluated sequentially.

    • Example: If the ticket message contains the word “urgent”, the ELIF condition can define a separate path.

  • Multiple ELIFs: You can chain several ELIF conditions to check various scenarios before finally defaulting to an ELSE path.

    • Example: If the ticket message contains the word “refund”, follow one path; if the ticket message contains the word “urgent”, follow another; otherwise, use the ELSE path.

3. Execution Flow:

  • IF Path: If the initial IF condition evaluates to True, the workflow will execute the actions defined in this path.

  • ELIF Path: If the IF condition is False, but an ELIF condition is True, the workflow follows the ELIF path.

  • ELSE Path: If neither the IF nor any ELIF conditions are met (all evaluate to False), the workflow defaults to the ELSE path.

4. Condition Types

  • Contains

  • Not contains

  • Starts with

  • Ends with

  • Is

  • Is not

  • Is empty

  • Is not empty

Taking the above Sentiment Analysis as an example:

  • IF Condition: Select the title variable from the start node, with the condition is not empty .

  • IF condition evaluates to True, follow the IF path by querying title-related knowledge through the google search.

  • IF condition evaluates to False, i.e., the title variable is empty, execute the ELSE path, responding via the HTTP REQUEST node.

PreviousDirect ReplyNextHTTP Request

Last updated 9 months ago