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 - The state 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 - The status attribute can be updated to finished, timeout, cancelled or exception. This can be used to manually finish a flow run or to mark it as a timeout or exception.
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".
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.
The initial message can be any of the available Payload values, see the Message resource for more information.
Example POST body
Example PATCH body
Scheduling
If you have generated a flow with a scheduling step where the mode is set to mode: 'custom' you can provide the Schedule Id when starting the flow by including the following:
OpenAPI
Create a FlowRun
post
Authorizations
AuthorizationstringRequired
Bearer
Body
Responses
201
flow_run created
application/vnd.api+json
401
access denied
422
when trying to write a non-writable attribute
post
/flow-runs
Destroy a Candidate
delete
Authorizations
AuthorizationstringRequired
Bearer
Path parameters
idstringRequired
Responses
204
candidate destroyed
401
access denied
404
Candidate not found
delete
/candidates/{id}
No content
Retrieve a single flow_run
get
Authorizations
AuthorizationstringRequired
Bearer
Path parameters
idstringRequired
Responses
200
flow_run found
application/vnd.api+json
401
access denied
404
FlowRun not found
get
/flow-runs/{id}
Destroy a FlowRun
delete
Authorizations
AuthorizationstringRequired
Bearer
Path parameters
idstringRequired
Responses
204
flow_run destroyed
401
access denied
404
FlowRun not found
delete
/flow-runs/{id}
No content
Update a FlowRun
patch
Authorizations
AuthorizationstringRequired
Bearer
Path parameters
idstringRequired
Body
Responses
200
flow_run updated
application/vnd.api+json
401
access denied
404
FlowRun not found
422
Invalid Request opening message can not be updated
patch
/flow-runs/{id}
Retrieve a single flow_run including flow
get
Authorizations
AuthorizationstringRequired
Bearer
Path parameters
idstringRequired
Responses
200
flow_run found with included flow
application/vnd.api+json
get
/flow_runs/{id}?include=flow
200
flow_run found with included flow
Retrieve a single flow_run including messageThread