Autopilot: wake your agent
Replies come in at night, and leads don't find themselves. Autopilot runs your own AI for you: when replies arrive, or on a schedule. Each routine is a brief your AI follows. Meerko starts the run, or checks that your AI's own schedule did, and shows how every run went. Meerko never runs a model: your AI, on your own plan, does the work.
Docs menu
How it works
Replies arrive
Or the time comes
Routines
Create routines in Autopilot, or ask your agent: manage_routine lists, creates, edits, pauses, resumes, deletes and runs them, and meerko routines does the same from the terminal. A routine has:
| Field | What it is |
|---|---|
| Name | What you call it. |
| Brief | What your AI does on each run, in plain words. Write it for a run with nobody to ask. |
| When | When new replies arrive (one such routine per workspace), or on a schedule: some weekdays at a time, in your time zone. |
Every run starts with your AI calling start_routine_run. That records the run and hands your AI the brief, so editing the brief in Meerko changes what the next run does, without touching your AI.
What starts a run
| Started by | How |
|---|---|
| Your AI's own schedule | You create a recurring task in your AI (for example a routine with a schedule at claude.ai/code/routines, or /schedule in Claude Code) with the Meerko connector (https://api.meerko.ai/mcp) and the prompt Autopilot shows. Meerko only checks the run came. Not for replies routines: your AI can't tell when replies arrive. |
| A Claude Code routine, started by Meerko | Meerko calls the routine's API trigger at each run. See below. |
| A ChatGPT task, started by Meerko | Meerko sends a routine.due event to the ChatGPT task subscribed to the routine. See below. |
| A webhook, called by Meerko | Meerko POSTs a signed event to your URL at each run. See below. |
Only a person signed in to the dashboard chooses what starts a routine, because that's where its token or URL goes. An agent can create and edit routines, but can't point one at a URL of its choosing.
What a woken agent can do
A reply is text from someone outside your company, and the agent woken for it reads it with nobody watching. So for a replies routine, give it a credential that can only check in, read replies, label them and save drafts:
| Credential | Where |
|---|---|
https://api.meerko.ai/mcp/drafter | The drafts-only MCP server, for a Claude Code routine's connector. It offers only the reply tools and start_routine_run. |
| Drafts-only API key | Create one under Settings → API keys for anything you call with a webhook. |
Either one is refused if it tries to approve a draft, send email, start a sequence, enrich leads or change settings. Approving stays with you. A scheduled routine that finds and enriches leads needs the full connector, https://api.meerko.ai/mcp.
Set up a Claude Code routine
Routines are Claude Code sessions that run in Anthropic's cloud with nobody at the keyboard. They're a research preview, need a Claude account with routines turned on, and run on your Claude plan.
Step 1: Create the routine in Claude
In Autopilot, open the routine's How it runs, choose Claude routine and copy the setup prompt. Paste it into a Claude chat, or run /schedule in Claude Code and paste it there: Claude creates the routine with the right connector and instructions, and links you to it. To create it yourself at claude.ai/code/routines, keep only the Meerko connector, add no repositories, and use the prompt Autopilot shows.
Step 2: Add an API trigger and paste it into Meerko
Only the routines page can make an API trigger's token, so this step is always yours. Open the routine at claude.ai/code/routines, choose Edit, add an API trigger and generate its token (it's shown once). Paste its URL and token into the routine in Autopilot, then click Run it now.
Meerko's message names the Meerko routine and, for replies, who wrote and the subjects. Claude treats that message as data, so the routine's own prompt tells it to call start_routine_run and follow the brief. Routines accept at most 30 API calls an hour, and Meerko starts a replies routine at most once every 5 minutes.
Start a ChatGPT task
ChatGPT can run a task when an app it's connected to sends it an event (MCP Events). Meerko offers one, routine.due, and sends it each time a routine whose trigger is ChatGPT should run: at its scheduled time, or when replies wait for a replies routine. It needs a ChatGPT plan with event-triggered tasks, and runs on that plan.
Step 1: Choose ChatGPT in Autopilot
In Autopilot, open the routine's How it runs, choose ChatGPT task and save. Autopilot then shows a prompt with the routine's id.
Step 2: Paste the prompt into ChatGPT
In a ChatGPT chat with the Meerko app connected (https://api.meerko.ai/mcp), paste the prompt. ChatGPT subscribes to routine.due for that routine; Meerko checks ChatGPT's callback answers before it accepts the subscription. Then click Run it now in Autopilot to check it.
The event names the routine and why it's due; the task calls start_routine_run and follows the brief. Each event is signed (Standard Webhooks). If no ChatGPT task is subscribed, the run shows failed to start and says so.
Use a webhook
Any agent that can be started by an HTTP request works: the Claude Agent SDK on your server, a CI job running claude -p or codex exec, or an n8n workflow. For a replies routine Meerko POSTs this JSON to your URL; a scheduled one sends "type": "routine.due" with due_at instead of replies.
{"id": "evt_5f0c…","type": "replies.waiting","created_at": "2026-10-16T07:02:00.000Z","reason": "replies","workspace": { "id": "8c1e…", "name": "Acme outbound" },"routine": { "id": "6a2d…", "name": "Answer new replies", "brief": "Classify each new reply…", "when": "replies" },"replies": [{"id": "3d9a…","from": "pia@slalom.example","subject": "Re: Quick question, Pia","received_at": "2026-10-16T06:58:41.000Z","sequence_id": "b71f…"}],"inbox_url": "https://meerko.ai/app/inbox","autopilot_url": "https://meerko.ai/app/autopilot"}
The payload has no reply text. Your agent fetches it with a drafts-only key.
| Header | Value |
|---|---|
meerko-signature | t=<unix seconds>,v1=<hex>, where v1 is the HMAC-SHA256 of <t>.<raw body> with your signing secret (whsec_…, shown once when you save the webhook). Reject old timestamps. |
URLs must be https and on the public internet. A self-hosted install can call its own network (a local n8n, say) with MEERKO_ALLOW_PRIVATE_HOOKS=1.
Example: the Claude Agent SDK
A small server that checks the signature, answers at once and runs a Claude agent with Meerko's drafts-only MCP server. It needs an Anthropic API key in ANTHROPIC_API_KEY.
import { createHmac, timingSafeEqual } from "node:crypto";import { createServer } from "node:http";import { query } from "@anthropic-ai/claude-agent-sdk";const SECRET = process.env.MEERKO_WEBHOOK_SECRET!; // whsec_… from Autopilotconst KEY = process.env.MEERKO_DRAFTS_KEY!; // a drafts-only mk_ keyfunction verified(header: string, body: string) {const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));if (!t || !v1 || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;const expected = createHmac("sha256", SECRET).update(`${t}.${body}`).digest("hex");return v1.length === expected.length && timingSafeEqual(Buffer.from(v1), Buffer.from(expected));}createServer(async (req, res) => {let body = "";for await (const chunk of req) body += chunk;if (!verified(String(req.headers["meerko-signature"] ?? ""), body)) return res.writeHead(401).end();res.writeHead(200).end(); // answer at once: Meerko waits 10 seconds at mostconst event = JSON.parse(body);if (event.type !== "replies.waiting") return;for await (const message of query({prompt: `Run Meerko routine ${event.routine.id}: call start_routine_run with that routine_id and follow the brief it returns. Never approve or send.`,options: {mcpServers: { meerko: { type: "http", url: "https://api.meerko.ai/mcp/drafter", headers: { authorization: `Bearer ${KEY}` } } },allowedTools: ["mcp__meerko__*"],},})) {if (message.type === "result") console.log(message.subtype);}}).listen(8080);
Runs, and runs that didn't happen
| Shown as | Meaning |
|---|---|
| ran | Your AI checked in with start_routine_run. |
| started | Meerko started it and the call was accepted; for replies, that's all Meerko waits for. |
| failed to start | Meerko's call failed. The reason is shown, e.g. Claude refusing an expired token. |
| no check-in | Meerko started a scheduled run, but your AI didn't check in within 3 hours. |
| missed | On your AI's own schedule, nothing checked in from 2 hours before the time to 6 hours after. |
Run it now starts a routine that Meerko starts, whatever the time. If Meerko itself was down at a scheduled time, it starts that run late, up to 6 hours after, and skips older ones rather than starting several at once. After a day of failed starts, Meerko pauses the routine and says why; fix it and resume it.
When Meerko starts replies routines
| Rule | Why |
|---|---|
| It waits until the oldest new reply is 2 minutes old. | A burst of replies becomes one run. |
| At most one start every 5 minutes. | Keeps routines under their hourly limit and your agent's bill small. |
| Each reply is announced once, after your trigger answers with a 2xx. | A failed start is retried later with the same replies. |
| Replies from before the routine was created are skipped. | Turning it on doesn't replay your history. |
| Bounces, unsubscribes and out-of-office replies never start it. | Meerko's rules handle those. |