FlowRun
FlowRun is responsible for initiating a Flow in a MessageThread. The FlowRun resource reflects the flow's current state of the flow, including session variables, the present costs incurred in association with the FlowRun and the status
attribute displaying the flow's execution state.
Endpoints
GET /flow-runs
- Retrieve a list of all FlowRun.GET /flow-runs/{id}
- Retrieve a specific FlowRun by ID.POST /flow-runs
- Trigger a new FlowRun in a MessageThread.PATCH /flow-runs/{id}
- Update a specific FlowRun by ID.DELETE /flow-runs/{id}
- Delete a specific FlowRun by ID.
Patching a FlowRun
The following attributes can be patched in a FlowRun:
state
- Thestate
attribute can can only be updated once a FlowRun is not in a running state. By patching the state attribute you can delete any personal data or other sensitive information from the state.status
- Thestatus
attribute can be updated tofinished
,timeout
,cancelled
orexception
. This can be used to manually finish a flow run or to mark it as a timeout or exception.
Attributes
flowId
UUID
messageThreadId
UUID
state
JSON object
The initial state of the flow run, including session variables.
initialMessage
JSON object
The message to be sent to the candidate when the flow is triggered. Type depends on the channel; for WhatsApp, a template is required. If no message is provided, the flow will be triggered without sending a message to the candidate; this will still mean that the candidate will enter the correct flow upon the next message send. Please set to {}
if you wish for no initialMessage.
status
String
The current status of the flow run, which can be one of "running"
, "finished"
, "timeout"
, "exception"
, "queued"
.
cost
integer
The current cost in credits of the flow run.
createdAt
DateTime
The timestamp when the flow run was created.
updatedAt
DateTime
The timestamp when the flow run was last updated.
HTTP Methods
flowId
X
X
messageThreadId
X
X
state
X
X
X
initialMessage
X
X
status
X
cost
X
createdAt
X
updatedAt
X
Required Fields for Creation (POST)
flowId
UUID
cacc1a00-b59f-44da-8a48-d99db3473389
messageThreadId
UUID
cacc1a00-b59f-44da-8a48-d99db3473389
state
JSON object
{}
initialMessage
JSON object
{"type":"template","template":{"id":"7f9a9715-5e7c-4328-ab47-bb9e595438c9","components":[{"type":"body","parameters":[{"type":"text","text":"John"}]}]}}
Initial Message
The initial message is the message that will be sent to the candidate when the flow is triggered. The type of the initial message depends on the channel, for whatsapp a template is required. If no message is provided, the flow will be triggered without sending a message to the candidate this will still mean that the candidate will enter the correct flow upon sending a message.
Example POST body
Example PATCH body
Scheduling
OpenAPI
Last updated