Skip to main content
The Data Extraction stage systematically collects information from callers. Define the variables you need, and the AI asks for and validates each piece of data.

Overview

Data Extraction nodes are ideal when you need to:
  • Collect customer information (name, email, phone)
  • Gather order details
  • Capture booking requirements
  • Validate input formats
Data Extraction nodes are colored purple on the canvas.

Configuration

Extraction Method

MethodDescription
Ask UserThe agent explicitly asks for each piece of information
InferThe agent extracts information mentioned naturally in conversation
The agent asks for each variable directly:
Agent: "May I have your full name, please?"
Caller: "John Smith"
Agent: "Thank you, John. And what's your email address?"
Best for: Forms, registrations, structured data collection

Max Attempts

Number of times to retry if validation fails (default: 3). After max attempts, the conversation continues without the variable (if not required) or triggers a fallback transition.

Variables

Each variable defines a piece of information to collect:

Variable Properties

PropertyDescription
NameIdentifier (snake_case, e.g., customer_name)
TypeData type for validation
RequiredWhether collection can continue without it
PromptQuestion to ask the user
DescriptionContext for the AI about this field
ValidationRegex pattern for format validation
OptionsChoices for select type

Variable Types

TypeDescriptionExample
stringShort textName, city
long_textExtended textIssue description
numberNumeric valueAge, quantity
booleanYes/NoConfirmation
selectChoice from optionsSize (S/M/L)
dateDate valueAppointment date
emailEmail address[email protected]
phonePhone number+1-555-123-4567

Validation Patterns

Use regex patterns to validate format:
# Order number: 2 letters + 6 digits
order_number:
  type: string
  validation: "^[A-Z]{2}[0-9]{6}$"
  prompt: "What's your order number? It starts with two letters followed by 6 digits."

# US Phone number
phone:
  type: phone
  validation: "^\\+?1?[0-9]{10}$"
  prompt: "What's your phone number?"

# Email
email:
  type: email
  validation: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
  prompt: "What's your email address?"

Transitions

Data Extraction nodes support special transition types:
TypeTrigger
All ExtractedAll required variables collected successfully
TimeoutUser didn’t respond in time
KeywordUser said a specific trigger word

All Extracted Transition

Automatically fires when all required variables have been collected:
Transitions:
  - Type: all_extracted
    Target: Process Order

Example Configurations

Extraction Method: Ask User
Max Attempts: 3

Variables:
  - name: customer_name
    type: string
    required: true
    prompt: "May I have your full name, please?"

  - name: email
    type: email
    required: true
    prompt: "What's the best email address to reach you?"

  - name: phone
    type: phone
    required: false
    prompt: "And a phone number in case we need to call you back?"

Transitions:
  - all_extracted → Confirmation
  - keyword: "stop", "cancel" → End Call
Extraction Method: Ask User
Max Attempts: 3

Variables:
  - name: order_number
    type: string
    required: true
    validation: "^[A-Z]{2}[0-9]{6}$"
    prompt: |
      What's your order number?
      It starts with two letters followed by six digits,
      like AB123456.

Transitions:
  - all_extracted → Order Status
  - keyword: "don't have it", "don't know" → Alternative Lookup
Extraction Method: Ask User
Max Attempts: 3

Variables:
  - name: preferred_date
    type: date
    required: true
    prompt: "What date works best for your appointment?"

  - name: preferred_time
    type: select
    required: true
    options: ["Morning (9-12)", "Afternoon (12-5)", "Evening (5-8)"]
    prompt: "Do you prefer morning, afternoon, or evening?"

  - name: appointment_type
    type: select
    required: true
    options: ["Consultation", "Follow-up", "New Patient"]
    prompt: "Is this a consultation, follow-up, or new patient visit?"

Transitions:
  - all_extracted → Calendar Booking

Using Extracted Variables

Once collected, variables can be used in:
  • Subsequent prompts: Reference as {{variable_name}}
  • If/Else conditions: Branch based on values
  • Function calls: Pass to external systems
  • Transfer briefings: Include in human transfer context
Prompt: |
  Help {{customer_name}} with their order {{order_number}}.
  Their preferred contact is {{email}}.

Best Practices

Ask One Thing at a Time

Don’t overwhelm callers. Collect variables sequentially.

Explain Format Requirements

If validation is strict, tell callers the expected format upfront.

Make Optional Fields Optional

Don’t require information you don’t actually need.

Handle Failures Gracefully

Set reasonable max attempts and provide fallback paths.