{"id":23811,"date":"2020-07-03T16:49:20","date_gmt":"2020-07-03T15:49:20","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=23811"},"modified":"2022-09-21T08:54:37","modified_gmt":"2022-09-21T07:54:37","slug":"working-with-the-logic-node","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/working-with-the-logic-node\/","title":{"rendered":"Logic Node"},"content":{"rendered":"<p><span style=\"font-weight: 400\">The Logic Node provides a simpler experience to developers, facilitating the use of context variables and the definition of complex transition conditions. Its two primary features are:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Ability to manage variables and values of variables in the context object.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Ability to define nested transition conditions.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">This article shows you how to add and configure the Logic node.&nbsp;<\/span><\/p>\n<div class=\"w-separator size_medium with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Add_the_Node\"><span style=\"font-weight: 400\">Add the Node<\/span><\/span><\/h1>\n<p><span style=\"font-weight: 400\">Logic Nodes can only be added as part of a Bot Action node. Therefore, before you can add a Logic Node, you need to add a Bot Action node. <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/bot-action-node\/\"><span style=\"font-weight: 400\">Read more about Bot Action Nodes<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Keeping this in mind, the setup of a logic node in a dialog task involves the following steps:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Open the dialog task to which you want to add the Logic node.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Add and\/or expand a <\/span><strong>Bot Action<\/strong><span style=\"font-weight: 400\"> Node.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Add the Logic node in the designated place. For steps on adding nodes, <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/chatbot-overview\/using-the-dialog-builder-tool\/#Adding_Nodes\"><span style=\"font-weight: 400\">refer here<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The Logic node is displayed with the <\/span><strong>Component Properties<\/strong><span style=\"font-weight: 400\"> tab selected by default.<\/span><\/li>\n<\/ol>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084031\/add-logic-node.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084031\/add-logic-node-1024x456.gif\" alt=\"\" width=\"640\" height=\"285\" class=\"alignnone size-large wp-image-45070\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084031\/add-logic-node-1024x456.gif 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084031\/add-logic-node-300x133.gif 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\n<div class=\"w-separator size_medium with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h1><span class=\"ez-toc-section\" id=\"Configure_the_Node\"><span style=\"font-weight: 400\">Configure the Node<\/span><\/span><\/h1>\n<div class=\"w-separator size_medium with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Component_Properties\"><span style=\"font-weight: 400\">Component Properties<\/span><\/span><\/h2>\n<table style=\"background-color: #fffbea;width: 100%\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"100%\">\n<p><strong><em>Note<\/em><\/strong><em><span style=\"font-weight: 400\">: All changes made to the Component Properties tab will affect all instances of the Logic node, across Dialog Tasks.&nbsp;<\/span><\/em><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">To configure the Component Properties tab, please follow the steps below:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the <\/span><strong>Component Properties<\/strong><span style=\"font-weight: 400\"> tab, under the <\/span><strong>General Settings<\/strong><span style=\"font-weight: 400\"> section, you can modify the <\/span><strong>Name<\/strong><span style=\"font-weight: 400\"> and <\/span><strong>Display Name<\/strong><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">In the <\/span><strong>Variable Namespaces<\/strong><span style=\"font-weight: 400\"> section (v8.0), associate the variable namespaces to execute this node and its transitions. This option is visible only when the variable namespace is enabled for the assistant. You can go with the task level settings or customize it for this node. For more information, refer to <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\"><span style=\"font-weight: 400\">Managing Namespace<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Use the <\/span><strong>Manage Context Variables<\/strong><span style=\"font-weight: 400\"> section to set the context variables by entering a key-value pair. Use the full path of the variable in the <\/span><em><span style=\"font-weight: 400\">key<\/span><\/em><span style=\"font-weight: 400\"> field i.e. <\/span><code><em><span style=\"font-weight: 400\">context.BotUserSession.&lt;variable_name&gt;.<\/span><\/em><\/code><\/li>\n<\/ol>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084433\/logic-component-properties.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084433\/logic-component-properties.png\" alt=\"\" width=\"462\" height=\"788\" class=\"alignnone size-full wp-image-45073\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084433\/logic-component-properties.png 462w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084433\/logic-component-properties-176x300.png 176w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/a><br \/>\n<div class=\"w-separator size_medium with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Instance_Properties\"><span style=\"font-weight: 400\">Instance Properties<\/span><\/span><\/h2>\n<table style=\"background-color: #fffbea;width: 100%\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"100%\">\n<p><strong><em>Note<\/em><\/strong><em><span style=\"font-weight: 400\">: The settings in the Instance Properties tab are specific to the current dialog task and do not reflect in other dialog tasks that use this node.<\/span><\/em><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">Use the Instance Properties to define any user tags that you want to set.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">On the Logic node properties panel, click the <\/span><strong>Instance Properties<\/strong><span style=\"font-weight: 400\"> tab.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Under the <\/span><strong>Custom<\/strong> <strong>Tags <\/strong><span style=\"font-weight: 400\">section, add tags to build custom profiles of your VA&rsquo;s conversations. <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/custom-meta-tags\/\"><span style=\"font-weight: 400\">Click here for more<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ol>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084718\/logic-instance-properties.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084718\/logic-instance-properties.png\" alt=\"\" width=\"455\" height=\"647\" class=\"alignnone size-full wp-image-45076\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084718\/logic-instance-properties.png 455w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084718\/logic-instance-properties-211x300.png 211w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/a><br \/>\n<div class=\"w-separator size_medium with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Connections_Properties\"><span style=\"font-weight: 400\">Connections Properties<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400\">Since they are contained within Bot Action nodes, Logic nodes cannot be connected on their own to any other nodes outside the Bot Action node to which they belong. Connections can only be made with nodes contained within the same Bot Action node.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400\">From the node&rsquo;s Connection Properties tab, you can configure the following:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><strong>Logic Node Connections<\/strong><span style=\"font-weight: 400\">: The node within the Bot Action to execute next, after the Logic node runs.&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Bot Action Connections<\/strong><span style=\"font-weight: 400\">, where you can update the node to trigger after the Bot Action group is executed. Updates made here will apply to all nodes within the same Bot Action. Please read our article about the Bot Action Node to learn more.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">For both connection types you can write conditional statements based on the values of any Entity or Context Objects in the dialog task, or you can use Intents for transitions.&nbsp;<\/span><\/p>\n<table style=\"background-color: #fffbea;width: 100%\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"100%\">\n<p><strong>Note<\/strong><span style=\"font-weight: 400\">: The conditions configured here are applicable only for this instance and will not affect this node when being used in any other dialog.<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400\">To set up node connection conditions, please follow the steps outlined in <\/span><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-builder-tool\/dialog-task\/nodes-conditions\/\"><span style=\"font-weight: 400\">Adding IF-Else Conditions to Node Connections.&nbsp;<\/span><\/a><\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084852\/logic-connections-properties.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084852\/logic-connections-properties.png\" alt=\"\" width=\"449\" height=\"593\" class=\"alignnone size-full wp-image-45079\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084852\/logic-connections-properties.png 449w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20220921084852\/logic-connections-properties-227x300.png 227w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/a><\/p>\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>[vc_raw_html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kaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnBvc3RfbmF2aWdhdGlvbi1pdGVtLW1ldGElMjIlM0VOZXh0JTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJwb3N0X25hdmlnYXRpb24taXRlbS10aXRsZSUyMiUzRSUzQ3NwYW4lM0VNZXNzYWdlJTIwJTI4Qm90JTIwUmVzcG9uc2UlMjklMjBOb2RlcyUzQyUyRnNwYW4lM0UlM0MlMkZkaXYlM0UlMEElM0NwJTNFJTNDJTJGYSUzRSUzQyUyRmRpdiUzRQ==[\/vc_raw_html]<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The Logic Node provides a simpler experience to developers, facilitating the use of context variables and the definition of complex transition conditions. Its two primary features are: Ability to manage variables and values of variables in the context object. Ability to define nested transition conditions. This article shows you how to add and configure the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-23811","post","type-post","status-publish","format-standard","hentry","category-dialog-task"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/23811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=23811"}],"version-history":[{"count":11,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/23811\/revisions"}],"predecessor-version":[{"id":45082,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/23811\/revisions\/45082"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=23811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=23811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=23811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}