Triggering flows
Last updated
Last updated
Triggering a flow on a MessageThread is done by posting a FlowRun to /flow-runs
. A FlowRun will start the chat on the specified MessageThread, once created the FlowRun will have the status queued
we will directly try to start the flow on the MessageThread, if successful the status will change to running
and billing will start.
In this guide we will show you how to create a WhatsApp MessageThread and trigger a flow on it.
Flow (see Generating flows)
A connected WhatsApp number (see )
Webhook subscription (see Setting up webhooks) on FlowRun for this guide we will assume you have subscribed to FlowRun updates.
Firstly we need a MessageThread
Secondly we can trigger the flow on our MessageThread, as the channel we are using is Whatsapp we are required to set a messageTemplate
as initial message.
The initial response you will get will look something like this:
Note how status is queued
and cost is 0
in the background we will try to start the flow on the messageThread
. You will we notified with a WebhookPayload once the flow has started.