Skip to content

Response Check Block

The “Response Check” Block is a conditional element in Grailgun that validates user responses against specified criteria. This Block allows you to create branching logic in your bot’s dialogue flow based on what the user sends, supporting both simple text matching and complex conditional logic with AI assistance.

  • Validating user responses against predefined conditions
  • Creating branching dialogue paths (success/failure routes)
  • Checking text content using simple or advanced matching rules
  • AI-powered response validation for intelligent content analysis
  • Blacklist functionality to exclude specific patterns
  • One-time or persistent checking modes
  1. Open the bot builder
  2. From the Blocks panel, select “Add Response Check”
  3. The Block will be added to the workspace
  1. Double-click on the “Response Check” Block in the builder
  2. Set a title for the Block (optional)
  3. Choose between Simple or Advanced mode
  4. Configure validation conditions
  5. Click “Save” to apply settings

Simple mode is designed for straightforward text matching:

  • Enter expected responses in a text area, one per line
  • Each line is checked separately (OR logic)
  • If user’s message matches any line, the check succeeds
  • Case-insensitive matching
  • Perfect for basic keyword or phrase detection

Example:

yes
okay
sure
agree

If the user responds with any of these words, validation succeeds.

Note: Simple mode may not be available if you’ve configured complex conditions in Advanced mode.

Advanced mode provides powerful conditional logic:

  • Build complex condition trees using AND/OR operators
  • Combine multiple conditions with nested logic
  • Visual tree editor for managing conditions

Enable AI validation to check responses intelligently:

  1. Check the “Use AI” checkbox
  2. Enter an AI prompt describing what you want to validate
  3. The AI will analyze the user’s response based on your instructions

Example AI Prompt:

Check if the user's response contains a valid email address

Use the blacklist to exclude specific patterns:

  1. Check the “Use Blacklist” checkbox
  2. Configure conditions that should fail validation
  3. If a response matches blacklist conditions, it’s rejected even if it passes main conditions

Enable “One-time” option to make this check trigger only once per user:

  • When checked, the Block executes validation only on the first trigger
  • On subsequent triggers, it automatically succeeds
  • Useful for optional validations or first-time setup flows

The Response Check Block has branching outputs:

  • SUCCESS - Connected Block executes when validation passes
  • ELSE - Connected Block executes when validation fails

This allows you to create different dialogue paths based on user input quality.

Scenario: Check if user agrees to terms

Simple Mode Configuration:

I agree
yes
accept
ok
  • User responds “I agree” → SUCCESS path
  • User responds “no” → ELSE path

Scenario: Validate user provides a proper email

Advanced Mode with AI:

  • AI Prompt: “Verify the message contains a valid email address in standard format”
  • SUCCESS: User enters “john@example.com
  • ELSE: User enters “not an email”

Scenario: Check if user is 18+ and agrees to terms

Advanced Mode:

  • Condition 1: Message contains “18” OR “adult” OR “yes”
  • AND
  • Condition 2: Message length > 2 characters
  • Blacklist: “no”, “refuse”, “deny”
  • Use Simple mode for straightforward keyword matching
  • Use Advanced mode with AI for intelligent content validation
  • Set clear titles to identify Response Check Blocks in complex flows
  • Test your conditions thoroughly with various user inputs
  • Use blacklist to prevent false positives
  • Consider one-time checks for optional validations
  • Always provide clear instructions to users about expected input format

When should I use Simple vs Advanced mode?

Section titled “When should I use Simple vs Advanced mode?”

Use Simple mode when checking for specific keywords or phrases. Use Advanced mode when you need complex logic, AI validation, or blacklist functionality.

Can I switch between Simple and Advanced modes?

Section titled “Can I switch between Simple and Advanced modes?”

Yes, but complex Advanced conditions may prevent switching back to Simple mode if they cannot be represented as simple text lines.

The Block takes the ELSE path, allowing you to handle invalid responses (e.g., ask the user to try again).

Yes, AI validation can understand semantic meaning and context based on your prompt instructions, making it more flexible than simple text matching.