# Conditional Prompts

**Conditional Prompts** allow you to define **instructions that are executed only when specific conditions are met** during a conversation.

***

### What Is a Conditional Prompt?

A Conditional Prompt is composed of three elements:

* **Name** — an internal identifier to help you organize your logic
* **Prompt** — the instruction that will be injected into the Agent when the condition is met
* **Condition** — the rule that determines *when* the prompt should be executed

When multiple Conditional Prompts exist, the **condition** is what determines which one applies in each situation.

***

### How Conditional Prompts Work

During a conversation, the Agent continuously evaluates the defined conditions.

When a condition matches the current context:

1. The corresponding **Conditional Prompt** is activated
2. Its instructions are applied to the Agent’s reasoning
3. The Agent responds or acts according to that injected prompt

This allows Agents to adapt behavior dynamically without changing their core Prompt.

***

### Examples of Use

* If the user asks to speak with a human → trigger a prompt that uses the **Ticket Creation Tool**
* If the user confirms an action → inject a prompt that executes a **Workflow**
* If a specific keyword appears → change tone, flow, or next steps
* If the conversation reaches a certain state → guide the Agent to finalize or escalate

***

### Best Practices

* Keep **conditions explicit and non-overlapping**
* Use Conditional Prompts for **logic and flow control**, not for core identity
* Avoid duplicating logic already defined in the main Prompt
* Disable unused Conditional Prompts to keep behavior predictable

> 💡 **Tip:** Think of Conditional Prompts as *contextual instructions* that activate only when needed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zaia.app/agents/agent-settings/conditional-prompts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
