# ✍️ Text Block

## Sending predefined messages

The text block enables the virtual assistant to send specific, static messages to users.

#### **Key Features**

* Supports messages **up to 300 characters**.
* Can be displayed as a standard virtual assistant response or as a **caption** (smaller text below the bot’s main response).

#### **Common Use Cases**

* **Welcome Message**: A warm greeting when users start a conversation. This message typically introduces the virtual assistant and explains its features.&#x20;

{% hint style="info" %}
💡 Tip: If your response exceeds 300 characters, you can split it into multiple text blocks. However, we recommend using a maximum of 3 blocks (900 characters total) to keep messages concise and readable within a chat format.&#x20;
{% endhint %}

<figure><img src="https://4264750556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4dIFGOeVbHW1PRwnG0Z8%2Fuploads%2F9FPhRq3RVb85jGCfQi5v%2FScreenshot%202025-03-24%20alle%2018.36.33.png?alt=media&#x26;token=5f6b1f08-5e1e-4887-87d7-43827fac32aa" alt=""><figcaption><p>Welcome Text Messages</p></figcaption></figure>

{% hint style="info" %}
*The welcome message is one of the first things to configure when building an AI agent. It is included by default in every workspace. Learn more in our step-by-step guide:* [configure-your-ai-agents](https://guide.indigo.ai/build-your-ai-agents/configure-your-ai-agents "mention").
{% endhint %}

* **Conditional Responses**: A Text Block can be used **within a Condition Block** to display specific messages based on predefined variables.

> *Example*&#x20;
>
> *Scenario: A virtual assistant that provides order status updates based on the user's order status.*
>
> * *If order\_status = "shipped", then display: "📦 Your order has been shipped! You can track it using this link: \[tracking\_link]."*
> * *If order\_status = "processing", then display: "⏳ Your order is currently being processed. We’ll notify you once it’s shipped!"*
> * *If order\_status = "delayed", then display: "⚠️ We’re sorry! Your order is delayed due to unexpected circumstances. Our support team is here to help if you need more details."*

* **Debugging**: A Text Block can be particularly useful for debugging when placed inside a Condition Block.&#x20;

<figure><img src="https://4264750556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4dIFGOeVbHW1PRwnG0Z8%2Fuploads%2FGJ35O0Jqk9WvV8Av5ODN%2FScreenshot_2025-03-05_alle_14.42.19.png?alt=media&#x26;token=e3ecef36-e104-4541-a7e1-2b84b56c6b80" alt=""><figcaption><p>Text Block within a Condition Block</p></figcaption></figure>

<figure><img src="https://4264750556-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4dIFGOeVbHW1PRwnG0Z8%2Fuploads%2FyTfyLfJ8OyEXodJE60ru%2FScreenshot_2025-03-05_alle_14.42.37.png?alt=media&#x26;token=0d8749ac-8bab-4b24-8fa5-edb70f7c501e" alt="" width="370"><figcaption><p>Text shown during the conversation after a condition is met</p></figcaption></figure>

By using the `$env` variable, which differentiates between test and live environments, you can display debugging information as a text caption when `$env = test`.

This allows you to show internal notes that help track which agent is responding or which workflow triggered a specific reply. If `$env = production`, the debugging text is not shown, ensuring a clean user experience.

> *Example: If $env = test, display: "Response generated by \[Agent Name]"*

{% hint style="info" %}
Learn more about Condition Blocks, Variables, and Debugging at these links: [condition-block](https://guide.indigo.ai/getting-started/agents-workflows-and-triggers/blocks/logic-blocks/condition-block "mention"), [variables](https://guide.indigo.ai/getting-started/workspace/variables "mention"), [testing-and-debugging](https://guide.indigo.ai/build-your-ai-agents/testing-and-debugging "mention").
{% endhint %}
