Skip to content

Routines: Scheduled and Event-Triggered Automation (with Webhooks) ​

The previous lesson saved the method as Skills and Teaching. This lesson adds a timer to it: a routine tells a Bot when to run automatically — on a schedule (every weekday at 8 AM, every 2 hours), or triggered by events (Slack messages, GitHub / Linear / Sentry / PagerDuty events, new email to the Bot's inbox, webhook calls). If you've searched for "Grok Bot scheduled tasks," this is probably the capability you wanted. It doesn't require building a workflow in a settings panel: you create a routine simply by saying something to the Bot.

The main thread of Workflow Guide completes its final step here: first get it done once → save it as a skill → then hand it to a routine to run automatically. The official docs repeatedly stress not to skip steps — make the one-off task reliable first, then automate it.

Two things to remember up front: routines run on a cloud computer, so they keep going even when you close your laptop; every run consumes your weekly usage pool, so trigger scope and frequency need to be designed — more is not always better.

The whole process takes about 14 minutes. Creation and editing can be done in chat; viewing Test and the three webhook fields requires the desktop app.

What You'll Be Able to Do After This Lesson ​

  • Create a scheduled routine for a Bot with a single conversation, and check all 6 confirmation items required by the official docs: the responsible Bot, schedule and time zone, input sources, expected results, approval boundaries, and the missing-source strategy
  • Have routines run automatically when events occur: Slack messages, GitHub / Linear / Sentry / PagerDuty events, new email to the Bot's inbox, webhook calls
  • Configure a webhook for a routine: get the POST to / key / header trio, trigger it with a single curl, and know that a return of 200 only means "accepted"
  • Verify a new routine immediately with Test instead of waiting for the next scheduled time (testing requires the desktop app, and it performs real work)
  • Manage and troubleshoot: pause, edit, delete, view Run history, and keep the quota math in mind — ≤50 routines per Bot, ≥5 minute intervals, 300 / 200 runs per hour

Your Current Struggle ​

  • "Every morning I have to manually send 'help me summarize yesterday's tickets,' and if I forget, there's no briefing" — the task is done right, but a human still has to trigger it every day
  • "I want the Bot to start working automatically when someone says needs repro in Slack, but I don't know where to configure it" — the trigger condition is in your head, not turned into the Bot's schedule
  • "I set up a routine that runs every hour, and my weekly usage ran dry in two days, constantly hitting rate limits" — the automation runs, but I never did the math on usage and quotas

When to Use This Technique ​

When you need to:

  • Hand a task that already works (ideally saved as a skill) to a Bot to run automatically on a schedule or on events
  • Let external systems (CI, monitoring alerts, form services, your own scripts) wake up a Bot with a single HTTP call
  • Have tasks keep running after you close your laptop — routines run on a cloud computer and don't depend on your computer being on

And you don't want to:

  • Manually send the same instruction every day
  • Cobble together your own scheduling system with third-party scheduler tools and scripts
  • Put an unverified process straight into automatic runs

🎒 Before You Start ​

  • Completed Skills and Teaching: Saving Successful Tasks as Reusable Skills — the official order is to first get a one-off task working, save it as a skill, and only then automate; this lesson consumes that result directly
  • Have a task on hand you want to automate, and one you've run correctly by hand at least once (haven't run it right yet? Go back to the previous lesson first)
  • The apps the task needs are already connected (Slack, Gmail, Calendar, etc.) — event-triggered integrations are connected to the Cursor account that owns this Bot
  • Have the desktop app at hand — Test and the three webhook fields are viewed in the desktop app; mobile can view Run history, pause, and delete, but testing requires the desktop version
  • Know how to check your weekly usage pool (Subscriptions and Pricing) — every run costs usage

Core Idea ​

A routine answers only one question: when this Bot runs automatically. What it runs comes from its Instruction — usually the skill saved in the previous lesson, or a clearly written process.

What it answersExample
skillHow to do itThe steps and boundaries of the "weekly customer health check"
routineWhen to run"Every weekday at 8:00, run once"

Remember it in one sentence: a skill is a recipe, a routine is an alarm clock.

