# How to do if else condition using switch node

In this tutorial we will implement a flow which does the condition check on the input message payload and route the flow to the appropriate target node.

  1. TBD We will be sending a simple number as input for this use case. Lets set it as 400.

  2. Drag and drop the switch node from the routing section in pallette to the canvas. Double click the switch node to open the editor. By default there will be one empty rule entry available.

  3. Click on the add button to add to more entries .

  4. In the first row entry set the condition as > and value as number 1000. In the second row entry set the condition as < and value as number 500. For the thrid row set the condition as otherwise.

  5. Click Save.

  6. Drop three debug nodes from the pallette to the canvas. Name the first debug node as Route1 - Success . Name the second node as Route2 - Success. Name the third node as Route3 - Success .

  7. Click the TBD to test the flow.


As the input is set as 400 the second condition in the switch node is matched and hence the second debug node i.e Route2 - Success will be printed on the debug panel on the editor.