Create New Flow

  1. Click on button on the top right side of the Workflow list screen and it will open a new page where you can create a new flow.
  1. In the Create Workflow page, there is a side bar consisting of three labels: Notification, Others, and Service Now.
  2. From there, you can drag the required nodes and drop them in the drop area. You can also search for the necessary node in the sidebar.
  3. Nodes have forms associated with them and need to be filled. All the nodes should relate to each other, but then 10 nodes are not allowed.
  4. There is a Start node in the drop area by default. Click on of the start node.
Figure 1. Figure 141 - Create Workflow Page
  1. Clicking the edit button, displays the following image. There are three events in Start node: Scheduled, External, and Web App event.
Figure 2. Figure 142 - Option of Scheduled/External/Web App event
  1. Select one of the options and click on Continue.
  2. Scheduled events get triggered at the time set by the user in its Cron expression, while the External events get triggered from the BOT connect API.

If Scheduled event is selected.

  1. Fill in the Workflow name, Cron expression, and JSON payload (optional).
  1. Click on Save and the information gets saved.
Figure 3. Figure 143 – Workflow settings (for scheduled)
  1. Before clicking on Save, make sure that the Workflow name and Cron expression should not be empty and JSON Payload is optional field and the Workflow name’s length should be less than 18 characters. If any of the two mandatory fields are empty, then the following popup will come.
Figure 4. Figure 144 – Error pop-up

If External event is selected

  1. Fill the Workflow name and JSON payload(optional).
  1. Click on Save and the information gets saved.
Figure 5. Figure 145 - Workflow settings (for external)
  1. Before clicking on Save, make sure the Workflow name is not empty and if JSON needs to be filled then JSON should be in a valid JSON format. If Workflow name is empty, then the following popup will show up.
Figure 6. Figure 146 – Error pop-up
  1. After clicking on Save of the Start node, the Workflow name appears in Start node.

If Web App is selected

Web App is triggered by the BOT Connect API.

Once triggered by a Web App event, this event will execute the entire flow. Once the execution is finished, it will give the result.

  1. Select Web App and click on Continue.
Figure 7. Figure 147 – Web App selected
  1. Fill in the Workflow Name, which is a mandatory field, and the JSON Payload, which is an optional field.
  2. Click on Save and the information gets saved.
Figure 8. Figure 148 - Workflow Name & JSON Payload

Before clicking on Save ensure that:

- Workflow Name is not empty.

- If filled, JSON should be in a valid JSON format.

If the Workflow Name is left empty, the following popup appears.

Figure 9. Figure 149 – Error message
C:\Users\username\AppData\Local\Microsoft\Windows\INetCache\Content.MSO\474C278D.tmp

After clicking on Save, a success message appears as shown below.

Figure 10. Figure 150 – Success Message

The Workflow Name appears in the Start node after being saved.

Figure 11. Figure 151 – Workflow name saved

Only one action node can be requested and approved for an entire event.

  1. To drag Action node, user must click on the edit button of Action node.
Figure 12. Figure 152 – Edit button on Action node
  1. Fill the mandatory fields.
  2. Select an Openwhisk function name from Action drop-down box and fill JSON payload.
  3. Click on Save.
Figure 13. Figure 153 – Save button

A pop up success message appears.

Figure 14. Figure 154 – Success message

If these two fields are left empty, a pop-up appears stating “All fields are required!” would appear.

Figure 15. Figure 155 – Error Message

If more than one action node is added to Web App, an error message is displayed stating “Only one action is allowed for this event!” appears.

Figure 16. Figure 156 – More than one Action node
Figure 17. Figure 157 – Error message
  1. Add one Action node and click on Save button.
  1. The event is saved successfully.
    Figure 18. Figure 158 – Success Message
    1. To execute the Web App flow, the user must hit that flow in postman using the following URL: https://tenant-name/admin/external/api/event/workflow-name.
  1. Once triggered by a Web App event, it executes the entire flow.
  2. The result is shown once the execution is finished.
