This guide will show you the basic process of editing a Flow. In this example we will walk through the process to edit the decline messages in the chatbot.
Finding the correct Flow, Node and Action
Flow structure
The basic structure of the Flow resource goes as follows:
a has multiple Nodes
a has 1 or more
a Node has 0 or more
the starting node of a flow is marked with isStartFlow: true
an end node of a flow is marked with isEndFlow: true
end nodes have endFlowType set to either 'accepted', 'declined', 'reset' or 'update'
When a Flow is generated by our AI it will follow the following structure:
There is only 1 start Node
There is only 1 'Accept' end Node
There is only 1 'Decline' end Node
Every node has only 1 Action
Finding the Action Id
To find the correct action to alter, we need to identify which Action belongs to the 'Decline Node' of our target Flow.
With this request we are filtering all the nodes of our target Flow, ensuring only the 'Decline Step' Node shows up including all of its NodeActions (in the case of an AI generated Flow this should be only one say-text Action).
In the response we can see that our Node has isEndFlow: true and endFlowType: declined, meaning that we have the correct Node. The text of our message is in the included part of the response, there you should find 1 NodeAction, this has actionType: say and subType: text meaning it is the NodeAction defining the output message to the candidate.
Using its Id, we can then make a PATCH request that looks as follows: