---
title: "Questions"
description: "Add questions to a dialog to collect user information into context variables, with auto-fill, validation, and mandatory questions."
---

# Questions

> Add questions to a dialog to collect user information into context variables, with auto-fill, validation, and mandatory questions.

Questions enable your AI agent to collect information from users through conversational Q&A. The system intelligently extracts answers from context when possible, reducing repetitive questions and creating a natural flow.

Add questions below any [text](https://docs.moveo.ai/docs/ai-agents/triggers/trigger-text.md) or [event](https://docs.moveo.ai/docs/ai-agents/triggers/event.md) trigger. Your AI agent can request single or multiple pieces of information within a dialog.

## Understanding context variables

When your AI agent asks a question, the user's answer is saved to a [context variable](https://docs.moveo.ai/docs/ai-agents/context.md) that persists throughout the conversation session.

**Save As field:**

The **Save As** field defines the context variable name where the answer is stored. You can use simple names like `email` or `phone`, or use dot notation (`.`) to organize variables in JSON structure: `user.email`, `booking.date`, `payment.amount`.

:::note

If a context variable is already filled, the AI agent may skip the question automatically unless configured otherwise.

:::

**Example question configuration:**

**User message example:**

```
Agent: "What is your email address?"
User: "alex@example.com"
[The answer is saved in the context variable $email: "alex@example.com"]
```

## How auto-fill works

Auto-fill attempts to extract answers before prompting the user. The ability to extract from conversation history depends critically on whether you configure a validation guideline.

### With validation guideline (LLM-based)

When a validation guideline is configured, the AI can extract information from **anywhere in the conversation history** only if is **not** a mandatory question:

- **Analyzes full conversation**: Reviews all previous messages, not only the current one
- **Understands context**: Can extract information mentioned several messages ago
- **Intelligent inference**: Understands natural language like "tomorrow", "my email is...", etc.
- **Context variable access**: Can use previously stored context variables

**Example scenario (WITH guideline):**
```
Message 1
User: "Hi, my email is sarah@example.com"
Agent: "Nice to meet you! How can I help?"

Message 2
User: "I'd like to schedule a demo"

Message 3
User: "What times are available?"
Agent: "We have slots at 2pm and 4pm"

Message 4
User: "I'll take the 2pm slot"
[Question node triggers with validation guideline: "Extract user's email"]
Agent: "Perfect! Demo booked for 2pm. Confirmation sent to sarah@example.com"
```
☝️ The email was mentioned in **Message 1**, but the question triggered in **Message 4**. With a validation guideline, the AI found it in the history.

:::warning
If the question was a mandatory one, the user would be prompted to answer it. Even if they already mentioned it earlier in the conversation.
:::

### Without validation guideline (rule-based)

Without a validation guideline, auto-fill is **limited to the current user message only**:

- **Context variable access**: If the context variable already has a value, it skips the question. (Only if the question is not mandatory)
- **No conversation history**: Cannot look at previous messages
- **No natural language understanding**: Requires exact format (no "tomorrow", only "2025-03-15")
- **Current message only**: If the entity isn't in the current message, auto-fill fails

The variable type, 

**Same scenario (WITHOUT guideline):**
```
Message 1
User: "Hi, I'm Sarah and my email is sarah@example.com"
Agent: "Nice to meet you, Sarah! How can I help?"

Message 2
User: "I'd like to schedule a demo"

Message 3
User: "What times are available?"
Agent: "We have slots at 2pm and 4pm"

Message 4
User: "I'll take the 2pm slot"
[Question node triggers WITHOUT validation guideline]
Agent: "What's your email address?"  ← Auto-fill FAILED - email not in current message - User is prompted
```
☝️ Without a guideline, the system only checks **Message 4** for an email entity. Since it's not there, auto-fill fails and the user gets prompted.

:::tip

**For intelligent auto-fill from conversation history, always configure a validation guideline.** Without it, questions can only auto-fill from entities detected in the current user message, not from earlier context.

:::

**When auto-fill is skipped:**
- The question is marked as **Mandatory** (see below)
- No relevant data exists (in history with guideline, or current message without guideline)
- The system requires explicit user confirmation

## Ask only

Select **ask only** for simple data extraction without validation constraints.

**Required fields:**

- **Ask**: The question to ask the user.

- **Save input in the variable**: The context variable key where the answer is saved.

## Check and ask

Select **Check and ask** to add validation rules to your questions.

**Required fields:**

- **Ask**: The question to ask. Optionally set a **reprompt** message if the user's input fails validation.

- **Check if exists**: Choose one of the following validation types:

  - [Entity](https://docs.moveo.ai/docs/ai-agents/entities.md): Checks for a specific entity in the user's message.

  - **Input type:** Validates the response format:
    - Text
    - Email
    - Number
    - Integer
    - Phone
    - URL
    - Date
    - Time
    - Datetime
    - Currency
    - Percentage
    - Boolean

  Each validation type automatically validates format and normalizes values to a standard format. This ensures consistent data storage, enables reliable integrations with external systems, and simplifies downstream processing in your workflows.

  **Why use validation types:**
  - **Email**: Ensures valid format for email delivery systems, normalizes to lowercase for database consistency
  - **Phone**: Validates international format, removes formatting for SMS/call integrations
  - **URL**: Extracts clean URLs for link processing, ensures valid format for web requests
  - **Date/Time/Datetime**: Standardizes to ISO formats for calendar integrations, scheduling systems, and database storage
  - **Number/Integer**: Ensures numeric calculations work correctly, prevents type errors in APIs
  - **Currency**: Standardizes monetary values for payment processing and financial calculations
  - **Percentage**: Converts to decimal format (0.0-1.0) for mathematical operations
  - **Boolean**: Normalizes to true/false for conditional logic and integrations
  - **Text**: Cleans whitespace for consistent display and storage

  The validation behavior depends on whether you configure a validation guideline:

  **With validation guideline (LLM-based):**

  The AI understands natural language and converts it to standard format before validation.

  | Validation Type | Input Example | Normalized Output | Purpose |
  |-----------------|---------------|-------------------|---------|
  | **Email** | "Steve@Gmail.com" | "steve@gmail.com" | Lowercase for consistency |
  | **Phone** | "+1 (415)-432-5355" | "+14154325355" | Remove formatting for SMS APIs |
  | **URL** | "Visit https://moveo.ai now" | "https://moveo.ai" | Extract URL from text |
  | **Date** | `03/15/2025` or "tomorrow" | "2025-03-15" | ISO format for databases |
  | **Time** | "2:30 PM" | "14:30:00" | 24-hour format for scheduling |
  | **Datetime** | "March 15, 2025 at 2:30 PM" | "2025-03-15T14:30:00" | ISO 8601 for calendar APIs |
  | **Number** | "one and a half" or "1.5" | 1.5 | Float for calculations |
  | **Integer** | "twenty" or "20" | 20 | Integer for counting |
  | **Currency** | "100 dollars" | "USD 100.0" | Standard format for payments |
  | **Percentage** | "20%" | 0.2 | Decimal fraction (0.0-1.0) |
  | **Boolean** | "yes" / "true" / "1" | true | True/false for logic |
  | **Text** | "  Hello World  " | "Hello World" | Trim whitespace |

  **Without validation guideline (rule-based):**

  Only accepts pre-formatted inputs. Natural language requires validation guidelines.

  | Validation Type | Accepted Input | Normalized Output | Rejected Input |
  |-----------------|----------------|-------------------|----------------|
  | **Email** | "steve@gmail.com" | "steve@gmail.com" (lowercase) | Invalid email format |
  | **Phone** | "+1 (415)-432-5355" | "+14154325355" | Invalid phone format |
  | **URL** | "https://moveo.ai" | "https://moveo.ai" | Invalid URL format |
  | **Date** | `03/15/2025` or "2025-03-15" | "2025-03-15" | ❌ "tomorrow" |
  | **Time** | "2:30 PM" or "14:30" | "14:30:00" | Invalid time format |
  | **Datetime** | "2025-03-15T14:30:00" | "2025-03-15T14:30:00" | Invalid datetime format |
  | **Number** | "1.5" or "1,5" | 1.5 | ❌ "one and a half" |
  | **Integer** | "20" | 20 | ❌ "twenty" |
  | **Currency** | "USD 100.0" | "USD 100.0" | ❌ "100 dollars" |
  | **Percentage** | 0.2 or "0.2" | 0.2 | ❌ "20%" |
  | **Boolean** | "yes" / "true" / "1" | true | "maybe" |
  | **Text** | "  Hello World  " | "Hello World" | (accepts any text) |

  :::warning

  Natural language inputs like "tomorrow", "twenty", or "100 dollars" **require a validation guideline**. Without a guideline, questions only accept pre-formatted values like "2025-03-15", "20", or "USD 100.0".

  ::: 

- **Guideline validation** (Optional): Custom validation instructions in natural language. An LLM validates the user's response using this guideline.

  :::note

  The guideline option is not available when using entity validation.

  :::

  **Customizing clarification messages:**

  When a user provides invalid or ambiguous input, the AI agent generates a clarification message explaining why the input was rejected. You can influence this message through the validation guideline.

  For example, if your guideline includes instructions like "Must be a future date within 90 days. If invalid, remind the user about the 90-day limit", the agent incorporates this context into its clarification responses.

- **Save input in the variable**: The context variable key where the validated answer is saved.

:::note

Entity validation creates a second variable with the suffix `_value` added to your defined key. This variable stores the entity's actual value.

:::

## Mandatory questions

The **Mandatory** checkbox controls whether auto-fill is attempted and how the agent handles information collection.

**When mandatory is OFF (default):**
- The system tries auto-fill first using conversation context
- Only prompts the user if auto-fill fails
- May move forward if the user doesn't provide valid input or changes topic.

**When mandatory is ON:**
- Skips auto-fill entirely (see [data access](#data-access-during-question-processing) for details)
- Always asks the user explicitly, even if the answer exists in context
- Continues asking until a valid answer is provided

**Use mandatory questions for:**

- Sensitive information requiring explicit confirmation (payment details, credit card numbers)
- Legal or compliance requirements (explicit consent, terms acceptance)
- Situations where inference could be incorrect (for example, "Which email should we use?" when multiple exist)
- Critical workflow steps that cannot be skipped

:::tip

Use mandatory questions sparingly. Auto-fill provides better user experience by reducing repetitive questions.

:::

## Data access during question processing

The AI agent has access to different information depending on the question type:

**Regular questions:**
- Full conversation history (all previous messages)
- All context variables from earlier in the conversation
- Current user message
- Session metadata (date, time, language)

**Mandatory questions:**
- Limited context (only recent conversation for continuity)
- Current user message
- No access to context variables for auto-fill

This design ensures mandatory questions require explicit user input rather than inferred answers from context.

## How the agent responds to user input

When processing a question, the AI agent analyzes the user's response and classifies it into response types that control the conversation flow.

| Response Type | Available For | What It Means | Agent Behavior | Example |
|--------------|---------------|----------------|----------------|---------|
| **SUCCESS** | All questions | Answer successfully extracted and validated | Saves the value to the context variable and continues | User: "john@example.com" → Variable filled, workflow continues |
| **CLARIFICATION** | Regular questions | Answer is ambiguous or incomplete | Generates a clarification message explaining the issue | User: "50 euros" when asking for dollars → Agent: "I need the amount in dollars, not euros" |
| **DETAILS_REQUESTED** | Regular questions | User asks for more information before answering | Provides context then re-asks the question | User: "Why do you need my email?" → Agent explains, then asks again |
| **TOPIC_CHANGE** | Regular questions | User changed the subject | Handles topic change, may return to question later | User: "Actually, I want to cancel" → Agent pivots to cancellation |
| **MEMORY_UPDATE** | Regular questions | User is correcting a previous answer | Updates the earlier context variable | User: "Actually my email is jane@example.com, not john@example.com" |
| **FAILURE** | All questions | Cannot extract valid answer | States that information is needed to proceed | User provides invalid input → Agent explains requirement and re-asks |

**Key behaviors:**

- **Regular questions**: Support all response types including topic changes and memory updates
- **Mandatory questions**: Only support SUCCESS and FAILURE response types—the agent always re-asks until valid input is provided
- **CLARIFICATION vs FAILURE**: For regular questions, CLARIFICATION generates helpful follow-up messages; for mandatory questions, FAILURE is used instead
- **MEMORY_UPDATE**: Users can naturally correct mistakes without breaking conversational flow (regular questions only)
- **TOPIC_CHANGE**: Prevents forcing answers when users have urgent needs (regular questions only)

:::note Conversation tip

Design question prompts to handle clarification naturally. If asking for a date, mention the expected format: "When would you like to schedule? (for example, March 15 or next Monday)"

:::

## Validation guideline best practices

Keep validation guidelines short and specific—the AI uses these to validate user input. Focus on constraints and format requirements.

**Example 1: Date validation**
```
Validation Type: Date
Validation Guideline: "Must be a future date within the next 90 days"
```
*Why it works:* Clear constraint, specific timeframe, simple to validate.

**Example 2: Phone validation**
```
Validation Type: Phone
Validation Guideline: "US phone numbers only, must include area code"
```
*Why it works:* Specifies format and regional requirement concisely.

**Example 3: Text validation**
```
Validation Type: Text
Validation Guideline: "Full legal name as it appears on government ID"
```
*Why it works:* Sets clear expectation for format and formality level.

:::note

Keep validation guidelines under 15 words when possible. Focus on what makes an answer valid rather than lengthy explanations.

:::

## Questions in your workflow

**Integration tips:**

- Questions execute in sequence—the agent asks them one at a time
- If validation fails, the agent automatically uses the "Reprompt" message
- Slot values can be used in downstream nodes with `{{"{{$variable_name}}"}}` syntax
- Context variables persist throughout the session—no need to ask twice
- For optional information, consider using conditional logic instead of questions
- The agent naturally handles topic changes and clarifications—design for conversational flow, not rigid forms
