{"id":2104,"date":"2026-05-26T08:05:43","date_gmt":"2026-05-26T08:05:43","guid":{"rendered":"https:\/\/www.vpascode.com\/vn\/docs\/uncategorized\/mermaid-js-sequence-diagram-syntax-guide\/"},"modified":"2026-05-26T08:05:43","modified_gmt":"2026-05-26T08:05:43","slug":"mermaid-js-sequence-diagram-syntax-guide","status":"publish","type":"ld_docs","link":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn c\u00fa ph\u00e1p s\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 Mermaid.js"},"content":{"rendered":"<h2>S\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 l\u00e0 g\u00ec?<\/h2>\n<p>M\u1ed9t <strong>S\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1<\/strong> l\u00e0 m\u1ed9t s\u01a1 \u0111\u1ed3 h\u00e0nh vi thi\u1ebft y\u1ebfu <strong>s\u01a1 \u0111\u1ed3 UML<\/strong> \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 tr\u1ef1c quan h\u00f3a lu\u1ed3ng theo th\u1ee9 t\u1ef1 th\u1eddi gian c\u1ee7a c\u00e1c tin nh\u1eafn, l\u1eddi g\u1ecdi h\u00e0m v\u00e0 d\u1eef li\u1ec7u truy\u1ec1n t\u1ea3i gi\u1eefa c\u00e1c th\u1ef1c th\u1ec3 h\u1ec7 th\u1ed1ng kh\u00e1c nhau theo m\u1ed9t d\u00f2ng th\u1eddi gian tuy\u1ebfn t\u00ednh. \u0110\u01b0\u1ee3c c\u00f4ng nh\u1eadn l\u00e0 m\u1ed9t lo\u1ea1i s\u01a1 \u0111\u1ed3 UML c\u1ed1t l\u00f5i,<strong>lo\u1ea1i s\u01a1 \u0111\u1ed3 UML<\/strong>, n\u00f3 m\u00f4 t\u1ea3 c\u00e1c t\u01b0\u01a1ng t\u00e1c t\u1ea1i th\u1eddi \u0111i\u1ec3m ch\u1ea1y b\u1eb1ng c\u00e1ch x\u1ebfp c\u00e1c th\u00e0nh ph\u1ea7n h\u1ec7 th\u1ed1ng d\u1ecdc theo tr\u1ee5c X nh\u01b0 c\u00e1c \u0111\u01b0\u1eddng \u0111\u1eddi d\u1ecdc v\u00e0 theo d\u00f5i c\u00e1c giao ti\u1ebfp tin nh\u1eafn d\u1ecdc theo tr\u1ee5c Y. B\u1ea3n v\u1ebd n\u00e0y v\u00f4 c\u00f9ng qu\u00fd gi\u00e1 \u0111\u1ed1i v\u1edbi c\u00e1c nh\u00e0 ph\u00e1t tri\u1ec3n khi g\u1ee1 l\u1ed7i c\u00e1c thao t\u00e1c trao \u0111\u1ed5i API ph\u00e2n t\u00e1n, c\u00e1c \u0111\u01b0\u1eddng d\u1eabn \u0111i\u1ec1u ph\u1ed1i microservice ho\u1eb7c c\u00e1c lu\u1ed3ng x\u00e1c th\u1ef1c ng\u01b0\u1eddi d\u00f9ng th\u1eddi gian th\u1ef1c.<\/p>\n<p>V\u1edbi <strong>Mermaid.js<\/strong>, b\u1ea1n c\u00f3 th\u1ec3 vi\u1ebft m\u00e3 cho c\u00e1c quy tr\u00ecnh th\u1eddi gian ph\u1ee9c t\u1ea1p b\u1eb1ng c\u1ea5u tr\u00fac v\u0103n b\u1ea3n tr\u1ef1c quan. B\u1ed9 x\u1eed l\u00fd t\u1ef1 \u0111\u1ed9ng x\u1eed l\u00fd kho\u1ea3ng c\u00e1ch d\u1ecdc, qu\u1ea3n l\u00fd c\u0103n ch\u1ec9nh c\u00e1c m\u0169i t\u00ean tin nh\u1eafn v\u00e0 v\u1ebd c\u00e1c kh\u1ed1i k\u00edch ho\u1ea1t t\u1ea1i th\u1eddi \u0111i\u1ec3m ch\u1ea1y m\u1ed9t c\u00e1ch s\u1ea1ch s\u1ebd tr\u00ean b\u1ea3ng v\u1ebd c\u1ee7a b\u1ea1n.<\/p>\n<h2>H\u01b0\u1edbng d\u1eabn c\u00fa ph\u00e1p c\u1ed1t l\u00f5i: C\u00e1c th\u00e0nh ph\u1ea7n v\u00e0 c\u1ea5u tr\u00fac<\/h2>\n<p>\u0110\u1ec3 thi\u1ebft k\u1ebf m\u1ed9t s\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 UML ch\u00ednh x\u00e1c, d\u1ec5 \u0111\u1ecdc, b\u1ea1n ph\u1ea3i th\u00e0nh th\u1ea1o vi\u1ec7c khai b\u00e1o ng\u01b0\u1eddi tham gia, c\u00e1c bi\u1ebfn th\u1ec3 m\u0169i t\u00ean tin nh\u1eafn, c\u00e1c \u0111\u01b0\u1eddng \u0111\u1eddi r\u00f5 r\u00e0ng v\u00e0 c\u00e1c c\u1ea5u tr\u00fac kh\u1ed1i \u0111i\u1ec1u ki\u1ec7n.<\/p>\n<h3>1. Khai b\u00e1o ng\u01b0\u1eddi tham gia v\u00e0 ng\u01b0\u1eddi d\u00f9ng<\/h3>\n<p>B\u1ea1n khai b\u00e1o m\u1ed9t th\u1ef1c th\u1ec3 h\u1ec7 th\u1ed1ng ti\u00eau chu\u1ea9n b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng t\u1eeb kh\u00f3a <code>participant<\/code> t\u1eeb kh\u00f3a. N\u1ebfu th\u1ef1c th\u1ec3 \u0111\u1ea1i di\u1ec7n cho ng\u01b0\u1eddi d\u00f9ng cu\u1ed1i ho\u1eb7c m\u1ed9t ng\u01b0\u1eddi v\u1eadn h\u00e0nh b\u00ean ngo\u00e0i, h\u00e3y s\u1eed d\u1ee5ng t\u1eeb kh\u00f3a <code>actor<\/code> \u0111\u1ec3 hi\u1ec3n th\u1ecb bi\u1ec3u t\u01b0\u1ee3ng h\u00ecnh ng\u01b0\u1eddi \u0111\u01a1n gi\u1ea3n tr\u00ean b\u1ea3ng v\u1ebd:<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgsTkkvwiBeeczNS8EohIQWJRSWZyZkFiXomCY4CnQmKxgntiSWp5YqVCUH5pSWoRAF8GF\/U=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgsTkkvwiBeeczNS8EohIQWJRSWZyZkFiXomCY4CnQmKxgntiSWp5YqVCUH5pSWoRAF8GF\/U=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">sequenceDiagram\r\n    actor Client\r\n    participant API as Gateway Router<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgsTkkvwiBeeczNS8EohIQWJRSWZyZkFiXomCY4CnQmKxgntiSWp5YqVCUH5pSWoRAF8GF\/U=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgsTkkvwiBeeczNS8EohIQWJRSWZyZkFiXomCY4CnQmKxgntiSWp5YqVCUH5pSWoRAF8GF\/U=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"WdDXIln\"><img fetchpriority=\"high\" alt=\"\" class=\"alignnone size-full wp-image-623\" decoding=\"async\" fetchpriority=\"high\" height=\"171\" sizes=\"(max-width: 450px) 100vw, 450px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190364bd762.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190364bd762.png 450w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190364bd762-300x114.png 300w\" width=\"450\"\/><\/p>\n<p><em>M\u1eb9o chuy\u00ean gia:<\/em> S\u1eed d\u1ee5ng t\u1eeb kh\u00f3a <code>as<\/code> \u0111\u1ec3 \u00e1nh x\u1ea1 c\u00e1c t\u00ean th\u00e0nh ph\u1ea7n d\u00e0i th\u00e0nh c\u00e1c bi\u1ec7t danh n\u1ed9i b\u1ed9 ng\u1eafn g\u1ecdn, gi\u00fap c\u00e1c \u0111o\u1ea1n m\u00e3 tin nh\u1eafn c\u1ee7a b\u1ea1n ng\u1eafn g\u1ecdn v\u00e0 d\u1ec5 \u0111\u1ecdc.<\/p>\n<h3>2. \u0110\u1ecbnh d\u1ea1ng m\u0169i t\u00ean tin nh\u1eafn<\/h3>\n<p>Lo\u1ea1i \u0111\u01b0\u1eddng v\u00e0 \u0111\u1ea7u m\u0169i t\u00ean b\u1ea1n s\u1eed d\u1ee5ng s\u1ebd x\u00e1c \u0111\u1ecbnh phong c\u00e1ch giao ti\u1ebfp gi\u1eefa c\u00e1c th\u00e0nh ph\u1ea7n h\u1ec7 th\u1ed1ng c\u1ee7a b\u1ea1n:<\/p>\n<ul>\n<li><code>-&gt;&gt;<\/code> **G\u1ecdi \u0111\u1ed3ng b\u1ed9:** M\u1ed9t \u0111\u01b0\u1eddng li\u1ec1n v\u1edbi \u0111\u1ea7u m\u0169i t\u00ean \u0111\u1ea7y. \u0110\u1ea1i di\u1ec7n cho m\u1ed9t y\u00eau c\u1ea7u ch\u1eb7n, ch\u1edd ho\u00e0n th\u00e0nh th\u1ef1c thi.<\/li>\n<li><code>--&gt;<\/code> **\u0110\u01b0\u1eddng ph\u1ea3n h\u1ed3i:** M\u1ed9t \u0111\u01b0\u1eddng g\u1ea1ch n\u1ed1i v\u1edbi \u0111\u1ea7u m\u0169i t\u00ean h\u1edf. \u0110\u01b0\u1ee3c d\u00f9ng \u0111\u1ec3 tr\u1ea3 v\u1ec1 d\u1eef li\u1ec7u ho\u1eb7c c\u00e1c m\u00e3 x\u00e1c nh\u1eadn.<\/li>\n<li><code>-&gt;<\/code> **G\u1ecdi b\u1ea5t \u0111\u1ed3ng b\u1ed9:** M\u1ed9t \u0111\u01b0\u1eddng li\u1ec1n v\u1edbi \u0111\u1ea7u m\u0169i t\u00ean h\u1edf. Ch\u1ec9 ra m\u1ed9t tin nh\u1eafn ho\u1eb7c ph\u00e1t s\u00f3ng s\u1ef1 ki\u1ec7n kh\u00f4ng ch\u1eb7n.<\/li>\n<\/ul>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAAseCAl07u+DUorLUIiuFIJCS4hKFgMTKnPzEFIgSiKSurh1QrZWCkYGBgr83UGVxQX5ecSoAn9Ua8A==\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAAseCAl07u+DUorLUIiuFyMOrShWSH+5aXqqQ8nD3eoWczIe720shKiFqdHXtgFqsFAIyHu5anKeQ8XD35EwFIwMDBX9vAMV2JCM=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">sequenceDiagram\r\n    App-&gt;&gt;Server: Y\u00eau c\u1ea7u d\u1eef li\u1ec7u\r\n    Server--&gt;App: Ph\u1ea3n h\u1ed3i 200 OK<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAAseCAl07u+DUorLUIiuFyMOrShWSH+5aXqqQ8nD3eoWczIe720shKiFqdHXtgFqsFAIyHu5anKeQ8XD35EwFIwMDBX9vAMV2JCM=\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAAseCAl07u+DUorLUIiuFIJCS4hKFgMTKnPzEFIgSiKSurh1QrZWCkYGBgr83UGVxQX5ecSoAn9Ua8A==\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"jLtFHya\"><img alt=\"\" class=\"alignnone size-full wp-image-624\" decoding=\"async\" height=\"267\" sizes=\"(max-width: 450px) 100vw, 450px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190369d9ad7.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190369d9ad7.png 450w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190369d9ad7-300x178.png 300w\" width=\"450\"\/><\/p>\n<h3>3. Qu\u1ea3n l\u00fd thanh k\u00edch ho\u1ea1t lu\u1ed3ng s\u1ed1ng<\/h3>\n<p>\u0110\u1ec3 hi\u1ec3n th\u1ecb ch\u00ednh x\u00e1c th\u1eddi \u0111i\u1ec3m m\u1ed9t th\u00e0nh ph\u1ea7n h\u1ec7 th\u1ed1ng \u0111ang th\u1ef1c thi nhi\u1ec7m v\u1ee5 ho\u1eb7c chi\u1ebfm d\u1ee5ng b\u1ed9 nh\u1edb lu\u1ed3ng, h\u00e3y s\u1eed d\u1ee5ng l\u1ec7nh<code>activate<\/code> v\u00e0 <code>deactivate<\/code> \u0111\u1ec3 th\u1ef1c hi\u1ec7n. Thay v\u00e0o \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 th\u00eam d\u1ea5u c\u1ed9ng (<code>+<\/code>) ho\u1eb7c d\u1ea5u tr\u1eeb (<code>-<\/code>) tr\u1ef1c ti\u1ebfp v\u00e0o m\u1ee5c ti\u00eau tin nh\u1eafn nh\u01b0 m\u1ed9t c\u00e1ch nhanh ch\u00f3ng \u0111\u1ec3 hi\u1ec3n th\u1ecb tr\u1ef1c quan:<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNolzDEKwzAMBdC90DtoyVR8gQxekgOU5ATCfILAcagku\/T2Degvf\/iPb\/h0tIJV+FA+nw+6s1RB85Tza4cO6ExvvQrMaGXnMNNEMZIYtetLQ6xzrT\/i4jIQKkhKOcXnTBu8a7vLenX7AzPwKV4=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNoljiEOwkAQRT0Jd\/imiuwFKmqoQ4LAbppN26QM6bKtJxUIFBIHqSaA7YQgINxjbsLCjhjx8uZlNqZuDGUmLXVu9Wo8gp9pVRpyKkkmc2NbY2MshS+oXg+kwldUpfCuCW4UIUgofpTwPmjK\/f7chPvsTzuCK4T3cFb4nqFuNPnaCcVahrPzsvCR8hAMNaUSFd6IsbAy9GiFt5jJ8HT+3oMvpzJPxg==\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">sequenceDiagram\r\n    Client-&gt;&gt;+Server: X\u1eed l\u00fd D\u1eef li\u1ec7u\r\n    %% Server hi\u1ec7n \u0111ang \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb tr\u1ef1c quan l\u00e0 ho\u1ea1t \u0111\u1ed9ng\r\n    Server--&gt;-Client: Tr\u1ea3 v\u1ec1 K\u1ebft qu\u1ea3<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNoljiEOwkAQRT0Jd\/imiuwFKmqoQ4LAbppN26QM6bKtJxUIFBIHqSaA7YQgINxjbsLCjhjx8uZlNqZuDGUmLXVu9Wo8gp9pVRpyKkkmc2NbY2MshS+oXg+kwldUpfCuCW4UIUgofpTwPmjK\/f7chPvsTzuCK4T3cFb4nqFuNPnaCcVahrPzsvCR8hAMNaUSFd6IsbAy9GiFt5jJ8HT+3oMvpzJPxg==\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNolzDEKwzAMBdC90DtoyVR8gQxekgOU5ATCfILAcagku\/T2Degvf\/iPb\/h0tIJV+FA+nw+6s1RB85Tza4cO6ExvvQrMaGXnMNNEMZIYtetLQ6xzrT\/i4jIQKkhKOcXnTBu8a7vLenX7AzPwKV4=\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"cOetWMX\"><img alt=\"\" class=\"alignnone size-full wp-image-625\" decoding=\"async\" height=\"267\" sizes=\"(max-width: 450px) 100vw, 450px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19036e236c9.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19036e236c9.png 450w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19036e236c9-300x178.png 300w\" width=\"450\"\/><\/p>\n<h3>4. C\u1ea5u tr\u00fac c\u00e1c \u0111i\u1ec1u ki\u1ec7n v\u00e0 l\u1ef1a ch\u1ecdn thay th\u1ebf (Alt, Opt, Loop)<\/h3>\n<p>\u0110\u1ec3 x\u1eed l\u00fd logic ch\u1ea1y \u0111i\u1ec1u ki\u1ec7n nh\u00e1nh, \u0111\u00e1nh gi\u00e1 token ho\u1eb7c th\u1eed l\u1ea1i y\u00eau c\u1ea7u l\u1eb7p l\u1ea1i, h\u00e3y bao b\u1ecdc c\u00e1c \u0111o\u1ea1n m\u00e3 tin nh\u1eafn b\u00ean trong c\u00e1c kh\u1ed1i chu\u1ea9n:<\/p>\n<ul>\n<li><code>alt \/ else<\/code> \u2014 \u0110\u00e1nh gi\u00e1 c\u00e1c nh\u00e1nh \u0111i\u1ec1u ki\u1ec7n (gi\u1ed1ng nh\u01b0 kh\u1ed1i m\u00e3 if\/else).<\/li>\n<li><code>opt<\/code> \u2014 X\u00e1c \u0111\u1ecbnh m\u1ed9t b\u01b0\u1edbc t\u00f9y ch\u1ecdn ch\u1ec9 th\u1ef1c thi khi \u0111\u00e1p \u1ee9ng c\u00e1c ti\u00eau ch\u00ed c\u1ee5 th\u1ec3.<\/li>\n<li><code>v\u00f2ng l\u1eb7p<\/code>\u2014 L\u1eb7p l\u1ea1i m\u1ed9t chu\u1ed7i th\u1ef1c thi cho \u0111\u1ebfn khi \u0111i\u1ec1u ki\u1ec7n \u0111\u01b0\u1ee3c th\u1ecfa m\u00e3n.<\/li>\n<\/ul>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgpz8\/AIF17LUokoFYwOF4tTk\/LyUYogUCDjnZKbmleja2QWnFgEVWSl4pCYWlSSlJpYoBGTmpUMUpualAABAyxwZ\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgrLDm\/LSFXIe7tpeoOD7cPf0TAVjA4X0zMOLKiHyIOCck5maV6JrZxecWlSWWmSlEJAJ1JOX8XB3d4FCSSbUpNS8FADoKyJR\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">sequenceDiagram\r\n    v\u00f2ng l\u1eb7p M\u1ed7i 30 gi\u00e2y\r\n        Client-&gt;&gt;Server: Ping nh\u1ecbp tim\r\n    end<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgrLDm\/LSFXIe7tpeoOD7cPf0TAVjA4X0zMOLKiHyIOCck5maV6JrZxecWlSWWmSlEJAJ1JOX8XB3d4FCSSbUpNS8FADoKyJR\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNorTi0sTc1LTnXJTEwvSszl5VIAgpz8\/AIF17LUokoFYwOF4tTk\/LyUYogUCDjnZKbmleja2QWnFgEVWSl4pCYWlSSlJpYoBGTmpUMUpualAABAyxwZ\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"VlRPVlQ\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-626\" decoding=\"async\" height=\"274\" loading=\"lazy\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190372961a2.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190372961a2.png 450w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a190372961a2-300x183.png 300w\" width=\"450\"\/><\/p>\n<h2>C\u00e1c th\u1ef1c h\u00e0nh t\u1ed1t nh\u1ea5t cho c\u00e1c d\u00f2ng th\u1eddi gian chu\u1ed7i r\u00f5 r\u00e0ng<\/h2>\n<ul>\n<li><strong>Gi\u1eef c\u00e1c \u0111\u01b0\u1eddng s\u1ed1ng kh\u00f4ng b\u1ecb r\u1ed1i:<\/strong>Tr\u00e1nh li\u1ec7t k\u00ea h\u00e0ng ch\u1ee5c sinh th\u1ec3 vi m\u00f4 d\u1ecdc theo tr\u1ee5c X. N\u1ebfu m\u1ed9t quy tr\u00ecnh t\u01b0\u01a1ng t\u00e1c v\u1edbi c\u00e1c l\u1edbp tr\u1ee3 gi\u00fap nh\u1ecf, h\u00e3y tr\u1eebu t\u01b0\u1ee3ng ch\u00fang ph\u00eda sau ranh gi\u1edbi h\u1ec7 th\u1ed1ng c\u1ea5p cao nh\u01b0<code>[Auth Worker]<\/code> ho\u1eb7c <code>[Cache Pool]<\/code>.<\/li>\n<li><strong>G\u1eafn nh\u00e3n m\u00e3 tr\u1ea1ng th\u00e1i m\u1ed9t c\u00e1ch r\u00f5 r\u00e0ng:<\/strong> Khi vi\u1ebft c\u00e1c ph\u1ea3n h\u1ed3i tr\u1ea3 v\u1ec1 (<code>--&gt;<\/code>), \u0111\u1eebng ch\u1ec9 vi\u1ebft \u201cTr\u1ea3 v\u1ec1 D\u1eef li\u1ec7u\u201d. G\u1eafn nh\u00e3n cho \u0111\u01b0\u1eddng \u0111i b\u1eb1ng c\u00e1c m\u00e3 tr\u1ea1ng th\u00e1i HTTP r\u00f5 r\u00e0ng ho\u1eb7c lo\u1ea1i s\u1ef1 ki\u1ec7n (v\u00ed d\u1ee5 nh\u01b0<code>\"201 T\u1ea1o th\u00e0nh c\u00f4ng (JWT Token)\"<\/code>) \u0111\u1ec3 cung c\u1ea5p cho c\u00e1c k\u1ef9 s\u01b0 b\u1ed1i c\u1ea3nh ch\u00ednh x\u00e1c.<\/li>\n<li><strong>Th\u1ef1c hi\u1ec7n ghi ch\u00fa cho c\u00e1c ph\u00e9p t\u00ednh ph\u1ee9c t\u1ea1p:<\/strong> S\u1eed d\u1ee5ng l\u1ec7nh<code>Note over<\/code>, <code>Note left of<\/code>, ho\u1eb7c <code>Note right of<\/code> \u0111\u1ec3 ghi ch\u00fa cho c\u00e1c thao t\u00e1c kh\u00f4ng tr\u1ef1c quan, nh\u01b0 c\u00e1c b\u01b0\u1edbc m\u00e3 h\u00f3a n\u1ed9i b\u1ed9 ho\u1eb7c b\u0103m d\u1eef li\u1ec7u c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n<\/ul>\n<h2>C\u00e1c v\u00ed d\u1ee5 v\u1ec1 s\u01a1 \u0111\u1ed3 chu\u1ed7i Mermaid.js trong th\u1ebf gi\u1edbi th\u1ef1c<\/h2>\n<h3>V\u00ed d\u1ee5 1: Lu\u1ed3ng trao \u0111\u1ed5i token OAuth2 b\u1ea3o m\u1eadt (Kh\u1ed1i k\u00edch ho\u1ea1t v\u00e0 kh\u1ed1i thay th\u1ebf)<\/h3>\n<p>B\u1ea3n thi\u1ebft k\u1ebf ch\u1ee9c n\u0103ng n\u00e0y m\u00f4 ph\u1ecfng m\u1ed9t chu\u1ed7i \u0111\u0103ng nh\u1eadp ng\u01b0\u1eddi d\u00f9ng an to\u00e0n. N\u00f3 minh h\u1ecda c\u00e1ch k\u1ebft h\u1ee3p c\u00e1c nh\u00e2n v\u1eadt con ng\u01b0\u1eddi, c\u00e1c \u0111\u01b0\u1eddng s\u1ed1ng h\u1ec7 th\u1ed1ng r\u00f5 r\u00e0ng, v\u00e0 c\u00e1c \u0111\u01b0\u1eddng \u0111i x\u00e1c th\u1ef1c ph\u1ee9c t\u1ea1p b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng kh\u1ed1i alt\/else.<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNptUstOAjEU3Zv4DzcsjMYQ8bFiQTJBEjAaCYguzaW9MA0z7XjbAfXr7WNIBnA208d59bSWvmrSgh4VrhnL8zPwHwpnGBaWGNDCSMs4TnsVslNCVagdZFUVAC9mqQqKs2GhSLt\/kLXLAzT8ezCRHqTcD0zZbJUM0okSbLqDwbWX6gctsYHOs1krDTvlBV4DvZOgHhKRfqUPM5KKSbgEEzHEp5JwAVaYihqGh3Y9J5gEivbGkNQn2hGvUNBBjKQ9r5elcjBkiqmxsAnUEt1D37FQEh3BFK3dGZYwRpu34VgcKEHGlFhpux0zdnDfuzs6XGxyaCS1GLGKFGH0LXLUa4oQWPlrzIQga+HNbEifunSjzYxczRqePt4SDi4nMg6uDl2O24tPxBuY2t\/x2JRNKCos+U634WCnxZ0csnF\/6N3CQqPfMax+ScKI2fBJgG5KMM\/NDjp7k7CmsaSbffMdyAri5iX6sH\/tqOE0\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNqFk89q20AQxu+BvMPgQ2kJpu6fkw+B0ELbhLYXlfQW1qtFWmytFGlV6mPwoYde6kMJpRQSTAgJBBLIpd7jir7HvklntDasG4f6IGnl7zffN7OrShzWQnHxUrKkZNnmBuCPcZ2X8KESJbAK3iV\/rp35JSG2v1UCvHZmKr2wYKWWXBZMadgpClLvpfaUp5DaE9Q6c4HX2Jkzuklops78UMkauNZp64UcOpCNm58V8BmLgU6dueGtpre54WEK193e3kLXPlIoVtBpvjUTRBUurwoYuPkNrt4T1\/EUqlsI3\/ThRVqPnZkoSKm\/nyj9hDcJfCSF0gcyhgdQ8bwQCxahLtLk3IfXskUp2ldIJMuxPWe+KGwxyLCS1bu+cuZKImdvUaXlWiAwXGIfaRCZVClkdgaDZpJBhoCGIXIXdcixkYbonvqAeWcFjDCqF4edtbO8O5VnvaeLyZB1sCNBhXauPmlU4jBoo797gB4n3l61L3RZj2l7l92GEbpthqh08xl5HoHOh0LB7n4ED9\/EES0erdqu3xFdMjpD+HwO2p5IHFOONRWolcPsS4lRJe6f2ND\/8d\/BBaFRdSzhee8JfQ0EN1NynXH8IM7HcEgTPlJ3+uiua8QXGNjTHDqRvfy3g8dvg1OwzNpM7VwlizMvVPwX0mKNpQ==\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">sequenceDiagram\r\n    actor User as Ng\u01b0\u1eddi d\u00f9ng cu\u1ed1i\r\n    participant App as Kh\u00e1ch h\u00e0ng \u1ee9ng d\u1ee5ng di \u0111\u1ed9ng\r\n    participant Auth as Nh\u00e0 cung c\u1ea5p x\u00e1c th\u1ef1c Auth0\r\n\r\n    User-&gt;&gt;+App: Nh\u1ea5n \"\u0110\u0103ng nh\u1eadp b\u1eb1ng OAuth\"\r\n    App-&gt;&gt;+Auth: Chuy\u1ec3n h\u01b0\u1edbng v\u1edbi client_id &amp; scope\r\n    Auth--&gt;&gt;User: Hi\u1ec3n th\u1ecb giao di\u1ec7n \u0111\u0103ng nh\u1eadp\r\n    User-&gt;&gt;Auth: G\u1eedi th\u00f4ng tin \u0111\u0103ng nh\u1eadp\r\n    \r\n    Auth-&gt;&gt;Auth: X\u00e1c minh m\u00e3 b\u0103m m\u1eadt kh\u1ea9u\r\n    \r\n    alt Th\u00f4ng tin \u0111\u0103ng nh\u1eadp h\u1ee3p l\u1ec7\r\n        Auth--&gt;&gt;App: Chuy\u1ec3n h\u01b0\u1edbng 302 v\u1edbi m\u00e3 x\u00e1c th\u1ef1c\r\n        App-&gt;&gt;Auth: Trao \u0111\u1ed5i m\u00e3 \u0111\u1ec3 nh\u1eadn m\u00e3 truy c\u1eadp\r\n        Auth--&gt;&gt;-App: Tr\u1ea3 v\u1ec1 token JWT (IdToken)\r\n        App--&gt;&gt;User: Hi\u1ec3n th\u1ecb trang ch\u1ee7 t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng\r\n    else Th\u00f4ng tin \u0111\u0103ng nh\u1eadp kh\u00f4ng h\u1ee3p l\u1ec7\r\n        Auth--&gt;&gt;App: Tr\u1ea3 v\u1ec1 l\u1ed7i 401 Kh\u00f4ng \u0111\u01b0\u1ee3c \u1ee7y quy\u1ec1n\r\n        App--&gt;&gt;-User: Hi\u1ec3n th\u1ecb th\u00f4ng b\u00e1o \"T\u00ean ng\u01b0\u1eddi d\u00f9ng\/M\u1eadt kh\u1ea9u kh\u00f4ng \u0111\u00fang\"\r\n    end<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNqFk89q20AQxu+BvMPgQ2kJpu6fkw+B0ELbhLYXlfQW1qtFWmytFGlV6mPwoYde6kMJpRQSTAgJBBLIpd7jir7HvklntDasG4f6IGnl7zffN7OrShzWQnHxUrKkZNnmBuCPcZ2X8KESJbAK3iV\/rp35JSG2v1UCvHZmKr2wYKWWXBZMadgpClLvpfaUp5DaE9Q6c4HX2Jkzuklops78UMkauNZp64UcOpCNm58V8BmLgU6dueGtpre54WEK193e3kLXPlIoVtBpvjUTRBUurwoYuPkNrt4T1\/EUqlsI3\/ThRVqPnZkoSKm\/nyj9hDcJfCSF0gcyhgdQ8bwQCxahLtLk3IfXskUp2ldIJMuxPWe+KGwxyLCS1bu+cuZKImdvUaXlWiAwXGIfaRCZVClkdgaDZpJBhoCGIXIXdcixkYbonvqAeWcFjDCqF4edtbO8O5VnvaeLyZB1sCNBhXauPmlU4jBoo797gB4n3l61L3RZj2l7l92GEbpthqh08xl5HoHOh0LB7n4ED9\/EES0erdqu3xFdMjpD+HwO2p5IHFOONRWolcPsS4lRJe6f2ND\/8d\/BBaFRdSzhee8JfQ0EN1NynXH8IM7HcEgTPlJ3+uiua8QXGNjTHDqRvfy3g8dvg1OwzNpM7VwlizMvVPwX0mKNpQ==\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNptUstOAjEU3Zv4DzcsjMYQ8bFiQTJBEjAaCYguzaW9MA0z7XjbAfXr7WNIBnA208d59bSWvmrSgh4VrhnL8zPwHwpnGBaWGNDCSMs4TnsVslNCVagdZFUVAC9mqQqKs2GhSLt\/kLXLAzT8ezCRHqTcD0zZbJUM0okSbLqDwbWX6gctsYHOs1krDTvlBV4DvZOgHhKRfqUPM5KKSbgEEzHEp5JwAVaYihqGh3Y9J5gEivbGkNQn2hGvUNBBjKQ9r5elcjBkiqmxsAnUEt1D37FQEh3BFK3dGZYwRpu34VgcKEHGlFhpux0zdnDfuzs6XGxyaCS1GLGKFGH0LXLUa4oQWPlrzIQga+HNbEifunSjzYxczRqePt4SDi4nMg6uDl2O24tPxBuY2t\/x2JRNKCos+U634WCnxZ0csnF\/6N3CQqPfMax+ScKI2fBJgG5KMM\/NDjp7k7CmsaSbffMdyAri5iX6sH\/tqOE0\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"zhyELct\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-627\" decoding=\"async\" height=\"829\" loading=\"lazy\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903768417b.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903768417b.png 939w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903768417b-300x265.png 300w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a1903768417b-768x678.png 768w\" width=\"939\"\/><\/p>\n<p><strong>Ph\u00e2n t\u00edch c\u00fa ph\u00e1p:<\/strong> D\u00f2ng th\u1eddi gian n\u00e0y theo d\u00f5i qu\u00e1 tr\u00ecnh trao \u0111\u1ed5i gi\u1eefa nhi\u1ec1u b\u00ean. C\u00e1c <code>alt \/ else<\/code> kh\u1ed1i ch\u1ee9a n\u00e0y minh h\u1ecda r\u00f5 r\u00e0ng c\u00e1c \u0111\u01b0\u1eddng \u0111i x\u00e1c th\u1ef1c nh\u1ecb ph\u00e2n, \u0111\u1ea3m b\u1ea3o c\u00e1c tr\u1ea1ng th\u00e1i l\u1ed7i \u0111\u01b0\u1ee3c ghi ch\u00e9p \u0111\u1ea7y \u0111\u1ee7 c\u00f9ng v\u1edbi \u0111\u01b0\u1eddng \u0111i th\u00e0nh c\u00f4ng.<\/p>\n<h3>V\u00ed d\u1ee5 2: Thanh to\u00e1n kho h\u00e0ng \u0111\u01a1n h\u00e0ng ph\u00e2n t\u00e1n (Quy tr\u00ecnh song song v\u00e0 Ghi ch\u00fa)<\/h3>\n<p>B\u1ea3n thi\u1ebft k\u1ebf h\u1ec7 th\u1ed1ng n\u00e2ng cao n\u00e0y m\u00f4 t\u1ea3 \u0111\u01b0\u1eddng d\u1eabn thanh to\u00e1n th\u01b0\u01a1ng m\u1ea1i \u0111i\u1ec7n t\u1eed doanh nghi\u1ec7p. N\u00f3 s\u1eed d\u1ee5ng c\u00e1c kh\u1ed1i song song (<code>par<\/code>) \u0111\u1ec3 hi\u1ec3n th\u1ecb c\u00e1c tr\u00ecnh t\u1ef1 g\u1eedi API \u0111\u1ed3ng th\u1eddi v\u00e0 x\u1eed l\u00fd c\u00e1c ghi ch\u00fa kh\u00f3a c\u01a1 s\u1edf d\u1eef li\u1ec7u tr\u00ean to\u00e0n b\u1ed9 ki\u1ebfn tr\u00fac.<\/p>\n<div class=\"vpascode-viewer-container vpascode-fancy-active\">\n<div class=\"vpascode-header\">\n<span class=\"vpascode-lang-label\">Mermaid<\/span><br \/>\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNplkUFrwkAQhe+C\/2GOliJIjx4EibUIpRWF9jxuJsniJpvOTmzTX99ZF43UPexC8s3Me28CfXXUGFpZLBnr8Qj0tMhijW2xEfikA2A4P2v2jVCT30PvnEdIH2K9TUVBGMXzPbppThHVhxoFetgTn6yhe3KLfST1qRWFFxT6xn48SqQKmi4WjzpyDvvuUFuBrCJz9J3ALpoKksA3LwT+dBam7AexLXrYCNWwF2+OsDyhdXiwzkqfSq5aYGVDi2IqyHxjOuYoZLndQIbOhYTFo52jGDU1h9fYc7AXB92Q+mM6XUzPUgZoR0FToBwmSVLsQflDKsNL4jeTNJQ5LDupPNtfgowpjwGg7iGrkEsaKhS9TsywlY5JAzOGQig6B5PE6xpE3HXmdcvp9q2ug32sgaVz3qBY38Bag7vxdk6abVkJ+CKl\/fxDpotfvXMHVGcBSwRbqKkejIYIxdDj39BoVYXroufwNJtdRA9r1p0UlmvK\/wCHINpF\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 8px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<div class=\"vpascode-code-wrapper\">\n            <div class=\"vpascode-viewer-container vpascode-fancy-active\">\r\n                                <div class=\"vpascode-header\">\r\n                    <span class=\"vpascode-lang-label\">Mermaid<\/span>\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1ksFrE0EUxu+F\/g\/vWJGF4jGHgFoIpaAVCnqd7K47Q+zMupmN5igePIhgkR48CI2hFMViS724c\/Awof\/H\/Cd+bzdJN6bOIexu3ve+3\/veDNOXZarjdEeJrBCHmxuEk4vCqljlQlt6mvZJDKmnhKFEBfdOk86uL4L7oijxv3VGr9L+uuxxkbDsQXCfaXYE3ZuSchnckcLr9UST9Cc6W9ft6hHrdoJ7H0saBXdKA2n+V70vxlz9MLhjgFgptCRr\/ERvbjTFoI+63bug6VAvuHNFY\/+9pDhUZ+VqPVc\/MjYlM0oLqgXP\/CSmQ4WagQzVlPTsLbsE90nXUEN81DxV9W0e3JJwbhZzhxd1VllwHxTd39\/F\/NyBcfmPRsIHnsyKBDq0J\/2VaORtF7a9EaAyirpRzbq3CAnt\/ZQzxoqmMWWI\/idtHSyh+0gWD2h\/p+kkdLLGgFzn42v4nut2VMxdObIenxPsZ7EXPtAtiXpS3ahBJjHOL\/BtNVepWfAqbMtlDpcu4Jpfk1t6Uo7JFv4HKnPpv2qe6LiGOrV4riatSOuFFiqTlszzZqkHSP0yJtlc5aHIBEkDPAzE44bqT8ld0GsQ3NXK8rQ\/MbcY\/cPIESID3LwO3dvehmFr+IhmHzHx69uj\/QsT52TG\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 8px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n                                <div class=\"vpascode-code-wrapper\">\r\n                    <pre class=\"lang-mermaid\"><code class=\"language-mermaid\" data-language=\"mermaid\" class=\"language-mermaid\">sequenceDiagram\r\n    participant Web as Giao di\u1ec7n ng\u01b0\u1eddi d\u00f9ng web\r\n    participant Ord as B\u1ed9 \u0111i\u1ec1u ph\u1ed1i \u0111\u01a1n h\u00e0ng\r\n    participant Inv as D\u1ecbch v\u1ee5 kho h\u00e0ng\r\n    participant Pay as C\u1ed5ng thanh to\u00e1n\r\n\r\n    Web-&gt;&gt;+Ord: G\u1eedi y\u00eau c\u1ea7u thanh to\u00e1n\r\n    Note over Ord: X\u00e1c minh kh\u1ea3 n\u0103ng t\u1ed3n kho s\u1ea3n ph\u1ea9m\r\n    \r\n    par G\u1eedi c\u00e1c l\u1eddi g\u1ecdi API \u0111\u1ed3ng th\u1eddi\r\n        Ord-&gt;&gt;+Inv: Kh\u00f3a c\u00e1c s\u1ea3n ph\u1ea9m kho\r\n        Inv--&gt;-Ord: Kho h\u00e0ng \u0111\u00e3 \u0111\u01b0\u1ee3c gi\u1eef (T\u1ed3n kho b\u1ecb kh\u00f3a)\r\n    and\r\n        Ord-&gt;&gt;+Pay: X\u00e1c nh\u1eadn thanh to\u00e1n th\u1ebb t\u00edn d\u1ee5ng\r\n        Pay--&gt;-Ord: Ghi nh\u1eadn th\u00e0nh c\u00f4ng (Giao d\u1ecbch \u0111\u00e3 \u0111\u01b0\u1ee3c thanh to\u00e1n)\r\n    end\r\n    \r\n    opt Quy tr\u00ecnh ph\u00e2n b\u1ed5 th\u1ea5t b\u1ea1i\r\n        Note right of Ord: Th\u1ef1c hi\u1ec7n saga ho\u00e0n t\u00e1c n\u1ebfu b\u1ea5t k\u1ef3 l\u1eddi g\u1ecdi n\u00e0o th\u1ea5t b\u1ea1i\r\n    end\r\n    \r\n    Ord--&gt;-Web: 200 Th\u00e0nh c\u00f4ng - \u0110\u00e3 x\u00e1c nh\u1eadn thanh to\u00e1n<\/code><\/pre>                <\/div>\r\n                <div class=\"vpascode-actions\">\r\n                    <a href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNp1ksFrE0EUxu+F\/g\/vWJGF4jGHgFoIpaAVCnqd7K47Q+zMupmN5igePIhgkR48CI2hFMViS724c\/Awof\/H\/Cd+bzdJN6bOIexu3ve+3\/veDNOXZarjdEeJrBCHmxuEk4vCqljlQlt6mvZJDKmnhKFEBfdOk86uL4L7oijxv3VGr9L+uuxxkbDsQXCfaXYE3ZuSchnckcLr9UST9Cc6W9ft6hHrdoJ7H0saBXdKA2n+V70vxlz9MLhjgFgptCRr\/ERvbjTFoI+63bug6VAvuHNFY\/+9pDhUZ+VqPVc\/MjYlM0oLqgXP\/CSmQ4WagQzVlPTsLbsE90nXUEN81DxV9W0e3JJwbhZzhxd1VllwHxTd39\/F\/NyBcfmPRsIHnsyKBDq0J\/2VaORtF7a9EaAyirpRzbq3CAnt\/ZQzxoqmMWWI\/idtHSyh+0gWD2h\/p+kkdLLGgFzn42v4nut2VMxdObIenxPsZ7EXPtAtiXpS3ahBJjHOL\/BtNVepWfAqbMtlDpcu4Jpfk1t6Uo7JFv4HKnPpv2qe6LiGOrV4riatSOuFFiqTlszzZqkHSP0yJtlc5aHIBEkDPAzE44bqT8ld0GsQ3NXK8rQ\/MbcY\/cPIESID3LwO3dvehmFr+IhmHzHx69uj\/QsT52TG\" \r\n                       target=\"_blank\" \r\n                       rel=\"noopener noreferrer\" \r\n                       class=\"vpascode-fancy-btn\">\r\n                        <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"margin-right: 6px;\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg>\r\n                        <span>Edit Mermaid in VPasCode<\/span>\r\n                    <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            \n<\/p><\/div>\n<div class=\"vpascode-actions\">\n<a class=\"vpascode-fancy-btn\" href=\"https:\/\/www.vpascode.com\/editor\/#mermaid:eNplkUFrwkAQhe+C\/2GOliJIjx4EibUIpRWF9jxuJsniJpvOTmzTX99ZF43UPexC8s3Me28CfXXUGFpZLBnr8Qj0tMhijW2xEfikA2A4P2v2jVCT30PvnEdIH2K9TUVBGMXzPbppThHVhxoFetgTn6yhe3KLfST1qRWFFxT6xn48SqQKmi4WjzpyDvvuUFuBrCJz9J3ALpoKksA3LwT+dBam7AexLXrYCNWwF2+OsDyhdXiwzkqfSq5aYGVDi2IqyHxjOuYoZLndQIbOhYTFo52jGDU1h9fYc7AXB92Q+mM6XUzPUgZoR0FToBwmSVLsQflDKsNL4jeTNJQ5LDupPNtfgowpjwGg7iGrkEsaKhS9TsywlY5JAzOGQig6B5PE6xpE3HXmdcvp9q2ug32sgaVz3qBY38Bag7vxdk6abVkJ+CKl\/fxDpotfvXMHVGcBSwRbqKkejIYIxdDj39BoVYXroufwNJtdRA9r1p0UlmvK\/wCHINpF\" rel=\"noopener noreferrer\" target=\"_blank\"><br \/>\n<svg fill=\"none\" height=\"14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2.5\" style=\"margin-right: 6px;\" viewbox=\"0 0 24 24\" width=\"14\"><path d=\"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\"><\/path><path d=\"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z\"><\/path><\/svg><br \/>\n<span>Ch\u1ec9nh s\u1eeda Mermaid trong VPasCode<\/span><br \/>\n<\/a>\n<\/div>\n<\/div>\n<p id=\"DDTNVua\"><img loading=\"lazy\" alt=\"\" class=\"alignnone size-full wp-image-628\" decoding=\"async\" height=\"692\" loading=\"lazy\" sizes=\"auto, (max-width: 1090px) 100vw, 1090px\" src=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19037c84393.png\" srcset=\"https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19037c84393.png 1090w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19037c84393-300x190.png 300w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19037c84393-1024x650.png 1024w, https:\/\/www.vpascode.com\/wp-content\/uploads\/2026\/05\/img_6a19037c84393-768x488.png 768w\" width=\"1090\"\/><\/p>\n<p><strong>Ph\u00e2n t\u00edch c\u00fa ph\u00e1p:<\/strong> Kh\u1ed1i <code>par \/ and<\/code> kh\u1ed1i ch\u1ee9a n\u00e0y h\u01b0\u1edbng d\u1eabn \u0111\u1ed9ng c\u01a1 nh\u00f3m c\u00e1c thao t\u00e1c song song l\u1ea1i v\u1edbi nhau, ghi l\u1ea1i c\u00e1c thao t\u00e1c n\u1ec1n \u0111\u1ed3ng th\u1eddi. C\u00e1c th\u1ebb <code>Note over<\/code> v\u00e0 <code>Note right of<\/code> s\u1ebd ch\u00e8n c\u00e1c gi\u1ea3i th\u00edch k\u1ef9 thu\u1eadt t\u1ea1i th\u1eddi \u0111i\u1ec3m ch\u1ea1y tr\u1ef1c ti\u1ebfp v\u00e0o l\u01b0\u1edbi b\u1ea3ng v\u1ebd, gi\u00fap c\u00e1c \u0111\u1ed9i hi\u1ec3u r\u00f5 c\u00e1c giao d\u1ecbch n\u1ec1n nh\u01b0 kh\u00f3a d\u1eef li\u1ec7u v\u00e0 saga ho\u00e0n t\u00e1c m\u00e0 kh\u00f4ng l\u00e0m r\u1ed1i c\u00e1c m\u0169i t\u00ean tin nh\u1eafn ch\u00ednh.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>S\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 l\u00e0 g\u00ec? M\u1ed9t S\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 l\u00e0 m\u1ed9t s\u01a1 \u0111\u1ed3 h\u00e0nh vi thi\u1ebft y\u1ebfu s\u01a1 \u0111\u1ed3 UML \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf \u0111\u1ec3 tr\u1ef1c quan h\u00f3a lu\u1ed3ng theo th\u1ee9 t\u1ef1 th\u1eddi gian c\u1ee7a c\u00e1c tin nh\u1eafn, l\u1eddi&#8230;<\/p>\n","protected":false},"author":4,"featured_media":2105,"parent":0,"menu_order":3,"template":"","meta":{"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}}},"ld_collection":[14],"class_list":["post-2104","ld_docs","type-ld_docs","status-publish","has-post-thumbnail","hentry","ld_collection-vpascode-docs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mermaid Sequence Diagram | VPasCode Text to Diagram Guide<\/title>\n<meta name=\"description\" content=\"Map message flows between system components with Mermaid sequence diagrams in VPasCode, an agile diagram-as-code tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mermaid Sequence Diagram | VPasCode Text to Diagram Guide\" \/>\n<meta property=\"og:description\" content=\"Map message flows between system components with Mermaid sequence diagrams in VPasCode, an agile diagram-as-code tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"VPasCode\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/05\/img_6a19037c84393-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1090\" \/>\n\t<meta property=\"og:image:height\" content=\"692\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 ph\u00fat\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/\",\"name\":\"Mermaid Sequence Diagram | VPasCode Text to Diagram Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/2026\\\/05\\\/img_6a19037c84393-1.png\",\"datePublished\":\"2026-05-26T08:05:43+00:00\",\"description\":\"Map message flows between system components with Mermaid sequence diagrams in VPasCode, an agile diagram-as-code tool.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/#breadcrumb\"},\"inLanguage\":\"vi\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"vi\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/2026\\\/05\\\/img_6a19037c84393-1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/2026\\\/05\\\/img_6a19037c84393-1.png\",\"width\":1090,\"height\":692},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/vpascode-docs\\\/mermaid-js-sequence-diagram-syntax-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lean Docs\",\"item\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/docs\\\/%ld_collection%\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"H\u01b0\u1edbng d\u1eabn c\u00fa ph\u00e1p s\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 Mermaid.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/#website\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/\",\"name\":\"VPasCode\",\"description\":\"by Visual Paradigm\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"vi\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/#organization\",\"name\":\"VPasCode\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"vi\",\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"contentUrl\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/wp-content\\\/uploads\\\/sites\\\/12\\\/2026\\\/06\\\/cropped-vp-online-logo-v1.png\",\"width\":128,\"height\":138,\"caption\":\"VPasCode\"},\"image\":{\"@id\":\"https:\\\/\\\/www.vpascode.com\\\/vn\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mermaid Sequence Diagram | VPasCode Text to Diagram Guide","description":"Map message flows between system components with Mermaid sequence diagrams in VPasCode, an agile diagram-as-code tool.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/","og_locale":"vi_VN","og_type":"article","og_title":"Mermaid Sequence Diagram | VPasCode Text to Diagram Guide","og_description":"Map message flows between system components with Mermaid sequence diagrams in VPasCode, an agile diagram-as-code tool.","og_url":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/","og_site_name":"VPasCode","og_image":[{"width":1090,"height":692,"url":"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/05\/img_6a19037c84393-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"5 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/","url":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/","name":"Mermaid Sequence Diagram | VPasCode Text to Diagram Guide","isPartOf":{"@id":"https:\/\/www.vpascode.com\/vn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/05\/img_6a19037c84393-1.png","datePublished":"2026-05-26T08:05:43+00:00","description":"Map message flows between system components with Mermaid sequence diagrams in VPasCode, an agile diagram-as-code tool.","breadcrumb":{"@id":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/#primaryimage","url":"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/05\/img_6a19037c84393-1.png","contentUrl":"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/05\/img_6a19037c84393-1.png","width":1090,"height":692},{"@type":"BreadcrumbList","@id":"https:\/\/www.vpascode.com\/vn\/docs\/vpascode-docs\/mermaid-js-sequence-diagram-syntax-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vpascode.com\/vn\/"},{"@type":"ListItem","position":2,"name":"Lean Docs","item":"https:\/\/www.vpascode.com\/vn\/docs\/%ld_collection%\/"},{"@type":"ListItem","position":3,"name":"H\u01b0\u1edbng d\u1eabn c\u00fa ph\u00e1p s\u01a1 \u0111\u1ed3 tu\u1ea7n t\u1ef1 Mermaid.js"}]},{"@type":"WebSite","@id":"https:\/\/www.vpascode.com\/vn\/#website","url":"https:\/\/www.vpascode.com\/vn\/","name":"VPasCode","description":"by Visual Paradigm","publisher":{"@id":"https:\/\/www.vpascode.com\/vn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vpascode.com\/vn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/www.vpascode.com\/vn\/#organization","name":"VPasCode","url":"https:\/\/www.vpascode.com\/vn\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/www.vpascode.com\/vn\/#\/schema\/logo\/image\/","url":"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/06\/cropped-vp-online-logo-v1.png","contentUrl":"https:\/\/www.vpascode.com\/vn\/wp-content\/uploads\/sites\/12\/2026\/06\/cropped-vp-online-logo-v1.png","width":128,"height":138,"caption":"VPasCode"},"image":{"@id":"https:\/\/www.vpascode.com\/vn\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/ld_docs\/2104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/ld_docs"}],"about":[{"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/types\/ld_docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/users\/4"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/media\/2105"}],"wp:attachment":[{"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/media?parent=2104"}],"wp:term":[{"taxonomy":"ld_collection","embeddable":true,"href":"https:\/\/www.vpascode.com\/vn\/wp-json\/wp\/v2\/ld_collection?post=2104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}