Alert Block
“Alert” Block
Section titled ““Alert” Block”What is an “Alert” Block
Section titled “What is an “Alert” Block”The “Alert” Block is a notification element in Grailgun that sends messages to bot administrators or designated recipients when specific events occur in the conversation flow. This Block is essential for monitoring bot activity, tracking important user actions, receiving error notifications, and staying informed about critical events.
Main Functions
Section titled “Main Functions”- Sending notifications to bot administrators
- Monitoring user activity and important events
- Alerting about errors or exceptional conditions
- Tracking conversions and key metrics
- Receiving real-time updates about bot usage
- Logging critical workflow steps
Creation and Configuration
Section titled “Creation and Configuration”How to Add an “Alert” Block
Section titled “How to Add an “Alert” Block”- Open the bot builder
- From the Blocks panel, select “Add Alert”
- The Block will be added to the workspace
Configuring Alert Parameters
Section titled “Configuring Alert Parameters”- Double-click on the “Alert” Block in the builder
- Enter the alert message text
- Configure notification recipient in bot settings (if not already done)
- Click “Save” to apply settings
Important: Before alerts can be sent, you must configure a notification recipient in your bot settings.
Configuration Fields
Section titled “Configuration Fields”Message
Section titled “Message”The text content of the alert that will be sent to the recipient.
- Can include plain text
- Can include variable values using
{variable_name}syntax - Should be clear and informative for the recipient
Example:
User NAME (ID: USER_ID) completed purchase for $AMOUNTNote: Replace NAME, USER_ID, and AMOUNT with actual variable syntax using curly braces in your alerts.
Notification Recipient
Section titled “Notification Recipient”The recipient is configured in Bot Settings, not within the Alert Block itself.
To Configure:
- Click the “Notification Settings” button in the Alert Block form
- You’ll be directed to Bot Settings
- Set up your notification recipient (Telegram user ID, email, webhook, etc.)
Warning Indicator: If no recipient is configured, you’ll see a warning message in the Alert Block form. Alerts won’t be delivered until a recipient is set up.
Connection Points
Section titled “Connection Points”The Alert Block has a simple linear flow:
- IN - Accepts connection from previous Blocks
- OUT - Continues to next Block after sending alert
The alert is sent asynchronously, and the flow continues immediately without waiting for delivery confirmation.
Usage Examples
Section titled “Usage Examples”User Registration Alert
Section titled “User Registration Alert”Scenario: Notify admin when new user registers
Flow:
- Message: “Welcome! Please enter your email”
- Variable Change: Set “user_email” = USER_RESPONSE
- Alert: “New user registered: [email]”
- Message: “Thank you for registering!”
Error Monitoring
Section titled “Error Monitoring”Scenario: Alert admin when critical error occurs
Flow:
- HTTP Request: Call external API
- ELSE path (error):
- Alert: “API call failed for user [ID] at [time]”
- Message: “Sorry, service temporarily unavailable”
- ELSE path (error):
Conversion Tracking
Section titled “Conversion Tracking”Scenario: Track when users complete purchases
Flow:
- Message: “Payment successful!”
- Variable Change: Set “purchase_amount” = USER_RESPONSE
- Alert: “Purchase completed: $[amount] by user [name]”
- Status Change: Set status to “Customer”
Daily Activity Summary
Section titled “Daily Activity Summary”Scenario: Alert when user completes daily task
Flow:
- Message: “Task completed!”
- Variable Change: Set “tasks_completed” = COPY_FROM (increment logic)
- Alert: “User [name] completed task #[count]“
Abuse Detection
Section titled “Abuse Detection”Scenario: Alert moderators about potential abuse
Flow:
- Response Check: Detect inappropriate content
- SUCCESS path:
- Alert: “⚠️ Potential abuse detected from user [ID]: [message]”
- Status Change: Set status to “Flagged”
- Message: “Your message has been flagged for review”
- SUCCESS path:
Subscription Expiration
Section titled “Subscription Expiration”Scenario: Alert admin about expiring subscriptions
Flow:
- Condition Check: Subscription expires within 24 hours?
- SUCCESS path:
- Alert: “Subscription expiring soon for user [email] - Expires: [date]”
- Message: “Your subscription expires tomorrow. Renew now!”
- SUCCESS path:
High-Value User Action
Section titled “High-Value User Action”Scenario: Track VIP user activity
Flow:
- Condition Check: Is user status = “VIP”?
- SUCCESS path:
- Alert: “VIP user [name] accessed premium feature: [feature]”
- Message: “Thank you for using our premium features!”
- SUCCESS path:
Support Request Notification
Section titled “Support Request Notification”Scenario: Alert support team of new tickets
Flow:
- Message: “Describe your issue”
- Variable Change: Set “support_request” = USER_RESPONSE
- Alert: ”🎫 New support ticket from [name]: [request]”
- Message: “Support ticket submitted. We’ll respond within 24 hours.”
Using Variables in Alert Messages
Section titled “Using Variables in Alert Messages”Alert messages support variable interpolation using {variable_name} syntax:
Available System Variables:
{user_id}- User’s unique identifier{user_name}- User’s display name (if available){current_time}- Current timestamp- Any custom variables you’ve created
Example with Multiple Variables:
Alert: User NAME (ID: ID_VALUE) triggered event "EVENT" at TIME.Value: VALUE, Status: STATUSNote: Replace NAME, ID_VALUE, etc. with actual variable syntax {variable_name} in your alerts.
Tips and Recommendations
Section titled “Tips and Recommendations”- Be specific: Include relevant context in alert messages
- Use variables: Make alerts informative by including user data
- Don’t spam: Avoid sending alerts for every minor event
- Test first: Ensure alerts are being delivered to the correct recipient
- Include identifiers: Always include user ID or name for tracking
- Use emojis: Add emojis like ⚠️ 🎫 ✅ to make alerts easily scannable
- Set up recipient early: Configure notification recipient before deploying flows with alerts
- Consider volume: Think about alert frequency during high-traffic periods
- Privacy matters: Don’t include sensitive user data in alerts unless necessary
- Action-oriented: Make clear what action (if any) is needed
Alert Delivery Methods
Section titled “Alert Delivery Methods”Depending on your bot configuration, alerts can be delivered via:
- Telegram messages - Direct messages to admin Telegram account
- Email - Email notifications to configured address
- Webhook - POST requests to external monitoring systems
- Other integrations - Slack, Discord, etc. (if configured)
Check your bot’s notification settings for available delivery methods.
Frequently Asked Questions
Section titled “Frequently Asked Questions”Why aren’t my alerts being sent?
Section titled “Why aren’t my alerts being sent?”The most common reason is that no notification recipient is configured. Click the “Notification Settings” button in the Alert Block form and set up a recipient in your bot settings.
Can I send alerts to multiple recipients?
Section titled “Can I send alerts to multiple recipients?”This depends on your bot configuration. Check notification settings to see if multiple recipients are supported.
Are alerts guaranteed to be delivered?
Section titled “Are alerts guaranteed to be delivered?”Alerts are sent asynchronously and are best-effort. Network issues or recipient unavailability may cause delivery failures. Consider implementing critical notifications through multiple channels.
Do alerts affect conversation flow speed?
Section titled “Do alerts affect conversation flow speed?”No, alerts are sent asynchronously and don’t block the conversation flow. The bot continues immediately after triggering the alert.
Can users see the alerts?
Section titled “Can users see the alerts?”No, alerts are only sent to configured recipients (administrators). Users don’t see alert contents unless you explicitly show them in a Message Block.
How do I test alerts during development?
Section titled “How do I test alerts during development?”Set up a test notification recipient (e.g., your own Telegram account) in bot settings, then trigger the Alert Block in a test conversation.
Can I include user input in alerts?
Section titled “Can I include user input in alerts?”Yes! Use {variable_name} syntax to include any stored variables, including USER_RESPONSE values, in your alert messages.
Is there a limit on alert message length?
Section titled “Is there a limit on alert message length?”Message length limits depend on the delivery method (e.g., Telegram has a character limit). Keep alerts concise and informative.
Can I send alerts to different recipients based on conditions?
Section titled “Can I send alerts to different recipients based on conditions?”Not directly within a single Alert Block. You would need to create multiple Alert Blocks and route flow through different paths using Condition Check Blocks.
How do I include timestamps in alerts?
Section titled “How do I include timestamps in alerts?”Store the current timestamp using Variable Change: Set "alert_time" = CURRENT_DATE, then reference it in your alert message: {alert_time}.