{"id":105575,"date":"2025-05-21T18:13:01","date_gmt":"2025-05-21T11:13:01","guid":{"rendered":"https:\/\/wiki.tino.org\/?p=105575"},"modified":"2025-07-09T19:37:21","modified_gmt":"2025-07-09T12:37:21","slug":"cach-su-dung-node-if-va-node-switch-trong-n8n","status":"publish","type":"post","link":"https:\/\/tino.vn\/blog\/cach-su-dung-node-if-va-node-switch-trong-n8n\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn c\u00e1ch s\u1eed d\u1ee5ng node IF v\u00e0 node Switch trong n8n cho ng\u01b0\u1eddi m\u1edbi"},"content":{"rendered":"\n<p><strong>Trong qu\u00e1 tr\u00ecnh x\u00e2y d\u1ef1ng <a href=\"https:\/\/tino.vn\/blog\/cach-su-dung-mau-workflow-co-san-trong-n8n\/\" target=\"_blank\" data-type=\"post\" data-id=\"105251\" rel=\"noreferrer noopener\">workflow <\/a>v\u1edbi <a href=\"http:\/\/n8n.io\" target=\"_blank\" data-type=\"post\" data-id=\"104774\" rel=\"noreferrer noopener nofollow\">n8n<\/a>, vi\u1ec7c x\u1eed l\u00fd c\u00e1c \u0111i\u1ec1u ki\u1ec7n r\u1ebd nh\u00e1nh l\u00e0 y\u1ebfu t\u1ed1 c\u1ef1c k\u1ef3 quan tr\u1ecdng gi\u00fap quy tr\u00ecnh ho\u1ea1t \u0111\u1ed9ng linh ho\u1ea1t h\u01a1n. Hai node th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng nh\u1ea5t \u0111\u1ec3 x\u1eed l\u00fd logic \u0111i\u1ec1u ki\u1ec7n l\u00e0 IF v\u00e0 Switch. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd h\u01b0\u1edbng d\u1eabn chi ti\u1ebft c\u00e1ch s\u1eed d\u1ee5ng node IF v\u00e0 node Switch trong n8n k\u00e8m v\u00ed d\u1ee5 th\u1ef1c t\u1ebf \u0111\u01a1n gi\u1ea3n \u0111\u1ec3 b\u1ea1n d\u1ec5 d\u00e0ng \u00e1p d\u1ee5ng v\u00e0o c\u00f4ng vi\u1ec7c t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u1ee7a m\u00ecnh.<\/strong><\/p>\n\n\n\n<h2 id=\"Node_IF_&amp;_Switch_trong_n8n_l\u00e0_g\u00ec?\"><a id=\"post-105575-_dw8f8jzb3q5g\"><\/a><strong>Node IF &amp; Switch trong n8n l\u00e0 g\u00ec?<\/strong><\/h2>\n\n\n\n<h3 id=\"Node_IF_\"><a id=\"post-105575-_p263vttbk8vf\"><\/a><strong>Node IF <\/strong><\/h3>\n\n\n\n<p>Node IF trong n8n ho\u1ea1t \u0111\u1ed9ng gi\u1ed1ng nh\u01b0 c\u00e2u l\u1ec7nh \u201cn\u1ebfu&#8230; th\u00ec&#8230;\u201d trong l\u1eadp tr\u00ecnh. N\u00f3 cho ph\u00e9p b\u1ea1n ki\u1ec3m tra m\u1ed9t \u0111i\u1ec1u ki\u1ec7n c\u1ee5 th\u1ec3 v\u00e0 quy\u1ebft \u0111\u1ecbnh lu\u1ed3ng workflow s\u1ebd \u0111i theo h\u01b0\u1edbng n\u00e0o d\u1ef1a tr\u00ean k\u1ebft qu\u1ea3 ki\u1ec3m tra \u0111\u00f3. Node IF c\u00f3 hai nh\u00e1nh: True v\u00e0 False. N\u1ebfu \u0111i\u1ec1u ki\u1ec7n \u0111\u00fang (True), workflow s\u1ebd ti\u1ebfp t\u1ee5c ch\u1ea1y qua nh\u00e1nh True; n\u1ebfu sai (False), n\u00f3 s\u1ebd \u0111i theo nh\u00e1nh False.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-2.png\" alt=\"Node IF trong n8n l\u00e0 g\u00ec?\" class=\"wp-image-105577\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-2.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-2-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Node IF trong n8n l\u00e0 g\u00ec?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>V\u00ed d\u1ee5, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng node IF \u0111\u1ec3 ki\u1ec3m tra xem ng\u01b0\u1eddi d\u00f9ng \u0111\u00e3 \u0111i\u1ec1n s\u1ed1 \u0111i\u1ec7n tho\u1ea1i hay ch\u01b0a trong m\u1ed9t bi\u1ec3u m\u1eabu. N\u1ebfu c\u00f3, b\u1ea1n s\u1ebd g\u1eedi m\u1ed9t tin nh\u1eafn SMS; n\u1ebfu kh\u00f4ng, b\u1ea1n s\u1ebd g\u1eedi email nh\u1eafc nh\u1edf.<\/p>\n\n\n\n<h3 id=\"Node_Switch\"><a id=\"post-105575-_o8gezqb6g5ts\"><\/a><strong>Node Switch<\/strong><\/h3>\n\n\n\n<p>Node Switch trong n8n gi\u00fap b\u1ea1n ph\u00e2n lu\u1ed3ng d\u1eef li\u1ec7u d\u1ef1a tr\u00ean gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3 c\u1ee7a m\u1ed9t tr\u01b0\u1eddng n\u00e0o \u0111\u00f3. Thay v\u00ec ch\u1ec9 c\u00f3 hai l\u1ef1a ch\u1ecdn nh\u01b0 node IF, node Switch cho ph\u00e9p b\u1ea1n thi\u1ebft l\u1eadp nhi\u1ec1u nh\u00e1nh kh\u00e1c nhau, m\u1ed7i nh\u00e1nh t\u01b0\u01a1ng \u1ee9ng v\u1edbi m\u1ed9t gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3. \u0110i\u1ec1u n\u00e0y \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch khi b\u1ea1n c\u1ea7n x\u1eed l\u00fd nhi\u1ec1u tr\u01b0\u1eddng h\u1ee3p t\u1eeb m\u1ed9t ngu\u1ed3n d\u1eef li\u1ec7u duy nh\u1ea5t.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-3.png\" alt=\"Node IF trong n8n l\u00e0 g\u00ec?\" class=\"wp-image-105578\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-3.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-3-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Node IF trong n8n l\u00e0 g\u00ec?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>V\u00ed d\u1ee5, n\u1ebfu b\u1ea1n \u0111ang x\u1eed l\u00fd \u0111\u01a1n h\u00e0ng v\u00e0 mu\u1ed1n ph\u00e2n chia ch\u00fang theo ph\u01b0\u01a1ng th\u1ee9c thanh to\u00e1n (th\u1ebb t\u00edn d\u1ee5ng, chuy\u1ec3n kho\u1ea3n, v\u00ed \u0111i\u1ec7n t\u1eed&#8230;), b\u1ea1n c\u00f3 th\u1ec3 d\u00f9ng node Switch \u0111\u1ec3 \u0111i\u1ec1u h\u01b0\u1edbng m\u1ed7i lo\u1ea1i \u0111\u01a1n h\u00e0ng sang m\u1ed9t nh\u00e1nh x\u1eed l\u00fd ri\u00eang bi\u1ec7t.<\/p>\n\n\n\n<h2 id=\"Nh\u1eefng_tr\u01b0\u1eddng_h\u1ee3p_n\u00e0o_c\u1ea7n_s\u1eed_d\u1ee5ng_node_IF_v\u00e0_Switch?\"><a id=\"post-105575-_jhm1yvvrx71v\"><\/a><strong>Nh\u1eefng tr\u01b0\u1eddng h\u1ee3p n\u00e0o c\u1ea7n s\u1eed d\u1ee5ng node IF v\u00e0 Switch?<\/strong><\/h2>\n\n\n\n<h3 id=\"Khi_n\u00e0o_n\u00ean_s\u1eed_d\u1ee5ng_node_IF?\"><a id=\"post-105575-_mxf2yqm17wql\"><\/a><strong>Khi n\u00e0o n\u00ean s\u1eed d\u1ee5ng node IF?<\/strong><\/h3>\n\n\n\n<p>Node IF ph\u00f9 h\u1ee3p cho c\u00e1c t\u00ecnh hu\u1ed1ng c\u1ea7n \u0111\u01b0a ra quy\u1ebft \u0111\u1ecbnh nh\u1ecb ph\u00e2n (ch\u1ec9 c\u00f3 hai l\u1ef1a ch\u1ecdn: \u0111\u00fang ho\u1eb7c sai). S\u1eed d\u1ee5ng node IF khi:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ki\u1ec3m tra \u0111i\u1ec1u ki\u1ec7n \u0111\u01a1n gi\u1ea3n:<\/strong> V\u00ed d\u1ee5, ki\u1ec3m tra xem m\u1ed9t email c\u00f3 ch\u1ee9a t\u1eeb kh\u00f3a c\u1ee5 th\u1ec3 (nh\u01b0 &#8220;kh\u1ea9n c\u1ea5p&#8221;) \u0111\u1ec3 quy\u1ebft \u0111\u1ecbnh g\u1eedi th\u00f4ng b\u00e1o hay kh\u00f4ng.<\/li>\n\n\n\n<li><strong>X\u1eed l\u00fd c\u00f3\/kh\u00f4ng:<\/strong> Ch\u1eb3ng h\u1ea1n, ki\u1ec3m tra xem m\u1ed9t kh\u00e1ch h\u00e0ng c\u00f3 \u0111\u0103ng k\u00fd d\u1ecbch v\u1ee5 hay ch\u01b0a \u0111\u1ec3 g\u1eedi \u01b0u \u0111\u00e3i ho\u1eb7c b\u1ecf qua.<\/li>\n\n\n\n<li><strong>L\u1ecdc d\u1eef li\u1ec7u c\u01a1 b\u1ea3n:<\/strong> Nh\u01b0 ki\u1ec3m tra gi\u00e1 tr\u1ecb s\u1ed1 (gi\u00e1 \u0111\u01a1n h\u00e0ng > 1 tri\u1ec7u) \u0111\u1ec3 th\u1ef1c hi\u1ec7n h\u00e0nh \u0111\u1ed9ng ti\u1ebfp theo.<\/li>\n\n\n\n<li><strong>Quy tr\u00ecnh tuy\u1ebfn t\u00ednh v\u1edbi hai h\u01b0\u1edbng:<\/strong> Khi b\u1ea1n ch\u1ec9 c\u1ea7n ph\u00e2n nh\u00e1nh th\u00e0nh hai lu\u1ed3ng (true\/false).<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-4.png\" alt=\"Nh\u1eefng tr\u01b0\u1eddng h\u1ee3p n\u00e0o c\u1ea7n s\u1eed d\u1ee5ng node IF v\u00e0 Switch?\" class=\"wp-image-105579\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-4.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-4-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Nh\u1eefng tr\u01b0\u1eddng h\u1ee3p n\u00e0o c\u1ea7n s\u1eed d\u1ee5ng node IF v\u00e0 Switch?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 id=\"Khi_n\u00e0o_n\u00ean_s\u1eed_d\u1ee5ng_node_Switch?\"><a id=\"post-105575-_smoa9w821fv4\"><\/a><strong>Khi n\u00e0o n\u00ean s\u1eed d\u1ee5ng node Switch?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Ph\u00e2n lo\u1ea1i d\u1eef li\u1ec7u d\u1ef1a tr\u00ean nhi\u1ec1u gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3:<\/strong> V\u00ed d\u1ee5, X\u1eed l\u00fd \u0111\u01a1n h\u00e0ng theo ph\u01b0\u01a1ng th\u1ee9c thanh to\u00e1n (th\u1ebb t\u00edn d\u1ee5ng, chuy\u1ec3n kho\u1ea3n, COD&#8230;).<\/li>\n\n\n\n<li><strong>Ch\u1ecdn h\u00e0nh \u0111\u1ed9ng t\u01b0\u01a1ng \u1ee9ng v\u1edbi t\u1eebng lo\u1ea1i s\u1ef1 ki\u1ec7n:<\/strong> Khi b\u1ea1n nh\u1eadn d\u1eef li\u1ec7u t\u1eeb webhook v\u1edbi tr\u01b0\u1eddng &#8220;eventType&#8221; l\u00e0 &#8220;signup&#8221;, &#8220;purchase&#8221;, &#8220;unsubscribe&#8221;&#8230; b\u1ea1n c\u00f3 th\u1ec3 x\u1eed l\u00fd t\u1eebng s\u1ef1 ki\u1ec7n theo c\u00e1ch ri\u00eang bi\u1ec7t.<\/li>\n\n\n\n<li><strong>Routing workflow theo nhi\u1ec1u \u0111i\u1ec1u ki\u1ec7n r\u00f5 r\u00e0ng:<\/strong> Gi\u00fap b\u1ea1n t\u00e1ch lu\u1ed3ng x\u1eed l\u00fd th\u00e0nh nhi\u1ec1u nh\u00e1nh r\u00f5 r\u00e0ng h\u01a1n thay v\u00ec l\u1ed3ng gh\u00e9p nhi\u1ec1u node IF ph\u1ee9c t\u1ea1p.<\/li>\n\n\n\n<li><strong>Thay th\u1ebf chu\u1ed7i node IF li\u00ean ti\u1ebfp:<\/strong> N\u1ebfu b\u1ea1n \u0111ang d\u00f9ng nhi\u1ec1u node IF n\u1ed1i nhau \u0111\u1ec3 ki\u1ec3m tra c\u00e1c gi\u00e1 tr\u1ecb kh\u00e1c nhau trong c\u00f9ng m\u1ed9t tr\u01b0\u1eddng, h\u00e3y thay b\u1eb1ng node Switch \u0111\u1ec3 d\u1ec5 nh\u00ecn v\u00e0 d\u1ec5 qu\u1ea3n l\u00fd h\u01a1n.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"H\u01b0\u1edbng_d\u1eabn_c\u00e1ch_s\u1eed_d\u1ee5ng_node_IF_v\u00e0_node_Switch_trong_n8n_(v\u00ed_d\u1ee5_c\u1ee5_th\u1ec3)\"><a id=\"post-105575-_beq0hcrwb04j\"><\/a><strong>H\u01b0\u1edbng d\u1eabn c\u00e1ch s\u1eed d\u1ee5ng node IF v\u00e0 node Switch trong n8n (v\u00ed d\u1ee5 c\u1ee5 th\u1ec3)<\/strong><\/h2>\n\n\n\n<h3 id=\"C\u00e1ch_s\u1eed_d\u1ee5ng_node_IF_trong_n8n\"><a id=\"post-105575-_x6xqns3dvq6c\"><\/a><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/h3>\n\n\n\n<p>Ch\u00fang ta s\u1ebd t\u1ea1o m\u1ed9t workflow ki\u1ec3m tra xem ng\u01b0\u1eddi d\u00f9ng c\u00f3 \u0111\u0103ng k\u00fd b\u1eb1ng email thu\u1ed9c mi\u1ec1n @tino.org hay kh\u00f4ng.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>N\u1ebfu c\u00f3:<\/strong> G\u1eedi email ch\u00e0o m\u1eebng \u0111\u1ebfn nh\u00e2n vi\u00ean n\u1ed9i b\u1ed9.<\/li>\n\n\n\n<li><strong>N\u1ebfu kh\u00f4ng: <\/strong>G\u1eedi email ch\u00e0o m\u1eebng \u0111\u1ebfn ng\u01b0\u1eddi d\u00f9ng b\u00ean ngo\u00e0i.<\/li>\n<\/ul>\n\n\n\n<p>C\u00e1c b\u01b0\u1edbc th\u1ef1c hi\u1ec7n:<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 1: <\/strong>Truy c\u1eadp giao di\u1ec7n n8n v\u00e0 nh\u1ea5n v\u00e0o n\u00fat \u201c<strong>Create Workflow<\/strong>\u201d \u0111\u1ec3 t\u1ea1o workflow m\u1edbi.<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 2:<\/strong> Nh\u1ea5n v\u00e0o n\u00fat \u201c<strong>+<\/strong>\u201d tr\u00ean canvas v\u00e0 t\u00ecm ki\u1ebfm \u201c<strong>Manual Trigger<\/strong>\u201d.<\/p>\n\n\n\n<p>Ch\u1ecdn node n\u00e0y \u0111\u1ec3 l\u00e0m \u0111i\u1ec3m b\u1eaft \u0111\u1ea7u cho workflow.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1266\" height=\"711\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-5.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105580\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-5.png 1266w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-5-300x168.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-5-1024x575.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-5-768x431.png 768w\" sizes=\"(max-width: 1266px) 100vw, 1266px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 3:<\/strong> Th\u00eam node \u201c<strong>Set<\/strong>\u201d sau node Manual Trigger \u0111\u1ec3 m\u00f4 ph\u1ecfng d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1470\" height=\"804\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-6.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105581\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-6.png 1470w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-6-300x164.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-6-1024x560.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-6-768x420.png 768w\" sizes=\"(max-width: 1470px) 100vw, 1470px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>C\u1ea5u h\u00ecnh node Set nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Nh\u1ea5n <strong>Add Field<\/strong>.<\/li>\n\n\n\n<li>\u1ede \u00f4 name, nh\u1eadp: <strong>email<\/strong>.<\/li>\n\n\n\n<li>\u1ede \u00f4 value, nh\u1eadp: <strong>tunghd@tino.org<\/strong>.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1518\" height=\"816\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-7.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105582\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-7.png 1518w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-7-300x161.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-7-1024x550.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-7-768x413.png 768w\" sizes=\"(max-width: 1518px) 100vw, 1518px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 4: <\/strong>Th\u00eam node <strong>IF<\/strong> sau node Set \u0111\u1ec3 ki\u1ec3m tra mi\u1ec1n email.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1466\" height=\"765\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-8.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105583\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-8.png 1466w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-8-300x157.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-8-1024x534.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-8-768x401.png 768w\" sizes=\"(max-width: 1466px) 100vw, 1466px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>C\u1ea5u h\u00ecnh node IF nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Value 1: <\/strong><code>{{$json[\"email\"]}}<\/code><\/li>\n\n\n\n<li>Ch\u1ecdn <strong>String<\/strong> -> <strong>ends with<\/strong><\/li>\n\n\n\n<li><strong>Value 2:<\/strong> @tino.org<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1447\" height=\"816\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-9.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105584\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-9.png 1447w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-9-300x169.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-9-1024x577.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-9-768x433.png 768w\" sizes=\"(max-width: 1447px) 100vw, 1447px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Nh\u01b0 v\u1eady:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>N\u1ebfu email ch\u1ee9a @tino.org \u2192 node IF chuy\u1ec3n sang nh\u00e1nh true.<\/li>\n\n\n\n<li>N\u1ebfu kh\u00f4ng ch\u1ee9a \u2192 node IF chuy\u1ec3n sang nh\u00e1nh false.<\/li>\n<\/ul>\n\n\n\n<p><strong>B\u01b0\u1edbc 5:<\/strong> Th\u00eam node <strong>Gmail -&gt; Send a Message<\/strong> sau nh\u00e1nh<strong> True<\/strong> c\u1ee7a node IF.<\/p>\n\n\n\n<p>C\u1ea5u h\u00ecnh node Send Email nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>To:<\/strong> <code>{{$json[\"email\"]}}<\/code><\/li>\n\n\n\n<li><strong>Subject:<\/strong> Ch\u00e0o m\u1eebng b\u1ea1n \u0111\u1ebfn v\u1edbi c\u00f4ng ty!<\/li>\n\n\n\n<li><strong>Message: <\/strong>Ch\u00fang t\u00f4i r\u1ea5t vui m\u1eebng ch\u00e0o \u0111\u00f3n b\u1ea1n l\u00e0 th\u00e0nh vi\u00ean m\u1edbi c\u1ee7a c\u00f4ng ty.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1533\" height=\"877\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-10.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105585\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-10.png 1533w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-10-300x172.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-10-1024x586.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-10-768x439.png 768w\" sizes=\"(max-width: 1533px) 100vw, 1533px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 6: <\/strong>Th\u00eam node <strong>Gmail<\/strong> -&gt;<strong> Send a Message <\/strong>sau nh\u00e1nh <strong>False<\/strong> c\u1ee7a node IF.<\/p>\n\n\n\n<p>C\u1ea5u h\u00ecnh node Send Email nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>To: <\/strong><code>{{$json[\"email\"]}}<\/code><\/li>\n\n\n\n<li><strong>Subject: <\/strong>Ch\u00e0o m\u1eebng b\u1ea1n \u0111\u1ebfn v\u1edbi d\u1ecbch v\u1ee5 c\u1ee7a ch\u00fang t\u00f4i!<\/li>\n\n\n\n<li><strong>Text:<\/strong> C\u1ea3m \u01a1n b\u1ea1n \u0111\u00e3 \u0111\u0103ng k\u00fd. Ch\u00fang t\u00f4i r\u1ea5t mong \u0111\u01b0\u1ee3c ph\u1ee5c v\u1ee5 b\u1ea1n.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1498\" height=\"883\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-11.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105586\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-11.png 1498w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-11-300x177.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-11-1024x604.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-11-768x453.png 768w\" sizes=\"(max-width: 1498px) 100vw, 1498px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 7:<\/strong> Nh\u1ea5n v\u00e0o n\u00fat \u201c<strong>Test Workflow<\/strong>\u201d \u0111\u1ec3 ch\u1ea1y th\u1eed.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1650\" height=\"899\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-12.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105587\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-12.png 1650w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-12-300x163.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-12-1024x558.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-12-768x418.png 768w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-12-1536x837.png 1536w\" sizes=\"(max-width: 1650px) 100vw, 1650px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Ki\u1ec3m tra xem email \u0111\u01b0\u1ee3c g\u1eedi \u0111\u00fang theo \u0111i\u1ec1u ki\u1ec7n \u0111\u00e3 thi\u1ebft l\u1eadp.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1048\" height=\"600\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-13.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105588\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-13.png 1048w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-13-300x172.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-13-1024x586.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-13-768x440.png 768w\" sizes=\"(max-width: 1048px) 100vw, 1048px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>B\u1ea1n c\u00f3 th\u1ec3 thay \u0111\u1ed5i gi\u00e1 tr\u1ecb email trong node Set, v\u00ed d\u1ee5: huynhdongtungufm@gmail.com, r\u1ed3i ch\u1ea1y l\u1ea1i workflow \u0111\u1ec3 ki\u1ec3m tra \u0111\u01b0\u1eddng nh\u00e1nh false.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1240\" height=\"676\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-14.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105589\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-14.png 1240w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-14-300x164.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-14-1024x558.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-14-768x419.png 768w\" sizes=\"(max-width: 1240px) 100vw, 1240px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"962\" height=\"534\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-15.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n\" class=\"wp-image-105590\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-15.png 962w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-15-300x167.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-15-768x426.png 768w\" sizes=\"(max-width: 962px) 100vw, 962px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node IF trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h3 id=\"C\u00e1ch_s\u1eed_d\u1ee5ng_node_Switch_trong_n8n\"><a id=\"post-105575-_itv7qsfr48mz\"><\/a><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/h3>\n\n\n\n<p>Gi\u1ea3 s\u1eed b\u1ea1n c\u00f3 m\u1ed9t danh s\u00e1ch ng\u01b0\u1eddi d\u00f9ng v\u1edbi thu\u1ed9c t\u00ednh role v\u00e0 b\u1ea1n mu\u1ed1n ph\u00e2n lo\u1ea1i h\u1ecd th\u00e0nh c\u00e1c nh\u00f3m kh\u00e1c nhau \u0111\u1ec3 x\u1eed l\u00fd ri\u00eang bi\u1ec7t:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>admin:<\/strong> G\u1eedi th\u00f4ng b\u00e1o qu\u1ea3n tr\u1ecb.<\/li>\n\n\n\n<li><strong>editor<\/strong>: G\u1eedi th\u00f4ng b\u00e1o ch\u1ec9nh s\u1eeda.<\/li>\n\n\n\n<li><strong>viewer<\/strong>: G\u1eedi th\u00f4ng b\u00e1o xem.<\/li>\n<\/ul>\n\n\n\n<p>C\u00e1c b\u01b0\u1edbc th\u1ef1c hi\u1ec7n:<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 1: <\/strong>Truy c\u1eadp giao di\u1ec7n n8n, nh\u1ea5n v\u00e0o n\u00fat \u201c<strong>Create Workflow<\/strong>\u201d \u0111\u1ec3 t\u1ea1o workflow m\u1edbi.<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 2:<\/strong> Nh\u1ea5n v\u00e0o n\u00fat \u201c<strong>+<\/strong>\u201d tr\u00ean canvas v\u00e0 t\u00ecm ki\u1ebfm \u201c<strong>Manual Trigger<\/strong>\u201d.<\/p>\n\n\n\n<p>Ch\u1ecdn node n\u00e0y \u0111\u1ec3 l\u00e0m \u0111i\u1ec3m b\u1eaft \u0111\u1ea7u cho workflow.<\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 3: <\/strong>Ti\u1ebfp t\u1ee5c th\u00eam node <strong>Set <\/strong>\u0111\u1ec3 m\u00f4 ph\u1ecfng d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"977\" height=\"574\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-16.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n\" class=\"wp-image-105591\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-16.png 977w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-16-300x176.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-16-768x451.png 768w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>C\u1ea5u h\u00ecnh node Set nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Mode:<\/strong> Manual Mapping<\/li>\n\n\n\n<li>Nh\u1ea5n <strong>Fields<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>name:<\/strong> role<\/li>\n\n\n\n<li><strong>value:<\/strong> editor<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1459\" height=\"799\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-17.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n\" class=\"wp-image-105592\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-17.png 1459w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-17-300x164.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-17-1024x561.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-17-768x421.png 768w\" sizes=\"(max-width: 1459px) 100vw, 1459px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 4:<\/strong> Th\u00eam node \u201c<strong>Switch<\/strong>\u201d sau node Set.<\/p>\n\n\n\n<p>C\u1ea5u h\u00ecnh node Switch nh\u01b0 sau:<\/p>\n\n\n\n<p><strong>Ch\u1ecdn Mode: <\/strong>Rules<\/p>\n\n\n\n<p>\u1ede \u00f4 Routing Rules \u0111\u1ea7u ti\u00ean, nh\u1eadp:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Value 1: <code>{{$json[\"role\"]}}<\/code><\/li>\n\n\n\n<li>value2: admin<\/li>\n<\/ul>\n\n\n\n<p>Nh\u1ea5n <strong>Add Routing Rule<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Value 1: <code>{{$json[\"role\"]}}<\/code><\/li>\n\n\n\n<li>value2: editor<\/li>\n<\/ul>\n\n\n\n<p>Ti\u1ebfp t\u1ee5c nh\u1ea5n <strong>Add Routing Rule<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Value 1: <code>{{$json[\"role\"]}}<\/code><\/li>\n\n\n\n<li>value2: viewer<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1569\" height=\"872\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-18.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n\" class=\"wp-image-105593\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-18.png 1569w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-18-300x167.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-18-1024x569.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-18-768x427.png 768w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-18-1536x854.png 1536w\" sizes=\"(max-width: 1569px) 100vw, 1569px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p><strong>Convert types where required:<\/strong> B\u1eadt n\u1ebfu b\u1ea1n c\u1ea7n so s\u00e1nh ki\u1ec3u s\u1ed1 v\u00e0 chu\u1ed7i (trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y c\u00f3 th\u1ec3 \u0111\u1ec3 m\u1eb7c \u0111\u1ecbnh l\u00e0 t\u1eaft v\u00ec ta \u0111ang so s\u00e1nh chu\u1ed7i).<\/p>\n\n\n\n<p>D\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o c\u00f3 tr\u01b0\u1eddng role s\u1ebd \u0111\u01b0\u1ee3c ph\u00e2n h\u01b0\u1edbng v\u1ec1 c\u00e1c nh\u00e1nh t\u01b0\u01a1ng \u1ee9ng:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Output 0 \u2192 n\u1ebfu role = admin<\/li>\n\n\n\n<li>Output 1 \u2192 n\u1ebfu role = editor<\/li>\n\n\n\n<li>Output 2 \u2192 n\u1ebfu role = viewer<\/li>\n<\/ul>\n\n\n\n<p><strong>B\u01b0\u1edbc 5:<\/strong> K\u1ebft n\u1ed1i t\u1eebng nh\u00e1nh c\u1ee7a node Switch \u0111\u1ebfn c\u00e1c node x\u1eed l\u00fd t\u01b0\u01a1ng \u1ee9ng:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Nh\u00e1nh 0 (admin): <\/strong>Th\u00eam node<strong> Gmail -> Send a message<\/strong> g\u1eedi th\u00f4ng b\u00e1o qu\u1ea3n tr\u1ecb.<\/li>\n\n\n\n<li><strong>Nh\u00e1nh 1 (editor): <\/strong>Th\u00eam node <strong>Gmail -> Send a message <\/strong>\u0111\u1ec3 g\u1eedi th\u00f4ng b\u00e1o ch\u1ec9nh s\u1eeda.<\/li>\n\n\n\n<li><strong>Nh\u00e1nh 2 (viewer): <\/strong>Th\u00eam node <strong>Gmail -> Send a message<\/strong> \u0111\u1ec3 g\u1eedi th\u00f4ng b\u00e1o xem.<\/li>\n<\/ul>\n\n\n\n<p>V\u00ed d\u1ee5 v\u1edbi role<strong> editor<\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/AD_4nXcHC4iz3VSLiOQu7QBR3q10CVfc40fKNwRIxRQXhINOGFg4OhGSrN2QcmhHDx6m1sgKBxoDx2Oz6v9WUMvgzyiJztmPfYxv-XwAktkyKkevN-2cPFdC013co_LzauXdw6GJOE46Uwkey6OcID-hSNcVKIsG7ikCJxA.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n\" title=\"\"><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-left\"><span style=\"color: initial; font-size: revert;\">Th\u1ef1c hi\u1ec7n thi\u1ebft l\u1eadp Gmail t\u01b0\u01a1ng t\u1ef1 v\u1edbi c\u00e1c role kh\u00e1c.<\/span><\/p>\n\n\n\n<p><strong>B\u01b0\u1edbc 6: <\/strong>Nh\u1ea5n v\u00e0o n\u00fat \u201c<strong>Test Workflow<\/strong>\u201d \u0111\u1ec3 ch\u1ea1y th\u1eed.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1510\" height=\"795\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-20.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n\" class=\"wp-image-105595\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-20.png 1510w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-20-300x158.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-20-1024x539.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-20-768x404.png 768w\" sizes=\"(max-width: 1510px) 100vw, 1510px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Ki\u1ec3m tra xem email \u0111\u01b0\u1ee3c g\u1eedi \u0111\u00fang theo \u0111i\u1ec1u ki\u1ec7n \u0111\u00e3 thi\u1ebft l\u1eadp.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"896\" height=\"494\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-21.png\" alt=\"C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n\" class=\"wp-image-105596\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-21.png 896w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-21-300x165.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/05\/word-image-105575-21-768x423.png 768w\" sizes=\"(max-width: 896px) 100vw, 896px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00e1ch s\u1eed d\u1ee5ng node Switch trong n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Ngo\u00e0i ra, h\u00e3y th\u1eed \u0111\u1ed5i <strong>value trong node Set <\/strong>\u0111\u1ec3 ti\u1ebfp t\u1ee5c ki\u1ec3m tra.<\/p>\n\n\n\n<h3 id=\"K\u1ebft_lu\u1eadn\"><a id=\"post-105575-_9dxsrij4vhmf\"><\/a><strong>K\u1ebft lu\u1eadn<\/strong><\/h3>\n\n\n\n<p>Hy v\u1ecdng qua b\u00e0i vi\u1ebft tr\u00ean, b\u1ea1n \u0111\u00e3 n\u1eafm \u0111\u01b0\u1ee3c c\u00e1ch s\u1eed d\u1ee5ng IF v\u00e0 Switch m\u1ed9t c\u00e1ch th\u00e0nh th\u1ea1o. N\u1ebfu b\u1ea1n \u0111ang mu\u1ed1n t\u1ef1 \u0111\u1ed9ng h\u00f3a nhi\u1ec1u quy tr\u00ecnh h\u01a1n trong doanh nghi\u1ec7p, \u0111\u1eebng ng\u1ea7n ng\u1ea1i b\u1eaft \u0111\u1ea7u t\u1eeb nh\u1eefng node \u0111i\u1ec1u ki\u1ec7n c\u01a1 b\u1ea3n n\u00e0y! Ch\u00fac b\u1ea1n th\u00e0nh c\u00f4ng!<\/p>\n\n\n\n<h2 id=\"Nh\u1eefng_c\u00e2u_h\u1ecfi_th\u01b0\u1eddng_g\u1eb7p\"><a id=\"post-105575-_q6ie5gjf5mv\"><\/a><strong>Nh\u1eefng c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/strong><\/h2>\n\n\n\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Node_IF_c\u00f3_h\u1ed7_tr\u1ee3_nhi\u1ec1u_\u0111i\u1ec1u_ki\u1ec7n_c\u00f9ng_l\u00fac_kh\u00f4ng?\">Node IF c\u00f3 h\u1ed7 tr\u1ee3 nhi\u1ec1u \u0111i\u1ec1u ki\u1ec7n c\u00f9ng l\u00fac kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>C\u00f3. B\u1ea1n c\u00f3 th\u1ec3 th\u00eam nhi\u1ec1u \u0111i\u1ec1u ki\u1ec7n trong c\u00f9ng m\u1ed9t node IF v\u00e0 k\u1ebft h\u1ee3p b\u1eb1ng to\u00e1n t\u1eed AND ho\u1eb7c OR.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Node_IF_tr\u1ea3_v\u1ec1_d\u1eef_li\u1ec7u_g\u00ec_\u1edf_nh\u00e1nh_True_ho\u1eb7c_False?\">Node IF tr\u1ea3 v\u1ec1 d\u1eef li\u1ec7u g\u00ec \u1edf nh\u00e1nh True ho\u1eb7c False?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>IF s\u1ebd tr\u1ea3 v\u1ec1 d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o c\u1ee7a node, n\u1ebfu \u0111i\u1ec1u ki\u1ec7n \u0111\u01b0\u1ee3c th\u1ecfa m\u00e3n. N\u1ebfu kh\u00f4ng th\u1ecfa m\u00e3n, node \u0111\u00f3 s\u1ebd kh\u00f4ng tr\u1ea3 ra g\u00ec \u1edf nh\u00e1nh \u0111\u00f3.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"C\u00f3_gi\u1edbi_h\u1ea1n_s\u1ed1_l\u01b0\u1ee3ng_nh\u00e1nh_trong_node_Switch_kh\u00f4ng?\">C\u00f3 gi\u1edbi h\u1ea1n s\u1ed1 l\u01b0\u1ee3ng nh\u00e1nh trong node Switch kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Kh\u00f4ng c\u00f3 gi\u1edbi h\u1ea1n c\u1ed1 \u0111\u1ecbnh, nh\u01b0ng n\u00ean gi\u1eef s\u1ed1 nh\u00e1nh h\u1ee3p l\u00fd \u0111\u1ec3 workflow d\u1ec5 qu\u1ea3n l\u00fd. N\u1ebfu qu\u00e1 nhi\u1ec1u, c\u00e2n nh\u1eafc chia nh\u1ecf workflow.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Switch_c\u00f3_th\u1ec3_d\u00f9ng_\u0111\u1ec3_thay_th\u1ebf_IF_kh\u00f4ng?\">Switch c\u00f3 th\u1ec3 d\u00f9ng \u0111\u1ec3 thay th\u1ebf IF kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Trong m\u1ed9t s\u1ed1 tr\u01b0\u1eddng h\u1ee3p, c\u00f3 th\u1ec3 d\u00f9ng Switch thay IF n\u1ebfu b\u1ea1n c\u1ea7n ki\u1ec3m tra nhi\u1ec1u gi\u00e1 tr\u1ecb kh\u00e1c nhau thay v\u00ec ch\u1ec9 True\/False.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Switch_c\u00f3_h\u1ed7_tr\u1ee3_&#039;Default&#039;_khi_kh\u00f4ng_kh\u1edbp_gi\u00e1_tr\u1ecb_n\u00e0o_kh\u00f4ng?\">Switch c\u00f3 h\u1ed7 tr\u1ee3 &#039;Default&#039; khi kh\u00f4ng kh\u1edbp gi\u00e1 tr\u1ecb n\u00e0o kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p>Hi\u1ec7n t\u1ea1i Switch kh\u00f4ng c\u00f3 nh\u00e1nh m\u1eb7c \u0111\u1ecbnh ch\u00ednh th\u1ee9c nh\u01b0 default trong switch-case, nh\u01b0ng b\u1ea1n c\u00f3 th\u1ec3 x\u1eed l\u00fd th\u00eam b\u1eb1ng c\u00e1ch th\u00eam m\u1ed9t IF sau c\u00f9ng \u0111\u1ec3 x\u1eed l\u00fd tr\u01b0\u1eddng h\u1ee3p kh\u00f4ng kh\u1edbp.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\n<script type=\"application\/ld+json\">\n\t{\n\t\t\"@context\": \"https:\/\/schema.org\",\n\t\t\"@type\": \"FAQPage\",\n\t\t\"mainEntity\": [\n\t\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Node IF c\u00f3 h\u1ed7 tr\u1ee3 nhi\u1ec1u \u0111i\u1ec1u ki\u1ec7n c\u00f9ng l\u00fac kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>C\u00f3. B\u1ea1n c\u00f3 th\u1ec3 th\u00eam nhi\u1ec1u \u0111i\u1ec1u ki\u1ec7n trong c\u00f9ng m\u1ed9t node IF v\u00e0 k\u1ebft h\u1ee3p b\u1eb1ng to\u00e1n t\u1eed AND ho\u1eb7c OR.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Node IF tr\u1ea3 v\u1ec1 d\u1eef li\u1ec7u g\u00ec \u1edf nh\u00e1nh True ho\u1eb7c False?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>IF s\u1ebd tr\u1ea3 v\u1ec1 d\u1eef li\u1ec7u \u0111\u1ea7u v\u00e0o c\u1ee7a node, n\u1ebfu \u0111i\u1ec1u ki\u1ec7n \u0111\u01b0\u1ee3c th\u1ecfa m\u00e3n. N\u1ebfu kh\u00f4ng th\u1ecfa m\u00e3n, node \u0111\u00f3 s\u1ebd kh\u00f4ng tr\u1ea3 ra g\u00ec \u1edf nh\u00e1nh \u0111\u00f3.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"C\u00f3 gi\u1edbi h\u1ea1n s\u1ed1 l\u01b0\u1ee3ng nh\u00e1nh trong node Switch kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Kh\u00f4ng c\u00f3 gi\u1edbi h\u1ea1n c\u1ed1 \u0111\u1ecbnh, nh\u01b0ng n\u00ean gi\u1eef s\u1ed1 nh\u00e1nh h\u1ee3p l\u00fd \u0111\u1ec3 workflow d\u1ec5 qu\u1ea3n l\u00fd. N\u1ebfu qu\u00e1 nhi\u1ec1u, c\u00e2n nh\u1eafc chia nh\u1ecf workflow.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Switch c\u00f3 th\u1ec3 d\u00f9ng \u0111\u1ec3 thay th\u1ebf IF kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Trong m\u1ed9t s\u1ed1 tr\u01b0\u1eddng h\u1ee3p, c\u00f3 th\u1ec3 d\u00f9ng Switch thay IF n\u1ebfu b\u1ea1n c\u1ea7n ki\u1ec3m tra nhi\u1ec1u gi\u00e1 tr\u1ecb kh\u00e1c nhau thay v\u00ec ch\u1ec9 True\/False.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Switch c\u00f3 h\u1ed7 tr\u1ee3 'Default' khi kh\u00f4ng kh\u1edbp gi\u00e1 tr\u1ecb n\u00e0o kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Hi\u1ec7n t\u1ea1i Switch kh\u00f4ng c\u00f3 nh\u00e1nh m\u1eb7c \u0111\u1ecbnh ch\u00ednh th\u1ee9c nh\u01b0 default trong switch-case, nh\u01b0ng b\u1ea1n c\u00f3 th\u1ec3 x\u1eed l\u00fd th\u00eam b\u1eb1ng c\u00e1ch th\u00eam m\u1ed9t IF sau c\u00f9ng \u0111\u1ec3 x\u1eed l\u00fd tr\u01b0\u1eddng h\u1ee3p kh\u00f4ng kh\u1edbp.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t]\n\t}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Trong qu\u00e1 tr\u00ecnh x\u00e2y d\u1ef1ng workflow v\u1edbi n8n, vi\u1ec7c x\u1eed l\u00fd c\u00e1c \u0111i\u1ec1u ki\u1ec7n r\u1ebd nh\u00e1nh l\u00e0 y\u1ebfu t\u1ed1 c\u1ef1c k\u1ef3 quan tr\u1ecdng gi\u00fap quy tr\u00ecnh ho\u1ea1t \u0111\u1ed9ng linh ho\u1ea1t h\u01a1n. Hai node th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng nh\u1ea5t \u0111\u1ec3 x\u1eed l\u00fd logic \u0111i\u1ec1u ki\u1ec7n l\u00e0 IF v\u00e0 Switch. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd h\u01b0\u1edbng d\u1eabn chi [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":105576,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7397],"tags":[7343],"class_list":["post-105575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-n8n","tag-n8n"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/105575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=105575"}],"version-history":[{"count":5,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/105575\/revisions"}],"predecessor-version":[{"id":117304,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/105575\/revisions\/117304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/105576"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=105575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/categories?post=105575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=105575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}