· Back to the setup

AI Setups That Work

Start a Grok Bot routine by webhook

Researched

What it does

Start a Grok Bot routine the moment a form entry, store order or CRM event arrives, using the routine's webhook URL and key, with sends kept behind approval.

Who it is for

Small-business owners whose form tool, store or CRM can send webhooks, and who want new leads or orders picked up right away instead of on the next scheduled run.

Tools

Steps

  1. Pick one event and one job, for example: a new quote form entry, logged and drafted as a reply. Then do the job once in a chat with the Bot, using a pasted sample entry, until the result is right. xAI's advice is to start with a one-time task, make it reliable, save it as a skill, and only then automate it.
  2. Save the method as a skill. Run the first part of the prompt below. A useful skill says when to use it, what inputs it needs, the order of work, how to check the result, what to return, and what needs approval.
  3. Ask the Bot to add a webhook trigger. Run the second part of the prompt below in the same chat. It asks for a routine that runs the skill on the JSON body the app sends, with a narrow rule for what to act on and what to do when fields are missing.
  4. On desktop, click the Bot's name at the top of the chat, open the Details tab and open the new routine. Its Webhook section shows three fields: POST to (the URL), key (the secret), and header (Authorization: Bearer followed by the key, ready to copy). Click a field to copy it.
  5. In the sending app, open its webhook settings (in a forms tool, a store or a CRM, it is usually under settings, integrations or notifications). Paste the POST to URL as the destination, choose POST, and add the header: the name Authorization with the value Bearer and the key, or the full header field if the app takes one line. Send a JSON body if the app offers it; the Bot receives the body with the routine instruction.
  6. Send one test: submit a test form entry, place a test order, or create a test record with no real customer details. If the app shows the reply, a 200 means Grok Bot accepted the call and started a run, not that the Bot has finished. Any other reply means no run started: check that the routine is not paused and that the call uses the current key.
  7. Check the result. Read the Bot's chat for the run's output. On the phone, open the Bot's profile, then Routines, tap the routine and read Run history: each recent run shows as Running, Succeeded or Failed, with the reason for a failed run. No runs yet means nothing has started it.
  8. Keep the approval. In Settings, General, under Bot, keep Auto-review on and add an Ask first rule for each action that sends or spends, such as "Ask first before sending any external email." xAI says email from a routine waits as a draft until you press Send.

The prompt

PART 1:
Save the process we just used as a skill called "[SKILL NAME, e.g. New quote request]". Include: when to use it; the inputs it needs (the fields a [form entry / store order / CRM record] sends, such as [FIELD NAMES]); the order of work; how to check the result; what to return in this chat; and the rule that anything that sends, posts, books or spends waits for my approval. Show me the skill before you save it.

PART 2:
Add a routine with a webhook trigger that runs the "[SKILL NAME]" skill on the JSON body each call sends. Only act when the body is a [new form entry / new order / new deal] with [REQUIRED FIELD]; otherwise, report what arrived and stop. If a required field is missing, say which one and do not guess. Post the result in this chat. Do not send, post, book or spend anything without my approval. Never repeat the webhook key in chat. Then tell me where to find the routine's Webhook section.

Tips

Sources