Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<tr>
<td><b>3 minutes read</b></td>
<td style={{ paddingLeft: '40px' }}><b>Level: Advanced </b></td>
<td style={{ paddingLeft: '40px' }}><b>Last Updated: March 2026</b></td>
<td style={{ paddingLeft: '40px' }}><b>Last Updated: September 2026</b></td>
</tr>
</table>
</h3>
Expand Down Expand Up @@ -73,6 +73,49 @@ Then you can use that response as **@results.mywebhook.success_message** Or if y

Here my webhook is a custom name you defined on your webhook node and **success_message** is the key of the response object you send back in a webhook call.

___
## Wait time for AI function webhooks

Some of the pre-defined webhook `functions` do not answer immediately. `filesearch-gpt`, `voice-filesearch-gpt`, `speech_to_text` and `text_to_speech` send the request to the AI service and pause the flow at that node until the answer comes back.

Glific waits **60 seconds** for that answer by default. If the AI takes longer, which is common for long voice notes or large knowledge bases, the flow moves ahead without a response and the end user gets an empty message.

On these four nodes you can set your own wait time, up to **5 minutes (300 seconds)**. Open the node, select **FUNCTION Body**, and add a `wait_time` parameter with the number of seconds you want Glific to wait.

![The wait_time field in the Function Body of a webhook node](../../../../static/img/flows/flows_webhook_wait_time.png)

For example, to wait 3 minutes for an assistant to answer:

```
{
"question": "@results.question",
"assistant_id": "asst_xxxxxxxxxxxxxxxxx",
"wait_time": 180
}
```

### Rules to keep in mind

- The value is in **seconds**, not minutes. `180` means 3 minutes.
- Use a whole number (`180`) or a number in quotes (`"180"`). Both work.
- A flow variable will not work here. `"wait_time": "@results.some_value"` is ignored, because Glific reads this value when it validates the flow, before variables are filled in. Always enter a fixed number.
- Leave the field blank, remove it, or enter something that is not a number, and Glific waits the default 60 seconds. Existing flows are unaffected.
- The maximum is **300 seconds**. Enter more and Glific shows this warning when you publish, then waits 300 seconds:

> You've configured a wait_time of 600 seconds which exceeds the allowed wait time of 300 seconds. We will use the allowed wait time only.

- The value stays inside Glific. It is never sent to the AI service, so it does not change the response.

### When the wait time runs out

If the response has still not arrived, the flow continues to the next node on its own. The result variables of that webhook, such as `@results.gptresponse.message`, will be empty, so the contact may receive an empty message. Add a router after the AI node that checks whether the response arrived, and send a fallback message such as "Sorry, that took too long. Please try again." when it did not.

Check **Flows** → **Webhook logs** to see how long your calls actually take, and raise the wait time in steps rather than setting 300 seconds everywhere. Voice nodes need the most: 120 to 180 seconds is a good starting point.

:::note
This applies only to those four functions. A webhook that calls your own URL does not pause the flow, so `wait_time` is ignored there. Use the [Wait for Result node](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Wait%20for%20result/) for long-running webhooks of your own.
:::

