Webhooks & Alert Channels

LiteLambda provides two-way webhook integrations: Alert Channels to notify your team when jobs fail, and Trigger Webhooks to execute jobs on-demand from external services.

---

Part 1: Configuring Failure Alert Channels

When a cron job experiences 3 consecutive failures, LiteLambda immediately dispatches an alert payload to all configured channels (Slack, Discord, Telegram, and Email) with the job name, failure count, execution timestamp, and error message.

You can configure and test your channels anytime in Settings → Alert Channels.

---

1. Slack Incoming Webhook

Posts structured failure alerts directly to a channel in your Slack workspace.

Step 1: Create Webhook in Slack

  1. Visit api.slack.com/apps and click Create New App.
  2. Select From scratch, name your app (e.g. LiteLambda Alerts), and choose your Slack Workspace.
  3. In the left sidebar under Features, select Incoming Webhooks.
  4. Toggle Activate Incoming Webhooks to On.
  5. Click Add New Webhook to Workspace at the bottom of the page.
  6. Choose the channel where alerts should arrive (e.g. #cron-alerts or #engineering) and click Allow.
  7. Copy your generated Webhook URL. It looks like:
    https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Step 2: Connect in LiteLambda

  1. Navigate to Settings → Alert Channels in your LiteLambda dashboard.
  2. Paste the copied URL into the Slack Webhook URL field.
  3. Click Send Test. A test notification will immediately appear in your Slack channel:
    {"text": "✅ LiteLambda test alert — your notification channel is connected!"}
  4. Click Save Preferences at the bottom of the page.

Example Failure Alert in Slack

🚨 *LiteLambda Alert: crypto-price-sync is failing* 🚨

Job ID: `e1a8b321-4f10-41ab-8b92-91f7c5e14012`
Failures: 3 in a row
Time: Sep 27, 2026 12:45:00 UTC
Error: requests.exceptions.HTTPError: 429 Too Many Requests
---

2. Discord Webhook

Dispatches alerts directly to any Discord text channel.

Step 1: Create Webhook in Discord

  1. Open Discord and navigate to your server.
  2. Hover over the channel where you want notifications (e.g. #alerts), click the ⚙️ Edit Channel gear icon.
  3. Click Integrations in the left sidebar, then click Webhooks.
  4. Click New Webhook (or Create Webhook).
  5. Name the bot (e.g. LiteLambda) and optionally upload an avatar.
  6. Click Copy Webhook URL. The URL format is:
    https://discord.com/api/webhooks/123456789012345678/abcdefghijklmnopqrstuvwxyz_0123456789

Step 2: Connect in LiteLambda

  1. Go to Settings → Alert Channels.
  2. Paste the URL into Discord Webhook URL.
  3. Click Send Test to verify the connection.
  4. Click Save Preferences.
---

3. Telegram Bot Webhook

Sends alerts directly to your personal Telegram or group chat using the Telegram Bot API.

Step 1: Create a Bot via @BotFather

  1. Open Telegram and search for @BotFather.
  2. Send the command /newbot.
  3. Choose a name for your bot (e.g. My Server Alerts) and a username ending in bot (e.g. my_lambda_alerts_bot).
  4. BotFather will reply with your HTTP API Bot Token:
    7123456789:AAHfkj39kjsd9834kjnsdf9834kjnsdf893

Step 2: Obtain your Chat ID

  1. Start a conversation with your newly created bot by clicking its link (e.g. t.me/my_lambda_alerts_bot) and clicking Start (or send /start).

    Note: Telegram bots cannot message you first; you must send at least one message to the bot.

  2. To find your Chat ID:
    • Option A (Easiest): Start @userinfobot in Telegram. It will reply immediately with your numeric ID (e.g. 987654321).
    • Option B (Group Chats): Add your bot to the group, send a message in the group, then visit:
      https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
      Look for "chat":{"id": -1001234567890} in the JSON output.

Step 3: Construct the Webhook URL

Combine your Bot Token and Chat ID into this standard endpoint format:

https://api.telegram.org/bot<BOT_TOKEN>/sendMessage?chat_id=<CHAT_ID>

Example:

https://api.telegram.org/bot7123456789:AAHfkj39kjsd9834kjnsdf9834kjnsdf893/sendMessage?chat_id=987654321

Step 4: Connect in LiteLambda

  1. Paste the full URL into the Telegram Webhook URL field in Settings.
  2. Click Send Test. Your bot will send: ✅ LiteLambda test alert — your notification channel is connected!
  3. Click Save Preferences.
---

Part 2: Triggering Jobs via Inbound Webhooks

Every LiteLambda job has a dedicated, secret webhook endpoint that allows you to invoke execution instantly with an HTTP POST request.

Finding your Job Webhook URL

  1. Navigate to your Cron Jobs Dashboard.
  2. Each job row displays an instant Webhook URL button. Click it to copy the URL to your clipboard.
  3. Alternatively, open the job's Edit screen to view the full URL in the Instant Webhook Trigger card.

The URL structure is:

https://litelambda.in/crons/webhook/<JOB_UUID>/<WEBHOOK_SECRET>/

Triggering with cURL

curl -X POST "https://litelambda.in/crons/webhook/3c9b1f20-9428-48b0-810a-3a780b91e123/a84c81ef-92e1-4560-b98a-211f43a99e01/" \
     -H "Content-Type: application/json" \
     -d '{"event": "deployment_success", "branch": "main", "commit": "8f3a12b"}'

Triggering with Python (requests)

import requests

webhook_url = "https://litelambda.in/crons/webhook/3c9b1f20-9428-48b0-810a-3a780b91e123/a84c81ef-92e1-4560-b98a-211f43a99e01/"

payload = {
    "user_id": 42,
    "action": "recompute_kpi",
    "requested_by": "backend_api"
}

response = requests.post(webhook_url, json=payload, timeout=10)
print(response.json())
# Output: {"status": "success", "message": "Job triggered successfully."}

Accessing the POST Payload in your Script

LiteLambda automatically makes your POST payload accessible inside your Python code using two straightforward methods:

Method 1: Direct via the event Parameter (Recommended)

def handler(event, context):
    # If triggered via Webhook, `event` is the parsed JSON dictionary
    event_type = event.get("event")
    user_id = event.get("user_id")
    
    print(f"Triggered by webhook! Event: {event_type}, User ID: {user_id}")
    
    return {"status": "processed", "user": user_id}

Method 2: Via Environment Variable

import os
import json

def handler(event, context):
    raw = os.environ.get("LITELAMBDA_PAYLOAD", "{}")
    payload = json.loads(raw)
    
    print(f"Received payload: {payload}")
    return {"status": "ok"}
---

Trigger Metadata & Logs

When reviewing executions in the Logs view, each execution displays a dedicated trigger badge:

  • ⏰ Cron — Run automatically by Celery Beat on your cron schedule.
  • 🔗 Webhook — Triggered externally via HTTP POST with custom payload.
  • ▶️ Manual — Triggered directly by you via the Dashboard or LiteLambda CLI.

Need help setting up alerts?

Feel free to reach out to us at [email protected] or message us on Twitter/X.