Stop Paying the Bot to Check Empty Email: A Free Apps Script Watches Gmail and Wakes Grok Bot Only When Mail Arrives
- Level Intermediate
- Setup1–3 hrs (estimated)
- Evidence Anecdotal
- CostNot stated in source
- No-codeYes
What did they do with Grok Bot?
His Grok Bot checked Gmail four times every weekday, and most runs found nothing but still used credits. So he split the job: a free Google Apps Script checks one Gmail label every 30 minutes on weekdays and only calls the bot's webhook when there's genuinely new mail, passing sender, subject and snippet. A dry run caught a newsletter, so they added -unsubscribe to the search. A daily health check emails him if the script hasn't run in 24 hours. Setup took about 15 minutes, and the bots wrote the code.
How it went
X post by @rajchudasama (Nov 9, 2026 UTC) with a 6-step setup: webhook-triggered routine, free Apps Script polling every 30 min on weekdays, dedupe, -unsubscribe filter after a dry run, daily health check, old schedule kept a week for comparison; about 15 minutes. Bio mentions his own hotel sales product, which the post doesn't pitch. Apps Script needs Gmail permissions on your account; read what it asks for before approving
Worth knowing
- X post by @rajchudasama (Nov 9, 2026 UTC) with a 6-step setup: webhook-triggered routine, free Apps Script polling every 30 min on weekdays, dedupe, -unsubscribe filter after a dry run, daily health check, old schedule kept a week for comparison; about 15 minutes. Bio mentions his own hotel sales product, which the post doesn't pitch.
- Apps Script needs Gmail permissions on your account; read what it asks for before approving.
Prompt
Cleaned version rewritten from the source — not a direct quote.
Switch my [Gmail routine] to a webhook trigger. Then write a Google Apps Script for my account that runs every 30 minutes on weekdays, searches Gmail for new messages with label [label] -unsubscribe, remembers what it already sent, and POSTs only new ones (sender, subject, snippet) to the webhook. Add a daily check that emails me if the script hasn't had a good run in 24 hours. Do a dry run and show me what it would have sent before turning it on.
Recommended
Try it in Grok Bot
- Copy the prompt (button below).
- Open Grok Bot chat and paste it. Replace any [bracketed] placeholders.
- Connect the listed tools (Gmail) as connectors when Grok Bot asks.
- If the task repeats, ask: "Make this a daily routine."
Alternatives: the same prompt works in Claude, ChatGPT Agent, OpenClaw.
Set it up
Tools: Gmail · Stack: Grok Bot
- Read the original source for full context.
- Connect the tools your agent needs.
- Paste the prompt and replace [bracketed] placeholders.
- Run once manually and check the output before scheduling it.
Generic suggested steps, not from the source.
Evidence
X post by @rajchudasama (Nov 9, 2026 UTC) with a 6-step setup: webhook-triggered routine, free Apps Script polling every 30 min on weekdays, dedupe, -unsubscribe filter after a dry run, daily health check, old schedule kept a week for comparison; about 15 minutes. Bio mentions his own hotel sales product, which the post doesn't pitch. Apps Script needs Gmail permissions on your account; read what it asks for before approving (as of 2026-11-09)
Source: X · 2026-11-09 · Verified by us: not yet · Report broken or outdated