Skip to content

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.

  • 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
  1. Open the bot builder
  2. From the Blocks panel, select “Add Alert”
  3. The Block will be added to the workspace
  1. Double-click on the “Alert” Block in the builder
  2. Enter the alert message text
  3. Configure notification recipient in bot settings (if not already done)
  4. Click “Save” to apply settings

Important: Before alerts can be sent, you must configure a notification recipient in your bot settings.

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 $AMOUNT

Note: Replace NAME, USER_ID, and AMOUNT with actual variable syntax using curly braces in your alerts.

The recipient is configured in Bot Settings, not within the Alert Block itself.

To Configure:

  1. Click the “Notification Settings” button in the Alert Block form
  2. You’ll be directed to Bot Settings
  3. 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.

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.

Scenario: Notify admin when new user registers

Flow:

  1. Message: “Welcome! Please enter your email”
  2. Variable Change: Set “user_email” = USER_RESPONSE
  3. Alert: “New user registered: [email]”
  4. Message: “Thank you for registering!”

Scenario: Alert admin when critical error occurs

Flow:

  1. HTTP Request: Call external API
    • ELSE path (error):
      • Alert: “API call failed for user [ID] at [time]”
      • Message: “Sorry, service temporarily unavailable”

Scenario: Track when users complete purchases

Flow:

  1. Message: “Payment successful!”
  2. Variable Change: Set “purchase_amount” = USER_RESPONSE
  3. Alert: “Purchase completed: $[amount] by user [name]”
  4. Status Change: Set status to “Customer”

Scenario: Alert when user completes daily task

Flow:

  1. Message: “Task completed!”
  2. Variable Change: Set “tasks_completed” = COPY_FROM (increment logic)
  3. Alert: “User [name] completed task #[count]“

Scenario: Alert moderators about potential abuse

Flow:

  1. 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”

Scenario: Alert admin about expiring subscriptions

Flow:

  1. 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!”

Scenario: Track VIP user activity

Flow:

  1. Condition Check: Is user status = “VIP”?
    • SUCCESS path:
      • Alert: “VIP user [name] accessed premium feature: [feature]”
      • Message: “Thank you for using our premium features!”

Scenario: Alert support team of new tickets

Flow:

  1. Message: “Describe your issue”
  2. Variable Change: Set “support_request” = USER_RESPONSE
  3. Alert: ”🎫 New support ticket from [name]: [request]”
  4. Message: “Support ticket submitted. We’ll respond within 24 hours.”

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: STATUS

Note: Replace NAME, ID_VALUE, etc. with actual variable syntax {variable_name} in your alerts.

  • 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

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.

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.

This depends on your bot configuration. Check notification settings to see if multiple recipients are supported.

Alerts are sent asynchronously and are best-effort. Network issues or recipient unavailability may cause delivery failures. Consider implementing critical notifications through multiple channels.

No, alerts are sent asynchronously and don’t block the conversation flow. The bot continues immediately after triggering the alert.

No, alerts are only sent to configured recipients (administrators). Users don’t see alert contents unless you explicitly show them in a Message Block.

Set up a test notification recipient (e.g., your own Telegram account) in bot settings, then trigger the Alert Block in a test conversation.

Yes! Use {variable_name} syntax to include any stored variables, including USER_RESPONSE values, in your alert messages.

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.

Store the current timestamp using Variable Change: Set "alert_time" = CURRENT_DATE, then reference it in your alert message: {alert_time}.