Read Inputs
Last updated
Last updated
Now that we have the required slots and triggers configured, it is time to configure the actual workflow.
An ideal workflow for the applyLeave intent would be
Ensure startDate and endDate are available.
Ensure leaveReason is available.
Mark the leave using the available end-point
Response to User the action has been completed.
Let us begin creating the workflow.
Every workflow configured might contain a varying number of steps depending on the intent. Irrespective of the logic involved, each of the workflow will begin with a Start Action and is terminated by an End action.
The Start Action marks the first step of the workflow. Every workflow defined has a single Start action. You can add the Start Action by dragging and dropping the action from the Action Panel to the Editor.
Once we have marked the first step of the workflow, as per the outline of workflow we created at the beginning of this document, the next step is to ensure the key parameters (slots) which are required by the intent are captured.
This can be ensured by adding an Get Action. The Get action accepts a single parameter, which points to the slot that needs to be read. You can add the slotName as shown in the figure below.
Drag 3 Get actions to the workflow editor and specify each of the slots we require in each of them. We will begin by collecting the startDate, followed by the endDate and leaveReason. You can mark the order by using the transition/relation lines as shown in the figure.
At this point, there are two options. The developer can design the workflow to make use of a Rest endpoint to save the values. On other hand, when the requirement to have a backend endpoint is not that high, you could also make use of our no-code approach and save the values in a spreadsheet. We will look into both approaches.
No Code ApproachREST Endpoints Approach