So if the incident metadata is blank, just pass in an empty object: {}
.
The bot will create the state from scratch as if it was starting a new conversation.
On output the bot will pass an object:
{
outgoing_payloads: outgoing_payloads,
state: {
version: @state.version,
data: @state.data,
history: @state.history
},
action: @state.action
}
outgoing_payloads
and action are for your use.
state
is to be updated as as the metadata blob.
To initiate:
bot = Engine.new(metadata, message)
To recieve the return object:
bot.process