Response Check Block
“Response Check” Block
Section titled ““Response Check” Block”What is a “Response Check” Block
Section titled “What is a “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.
Main Functions
Section titled “Main Functions”- 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
Creation and Configuration
Section titled “Creation and Configuration”How to Add a “Response Check” Block
Section titled “How to Add a “Response Check” Block”- Open the bot builder
- From the Blocks panel, select “Add Response Check”
- The Block will be added to the workspace
Configuring Response Check Parameters
Section titled “Configuring Response Check Parameters”- Double-click on the “Response Check” Block in the builder
- Set a title for the Block (optional)
- Choose between Simple or Advanced mode
- Configure validation conditions
- Click “Save” to apply settings
Configuration Modes
Section titled “Configuration Modes”Simple Mode
Section titled “Simple Mode”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:
yesokaysureagreeIf 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
Section titled “Advanced Mode”Advanced mode provides powerful conditional logic:
Main Condition Editor
Section titled “Main Condition Editor”- Build complex condition trees using AND/OR operators
- Combine multiple conditions with nested logic
- Visual tree editor for managing conditions
AI-Powered Validation
Section titled “AI-Powered Validation”Enable AI validation to check responses intelligently:
- Check the “Use AI” checkbox
- Enter an AI prompt describing what you want to validate
- 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 addressBlacklist
Section titled “Blacklist”Use the blacklist to exclude specific patterns:
- Check the “Use Blacklist” checkbox
- Configure conditions that should fail validation
- If a response matches blacklist conditions, it’s rejected even if it passes main conditions
One-Time Check
Section titled “One-Time Check”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
Connection Points
Section titled “Connection Points”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.
Usage Examples
Section titled “Usage Examples”Simple Text Validation
Section titled “Simple Text Validation”Scenario: Check if user agrees to terms
Simple Mode Configuration:
I agreeyesacceptok- User responds “I agree” → SUCCESS path
- User responds “no” → ELSE path
Email Validation with AI
Section titled “Email Validation with AI”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”
Multiple Conditions
Section titled “Multiple Conditions”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”
Tips and Recommendations
Section titled “Tips and Recommendations”- 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
Frequently Asked Questions
Section titled “Frequently Asked Questions”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.
What happens if no condition matches?
Section titled “What happens if no condition matches?”The Block takes the ELSE path, allowing you to handle invalid responses (e.g., ask the user to try again).
Can AI validation understand context?
Section titled “Can AI validation understand context?”Yes, AI validation can understand semantic meaning and context based on your prompt instructions, making it more flexible than simple text matching.