___
## Checking Webhook Logs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<tr>
<td><b>5 minutes read</b></td>
<td style={{ paddingLeft: '40px' }}><b>Level: Intermediate </b></td>
<td style={{ paddingLeft: '40px' }}><b>Last Updated: February 2026</b></td>
<td style={{ paddingLeft: '40px' }}><b>Last Updated: September 2026</b></td>
</tr>
</table>
</h3>
Expand Down Expand Up @@ -90,6 +90,8 @@ Also, make sure, that the default optin message from the Gupshup portal is disab
> - **Condition:** A node is triggered multiple times with the same message body.
> - **Threshold:** 3 times
> - **Action:** After the 3rd repetition of the same message at the same node, the system flags it as an **infinite loop**.
14. `Wait time warning` - This warning appears when a `wait_time` above 300 seconds is set in the `Function Body` of an AI webhook node (`filesearch-gpt`, `voice-filesearch-gpt`, `speech_to_text`, `text_to_speech`). The flow still publishes, but Glific waits only the allowed maximum of 300 seconds (5 minutes). Set a value of 300 or less to remove the warning. Read more in [Call a webhook](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Call%20a%20webhook/#wait-time-for-ai-function-webhooks).

---

## Logs to know if any errors are thrown while executing the flow
Expand Down
12 changes: 11 additions & 1 deletion docs/5. Integrations/Speech to text capabilities in Glific.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<tr>
<td><b>6 minutes read</b></td>
<td style={{ paddingLeft: 40 }}><b>Level: Advanced</b></td>
<td style={{ paddingLeft: 40 }}><b>Last Updated: April 2026</b></td>
<td style={{ paddingLeft: 40 }}><b>Last Updated: September 2026</b></td>
</tr>
</table>
</h3>
Expand Down Expand Up @@ -48,6 +48,16 @@ Add a Send Message node and paste this variable to show the converted text to th
<img width="683" height="621" alt="Screenshot 2026-05-08 at 4 25 19 PM" src="https://github.com/user-attachments/assets/adb845df-0339-4ce3-a47b-e15aef8ce8be" />


## Setting the wait time for the transcription

Glific pauses the flow at the `speech_to_text` node while the voice note is transcribed, and waits **60 seconds** by default. A voice note longer than a minute can take more time than that, and once the wait is over the flow moves ahead without the text.

To wait longer, add a `wait_time` parameter, in **seconds**, to the `Function Body`.

![The speech_to_text Function Body with a wait_time of 120 seconds](../../static/img/integrations/speech/speech_to_text_wait_time.png)

The maximum is 300 seconds (5 minutes). Leave it blank and the default of 60 seconds applies. Read more in [Call a webhook](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Call%20a%20webhook/#wait-time-for-ai-function-webhooks).

# Default behaviour for speech-to-text webhook calls
- By default, the speech-to-text function performs transcription of the incoming voice note only using the `gemini-2.5-pro` model and gives a text output in the same language as the language of the incoming voice note.

Expand Down
12 changes: 11 additions & 1 deletion docs/5. Integrations/Text to speech capabilities in Glific.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<tr>
<td><b>6 minutes read</b></td>
<td style={{ paddingLeft: 40 }}><b>Level: Advanced</b></td>
<td style={{ paddingLeft: 40 }}><b>Last Updated: April 2026</b></td>
<td style={{ paddingLeft: 40 }}><b>Last Updated: September 2026</b></td>
</tr>
</table>
</h3>
Expand Down Expand Up @@ -50,6 +50,16 @@ Add the parameters as shown in the screenshot.

- Set up instructions: [Google Cloud Storage integration](https://glific.github.io/docs/docs/Pre%20Onboarding/Google%20Cloud%20Storage%20Setup%20-%20GCS).

## Setting the wait time for the response

Glific pauses the flow at the `text_to_speech` node while the voice note is generated, and waits **60 seconds** by default. Audio for a long message can take longer than that, and once the wait is over the flow moves ahead without the voice note.

To wait longer, add a `wait_time` parameter, in **seconds**, to the `Function Body`.

![The text_to_speech Function Body with a wait_time of 120 seconds](../../static/img/integrations/speech/text_to_speech_wait_time.png)

The maximum is 300 seconds (5 minutes). Leave it blank and the default of 60 seconds applies. Read more in [Call a webhook](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Call%20a%20webhook/#wait-time-for-ai-function-webhooks).

#### Default parameters for speech_to_text node
When only `text` parameter is passed the following default values of model and voice are used

Expand Down
10 changes: 9 additions & 1 deletion docs/5. Integrations/Using AI Assistants in Glific Flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ _Screenshot of example flow set up is given below_
<img width="" height="" alt="Screenshot 2025-12-02 at 6 10 59 PM" src="https://github.com/user-attachments/assets/aff3ba8d-e5d0-4958-b10c-2bfa481d2128" />

- In `question` parameter enter the flow variable containing the question asked by the user. In the given example `question` is the `result name`, hence provided `@result.question` in the question parameter.
- In `assistant_id` enter the assistant ID, copied as described in [Creating and modifying AI assistants in Glific](https://glific.github.io/docs/docs/Integrations/Creating%20and%20modifying%20assistants%20in%20Glific/)
- In `assistant_id` enter the assistant ID, copied as described in [Creating and modifying AI assistants in Glific](https://glific.github.io/docs/docs/Integrations/AI%20Assistants/)
- `wait_time` is optional. It is the number of **seconds** Glific waits for the assistant to answer before it moves ahead in the flow. Leave it blank and Glific waits 60 seconds. Large knowledge bases or long answers can take longer, so set a higher value such as `120`. The maximum is 300 seconds (5 minutes).

![The filesearch-gpt Function Body with a wait_time of 180 seconds](../../static/img/integrations/openai/openai_filesearch_wait_time.png)

Read more about the wait time in [Call a webhook](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Call%20a%20webhook/#wait-time-for-ai-function-webhooks).

<img width="" height="" alt="Screenshot 2025-12-02 at 9 18 23 AM" src="https://github.com/user-attachments/assets/880a4181-bd79-4d04-92aa-c0d502456bd5" />

Expand Down Expand Up @@ -143,6 +148,9 @@ Pass the following paramters in the function body.
- `assistant_id` is the assistant ID, copied as described in [Creating and modifying AI assistants in Glific](https://glific.github.io/docs/docs/Integrations/Creating%20and%20modifying%20assistants%20in%20Glific/).
- `source_langauge` is the expected language of the user.
- `target_language` is the language that the response voice note needs to be in.
- `wait_time` is optional. It is the number of **seconds** Glific waits for the response before it moves ahead in the flow. The default is 60 seconds. Voice takes longer than text, so `120` to `180` is a good starting point here. The maximum is 300 seconds (5 minutes). Read more in [Call a webhook](https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Actions/Call%20a%20webhook/#wait-time-for-ai-function-webhooks).

![The voice-filesearch-gpt Function Body with a wait_time of 180 seconds](../../static/img/integrations/openai/openai_voice_filesearch_wait_time.png)

#### Step 4: Display the text response
- Create a `Send Message node`.
Expand Down
Binary file added static/img/flows/flows_webhook_wait_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading