Action Flow Workers

An action flow worker is technically the same type of worker as a flow worker. The only difference is that it has a actionStart and actionEnd node instead of the standard Start and Bot Mission Done nodes.

Triggered by a botnet action from SBintents, Filter worker or a Business Intents, this worker takes user input and processes it using the rules set out by a bot builder on the ServisBOT canvas. A flow worker can be created through the CLI or through the Add Resource button on a bot’s detail page. That flow can then be modified to have the correct actionStart and actionEnd nodes.

Do not create a flow worker and attach it to the same bot from which you are triggering it.

Type: Flow Worker

Action flow worker through cli

Save this json to a file and create a worker using the cli command sb-cli worker create file.json


{
  "Data": {
    "settings": {
      "type": "flows",
      "body": {
        "users": {
          "_": {
            "editor": {
              "view": {
                "view-grid-size": 20,
                "view-snap-grid": true,
                "view-show-grid": true,
                "view-show-tips": true,
                "view-node-status": true
              }
            }
          }
        }
      },
      "path": "/"
    },
    "sessions": {
      "type": "flows",
      "body": [],
      "path": "/"
    },
    "flows": {
          "type": "flows",
          "body": [
            {
              "disabled": false,
              "id": "a635abea.f55998",
              "label": "Flow 1",
              "type": "tab",
              "info": ""
            },
            {
              "wires": [
                [
                  "76681dbe.1017ec"
                ]
              ],
              "name": "actionStart",
              "x": 260,
              "y": 220,
              "z": "a635abea.f55998",
              "id": "bcd54b94.9e65d8",
              "type": "actionStart"
            },
            {
              "wires": [],
              "name": "actionComplete",
              "x": 580,
              "y": 320,
              "z": "a635abea.f55998",
              "id": "a408bc8.4e8aac",
              "type": "actionComplete"
            },
            {
              "wires": [
                [
                  "a408bc8.4e8aac"
                ]
              ],
              "enableDisplay": false,
              "messageType": "str",
              "displayTimer": 1.5,
              "name": "",
              "x": 420,
              "y": 260,
              "z": "a635abea.f55998",
              "id": "76681dbe.1017ec",
              "type": "dialogue",
              "message": "Hello from Action Flow"
            }
          ],
          "path": "/"
        },
    },
    "credentials": {
      "type": "flows",
      "body": {},
      "path": "/"
    }
  },
  "Organization": "trollin",
  "Config": {
    "Avatar": "default-bot"
  },
  "Enabled": true,
  "Description": "A classic flow based worker which messages terminate in",
  "Type": "r2-avalanche-worker",
  "Name": "blankflowClassicFlowWorker",
  "Status": "published",
}



This worker’s ID is then referenced by botnet actions of type trigger-flow

Accessing conversation context from within an action flow

The intent that triggered the action flow, and additional conversation context can be accessed within nodes like the dialog, markup and send node. Accessing intent context.