Figure 19. Figure 159 - Web App flow
Figure 20. Figure 160 – Start node
  1. Drag Action or any other node.
  2. Click on of Action node and fill the mandatory fields.
  3. Select an Openwhisk function name from Action drop-down box and fill the JSON payload.
  4. Click on the Save button.
  5. If these two fields are empty, then a pop-up will be shown stating that ‘All fields are required’
Figure 21. Figure 161 – Action node
  1. After filling the details, click on Save.
  2. Click on Ok.
  3. The following confirmation pop-up will be shown for Save button of all the nodes.
Figure 22. Figure 162 – Saved success message
  1. Drag Conditional Switch node.
  2. Click on button of the node and fill the condition field which is mandatory.
  3. You can click on to see what you need to write in the condition field.
Figure 23. Figure 163 – Conditional Switch node

You need to use result object to access previous node’s output. For example: Action node’s output is {message: ‘Hello World’}, so you need to write a condition in condition field, result.message == ‘Hello World’.

Figure 24. Figure 164 – Add condition

Condition should be syntactically correct otherwise it will show Invalid syntax. Some keywords are restricted for use as condition. Keywords are: if, else, for, switch, case, this, require, global, process, console, object, map, forEach, await, async, function, var, let, const, throw, new, every and all assignment operators. If any of these keywords are used, then the following pop-up will be shown.

Figure 25. Figure 165 – Error pop-up
  1. Now drag SMS node and click on the button of SMS node and fill the required details.
  2. The recipient’s details and the body of the message will come from previous node’s output (e.g. Action). To send SMS, you need to have an account in Twilio. A Twilio Account SID, Auth Token, and Twilio phone number are required.
  3. In the ‘Sender phone number’ field, enter your Twilio phone number. All the fields are mandatory.
  4. After filling in all the fields click on Save.
  5. If any of the fields are empty, then a pop-up will be shown stating “Please fill the required fields”.
Figure 26. Figure 166 – SMS node
  1. The Sender Phone Number field of SMS node maintains a format. If you write phone number in wrong format and click on Save, then the following pop-up will come.
Figure 27. Figure 167 – Error pop-up
  1. Now drag Custom Mailer and click on the button of the node. You need to fill all the fields, Username should be a valid email id, Password should be the same email id’s password and service should be the same email id’s domain. The mail recipients and body of the mail should come from previous node’s output (e.g. Action) and you can see all the information regarding this by clicking the Info icon. After filling all the details, you need to click on Save button.
Figure 28. Figure 168 – Custom Mailer
  1. You can edit the name of nodes by clicking on the Edit Name button () which is present at the top right corner of each node, a cursor is placed at front of the node name.
  2. After giving it a name, the user needs to press Enter and the node name will be saved.
Figure 29. Figure 169 – Workflow page
  1. After filling in all the node’s information, link all the nodes together, and click on the Save button.
  2. Connection to the Condition Node’s ‘True’ output must be present, whereas Condition Node’s ‘False’ output is optional.
  3. If connection is not present in True output, then after clicking on Save, the following pop-up will be shown.
Figure 30. Figure 170 – Error Message
  1. After clicking on the Save button, the flow will be saved, and the pop-up will be shown:
Figure 31. Figure 171 – Saved success message
  1. Click on Ok and you will be redirect to the Workflow List Page where You can now see the newly created flow in the list.
Figure 32. Figure 172 – New created flow in the Workflow list
  • Flow with Trigger node: There is a node to trigger another flow that exists in the Workflow List page named "Trigger Node." This node is present only during external events.
  1. To use this node, you need to drag the node and click on the edit icon of the node.
  1. Select a flow from the drop-down and click on Save.
  2. An example with Trigger node is shown in the below figure.
Figure 33. Figure 173 – Flow with Trigger Node
  • Flow with Split Node: Split node is a special node that can have more than two outputs for one input. The node accepts a maximum of five outputs, and all outputs should relate to other nodes.
  1. Output can be added by clicking on the Add icon.
  1. Output can be removed by clicking on the Minus icon.
  2. If all the outputs are not connected, then the following pop-up will appear: "All outputs of the split node should be connected’. An example flow with Split node is shown in the below figure.
Figure 34. Figure 174 - Flow with Split Node