Five trigger types (all written in the routine's When to run):

Trigger typeWhen it runs
ScheduledRuns on the schedule you specify: every weekday at 8:00 AM, every 2 hours
Slack messageThe Bot is mentioned, a certain word or phrase appears, you react with an emoji, or any message; can watch one channel or all of Slack
Tool eventsEvents from GitHub, Linear, Sentry, PagerDuty, such as When a Linear issue is created
EmailNew messages sent to the Bot's dedicated inbox; can be filtered by sender or an entire domain, but not by subject
WebhookAny system sends an HTTP POST to the routine's URL

Three design principles, which every step below will use:

  1. Narrow first, then broad: the narrower the trigger scope, the better—the official docs explicitly say broad listeners (like "every new message") create noise, consume usage, and are prone to acting on irrelevant input.
  2. Prepare first, execute later: have the Bot draft, verify, and suggest first; consequential actions like sending, purchasing, deleting, publishing, or modifying production systems stay behind approvals.
  3. Plan for failure: what strategy to use when source data is missing (report an error instead of forcing a calculation with stale data)—this is one of the 6 items the official docs require you to confirm at creation time.

💡 Event triggers go through Cursor account integrations

Events like Slack messages and email are launched by Cursor account integrations, which are separate from the connected apps for Slack and GitHub and may need to be connected individually. Before relying on a Slack trigger, first connect Slack on the Cursor account that owns the Bot.

Follow along ​

Step 1: Create a routine in one conversation (Grok Bot scheduled task) ​

Why: Grok Bot's setup philosophy is "setup is a message, not a workflow builder"—routines work the same way: just explain it in chat to the Bot that should own it.

Say it to the Bot that owns this work. Official example:

Every weekday at 8:00 AM, run the Daily customer-risk skill against the current account list. Post a linked watch list in this conversation. Do not contact customers. If the source data is unavailable, report the failure instead of using old data.

(Every weekday at 8:00, run the "Daily customer-risk" skill against the current customer list and post the watch list with links to this conversation. Do not contact customers. If the source data is unavailable, report a failure; do not use stale data.)

The density of this example is worth copying verbatim: time (weekdays 8:00), what to run (name the skill), input (the current customer list), where the result goes (this conversation), approval boundaries (do not contact customers), failure strategy (report an error, don't use stale data)—six things covered in one breath.

After the Bot creates it, check off the 6 confirmation items the official docs require, one by one:

#Confirmation itemSelf-check
1Owning BotIs it the Bot you're currently talking to
2Schedule and time zoneIs the time right; verify the time zone in the next step
3Input sourceWhere the data comes from
4Expected resultWhat the output looks like and where it's posted
5Approval boundariesWhich actions must stop and wait for you
6What to do when the source is missingReport an error or skip—don't let it force a calculation with stale data

You can also create one on mobile: open the Bot's profile, and under Routines tap Add routine—Grok the Bot will start a message beginning with "Set up a routine to"; just complete that sentence and send it.

You should see: the Bot confirms creation, and the routine appears in this Bot's routines list (desktop: click the Bot name at the top of the chat → the Details tab).

  • 6 confirmation items all check out, especially the approval boundaries and the failure strategy

Step 2: Verify When to run: time, time zone, and trigger conditions ​

Why: natural-language schedules are easy to write and easy to get wrong—is "every day at 8 o'clock" your 8 o'clock or another time zone's 8 o'clock? If you get it wrong, the routine will run at the wrong time for a whole week.

Write the schedule in plain language, e.g. every weekday at 8:00 AM or every 2 hours. Then open the routine and check When to run—it shows the saved schedule in words; if it doesn't match your intent, select Edit and tell the Bot what to change.

The time zone is set here: Settings → Bot → Timezone.

OptionBehaviorWhen to use it
Auto-detectFollows this computerThe routine runs on the local time wherever you are
Manually pick a time zoneFixed in placeWhen the work belongs to an office in another time zone

The easiest timing pitfall to fall into: a newly created routine does not run immediately. It waits for the next scheduled time slot—8:05 if you create a routine for "every day at 8:00," its first run istomorrow at 8:00. To verify right away, use the Test in the next step.

You should see: the schedule text shown in When to run matches your intent, and the time zone is correct.

  • The text schedule in When to run matches your intent

Step 3: Use Test to verify immediately, without waiting for the next time slot ​

Why: discovering at 8 o'clock tomorrow that the routine ran wrong wastes an entire day; Test lets you see the results right now.

Open the routine in thedesktop app and select Test (testing a routine requires the desktop app; it is not available on mobile).

You should see:

  • The button shows Running… until the run finishes, and the result appears in the Bot's chat
  • If the test cannot start, you will see Couldn't start a test run, or a message explaining the reason

Some routines do not show Test—they still run on schedule or on trigger; for these, have the Bot do the same work once in the chat with a piece ofsafe input.

⚠️ Test performs real work

A test run will actually browse websites, modify files, and call connected tools. Use safe input, and keep write operations behind approvals.

After the run finishes, check 5 items against the official checklist:

  • It used thecurrentinput, not stale data
  • The output matches the required format
  • Every action has a source or audit trail
  • It stopped at the designated approval points
  • The failure status is explicit—if it failed, it says so rather than staying silent

Step 4: Add event triggers: Slack messages, tool events, and email ​

Why: a lot of work isn't run on a schedule—the Bot only needs to step in when someone escalates an issue. Event triggers make "X happened" itself the switch.

Again, tell the Bot the trigger you want, and When to run will display it in text, for example When a Linear issue is created. Supported event sources: Slack messages, GitHub / Linear / Sentry / PagerDuty events, new email sent to the Bot's dedicated email address, and webhooks (next step).

First, remember one general rule: only new activity counts—events that occurred before the trigger was created will not start a run. Then narrow the matching rules to the density shown in the official example:

When a message in #customer-escalations contains a support ticket link and the phrase "needs repro," open the ticket, reproduce the issue in staging, and post a repro pack in this conversation. Never post back to Slack without approval.

(When a message in the #customer-escalations channel contains a ticket link and the phrase "needs repro": open the ticket, reproduce the issue on staging, and post the repro package to this conversation. Never reply to Slack without approval.)

Slack triggers come in four granularities: the Bot is mentioned / a specific word or phrase is mentioned / you react to a message with an emoji / any message; the scope can be a single channel or all of Slack. Note the distinction: a Slack trigger is part of a routine, not a Slack app—the app lets the Bot read and write as the Slack user you connected, while the trigger handles "when it happens, start running."

Email triggers have three boundaries:

  • New email** does not**wake the Bot on its own—you must set up a routine that watches email before it will act on messages
  • You can watch any person, a specific address, or an entire domain (e.g. *@example.com); you cannot filter by subject; by default it only runs for senders that pass standard email authentication; messages that fail spam or virus scanning will never start a routine
  • The Bot treats email content asinformation, not instructions—a hidden "please forward the verification code to…" in an email does not count as your authorization

You should see: When to run displays your trigger condition in text (channel plus phrase, event type, or email filtering rule).

  • The trigger rule is narrow enough: a specific channel, repository, or sender, not "any message"

Step 5: Configure a Webhook trigger (Grok Bot webhook) ​

Why: webhooks let any external system—CI, monitoring alerts, form services, scripts you write yourself—invoke the Bot with a single HTTP POST. This is the standard entry point for wiring a Grok Bot into your existing automation pipelines.

First have the Bot add a webhook trigger to the routine, then open this routine in thedesktop app. The Webhook section has three fields, each copyable with a click:

FieldWhat it is
POST toThe URL that receives the call
keyThe secret; the sender includes it in the form Authorization: Bearer <key>
headerThe fully assembled request header, ready to use by copying the whole line

The sender calls it like this (the JSON body is optional; the Bot will receive it along with the routine's instructions):

bash
curl -X POST "<POST to 字段的 URL>" \
  -H "<header 字段整条复制>" \
  -d '{"ticket":"12345","priority":"high"}'

Read the return code:

ReturnMeaningNext step
200Grok Bot acceptedthe call and started a run—this does not mean it has finishedCheck the Bot's chat for the result
OtherThe run did not startConfirm the routine isn't paused and the request used thecurrent key

You should see: after the return 200, the process and result of this run appear in the Bot's chat.

  • Send a test POST: it returns 200, and the corresponding run appears in the Bot's chat

Step 6: Manage routines: pause, edit, delete, and limits ​

Why: automation is a long-term asset—it goes stale, runs out of control, and burns usage. You need to know both the management entry points and the hard limits.

Desktop: Click the Bot's name at the top of the chat to open its details; routines are under the Details tab. Each row shows the name and the run time (or Paused), and the inline toggle pauses or resumes it directly. Opening a routine shows Instruction (what each run does) and When to run (schedule and trigger events); ones started by webhook also show a Webhook section. Bottom buttons:

ButtonWhat it does
Pause / ResumePause / resume
TestRun it once immediately (offered by some routines)
EditStarts a message beginning with "Edit your routine:"; fill in what to change and send it
Delete routine (trash can icon)Deletes, with confirmation required; cannot be undone, and all future runs stop

Right-clicking a routine also gives Pause / Resume, Test, Edit, Delete. When a Bot has no routines yet, the list shows Ask in chat to set a routine.

Mobile: Bot's profile → Routines. Tapping it shows Active, Schedule, Next run, Instruction, and Run history; turning off Active pauses it, and swiping a row deletes it. Run history marks each run as Running / Succeeded / Failed, with a reason for failures; No runs yet means nothing has started it yet.

Hard limits and records:

Limit itemValue
Routines per BotAt most 50
Scheduling intervalAt least 5 minutes
Rate: all your routines combinedAt most 300 per hour
Rate: a single routineAt most 200 per hour
Run recordsThe most recent 20 kept per routine

Runs that exceed the rate limit fail with Automation run rate limit exceeded. Also, deleting a Bot also deletes the routines it owns.

One more thing that's easy to miss: after a long period without use, Grok the Bot may** ask you whether to keep routines running**, and not responding may pause them — remember to check for paused routines when you come back.

You should see: You can find any Bot's routine list in 3 steps and say when it will run next.

Checkpoint ✅ ​

  • You can create a routine in one sentence, and all 6 items check out (responsible Bot / schedule and time zone / input sources / expected results / approval boundaries / missing-data strategy)
  • You know a newly created routine doesn't run first until the next scheduled time; verify with the desktop Test, and the test does real work
  • Event-trigger rules are narrow enough, and you know only new activity after the trigger was created counts
  • You can configure and test the three webhook fields (POST to / key / header); 200 = accepted ≠ completed
  • You know the limits by heart: per Bot ≤50, scheduling interval ≥5 minutes, per hour 300 combined / 200 per single routine

Pitfall reminders ​

❌ Treating a webhook returning 200 as the task being done ​

Symptom: Your system receives 200, marks it "processed", but the Bot is actually still running on its side, possibly without finishing the expected action.

Cause: 200 means the Grok Bot accepted the call and started a run, not that the Bot finished the instruction.

Correct approach: Treat 200 as "accepted" and confirm the result in the Bot's chat. Only a non-200 means it didn't start — check whether the routine is paused or the key is the current one.

❌ Hitting Automation run rate limit exceeded ​

Symptom: The routine fails frequently, and the reason in Run history says Automation run rate limit exceeded, but by your own math your frequency doesn't seem to exceed it.

Cause: Two possibilities. You really exceeded it — all routines combined 300 per hour, a single one 200 per hour; or you hit a limit shared by all Grok Bot routines — officially confirmed as a known issue, so you can be affected even if your own frequency is low.

Correct approach: If you really exceeded it, have the Bot narrow the triggers or loosen the schedule; if hit by the shared limit, wait a bit and run again. Failed runs are not retried automatically — rerun it yourself with Test, or for webhooks, send the call again.

❌ A routine's approval card sits for 30 minutes with no response, and the action quietly doesn't happen ​

Symptom: In the morning you check the routine's results and find the last step didn't run; an Expired card is sitting in the chat.

Why: Approval cards for work you start in a chat will wait for you indefinitely; but cards invoked by a routine, trigger, or other background work expire after 30 minutes, and once expired, that action will not run.

The right approach: Turn on Notifications for the Bot that runs the routine; for trusted actions, choose Always allow and save it as a rule; if something expires, have the Bot retry the task. For how to draw the boundary, see Approvals and Auto Review.

❌ Usage burning faster than expected ​

Symptom: On Monday you still had most of your weekly usage left; by Tuesday it was gone.

Why: Every run consumes usage. An hourly run, very short intervals, or Slack triggers in busy channels can burn through a week's worth of usage in a single day. A routine that never runs costs nothing, but Test does cost—it actually does the work.

The right approach: First pause the routines you don't need, then have the Bot loosen schedules and narrow Slack triggers; only if that isn't enough should you consider upgrading your plan or adjusting on-demand limits. For how the usage pool is counted, see Subscriptions and Pricing.

Advanced tips (optional) ​

Add a "trust design" layer to your routines. The official guidance provides 7 trust principles for automation—review them before creating one:

#PrincipleIn one sentence
1Automate preparation before automating executionStart with summarizing and drafting; send and make changes later
2Have the Bot draft, verify, and suggest firstProduce reviewable output rather than acting directly
3Sending, purchasing, deleting, publishing, or changing production systems requires approvalKeep high-consequence actions behind approvals
4Write clear policies for missing and stale dataIf there's no data, report an error—don't force calculations with old data
5Make retries idempotent where possibleRe-running once shouldn't cause the side effect twice
6Tell the Bot where to report partial completionWork in progress must be visible
7Re-test when the website, app, or source format changesAutomations go stale quietly

When it doesn't run, troubleshoot using the official checklist. Check these 6 items first:

  • It isn't Paused (on mobile, Active is on)
  • When to run schedule and timezone match your expectations
  • The Bot that owns it still exists
  • The required plugins are still authenticated
  • The cloud computer can reach the source system
  • Usage or account access hasn't been suspended

For event-triggered ones, also confirm that the source channel, repository, and matching rules are still valid. Everything checks out but it hasn't run for over 24 hours with no error? Report a bug with the Bot name and routine details. For more error cross-references, see Error Quick Reference.

Email plus routines is an unattended inbox-processing pipeline. Set inbox rules (by sender or domain) as routine triggers, and bills or notifications arriving at the Bot's mailbox get archived and summarized automatically; meanwhile, emails sent by a routine are always saved as drafts waiting for your Send—no unattended sending. For the full walkthrough, see Bot-dedicated Mailbox and Email Digest in Practice.

Lesson Summary ​

✅ Grok Bot scheduled tasks are created through a conversation: tell the responsible Bot the timing, what to run, the inputs, where results go, approval boundaries, and failure strategy, then verify against 6 items.

✅ State schedules in natural language; the timezone is under Settings → Bot → Timezone (Auto-detect follows your device). A newly created routine waits for the next scheduled time before its first run; verify with the desktop Test—testing does real work.

✅ Event triggers cover Slack messages, GitHub / Linear / Sentry / PagerDuty events, new mail in the Bot's mailbox, and webhooks; only new activity counts, and rules should be narrow rather than broad.

✅ Webhook has three fields: POST to (URL), key (Authorization: Bearer), header (copy the whole thing); a return of 200 means accepted and a run has started, not that it finished.

✅ Limits: ≤50 routines per Bot, schedule intervals ≥5 minutes, 300 runs per hour combined / 200 for a single one, the most recent 20 run records retained; failed runs are not retried automatically.

Quick reference for key locations:

Field / LocationUsage
Settings → Bot → TimezoneScheduling timezone; Auto-detect follows your device
routine → When to runShows the schedule and trigger in text; if it doesn't match, use Edit
routine → WebhookPOST to / key / header, three fields, click to copy
Bot details → Details → RoutinesPause / resume, Test, Edit, Delete
Mobile Bot profile → RoutinesActive toggle, Run history, swipe to delete

Next Lesson Preview ​

Routines follow the Bot. In the next lesson, we'll package a configured Bot and share it: Bot Templates: Sharing Configured Bots with Your Team.

You will learn:

  • Share → Create a copy → Publish → Copy link—four steps to publish a Bot as a template
  • The public link exposes identity, description, skills, and routines—check before publishing
  • The exact error messages and fixes when your team has disabled template sharing
  • Enter the template library from Connect apps → Bot templates

Related Tutorials ​

gaodong.aiAboutPrivacyContact

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.