Guide · Routines
Schedule an AI coding agent on your computer with cron
A routine is a saved prompt that runs on a schedule, on the computer where AgentPort is installed. This guide covers creating one, picking a cron time, choosing a permission mode, and reading the chat when it finishes.
What you need
- An AgentPort account and a computer that already runs it: a PC, a mini PC, or a VPS with Docker. Setup: Run Grok Build on your VPS or Use Google Antigravity remotely.
- AgentPort 0.10.0 or newer on that computer (out since 3 November 2026). The Routines tab appears only then. If it is missing, open the computer's settings, go to Software, and update, or run
bash ~/.agentport/update-node.shon the machine. - Grok or Antigravity signed in under AI Model. The form tells you when that login is missing.
- A machine that stays powered on. A sleeping laptop does not run the schedule.
The Free plan covers 1 computer. Pro is $27/month for up to 3. You pay the AI provider yourself. See pricing.
Create a routine
Open the computer, click the Routines tab, then Add a routine. You save a prompt, an assistant, a folder, and a permission mode.
- Name. A label for the list, such as Weekday build check.
- What should it do? The prompt, written the way you would type it in chat. That text is what gets sent.
- Assistant. Grok (Grok Build) or Antigravity. Codex CLI and Claude Code are not listed yet. They are on the roadmap.
- Folder. The project. On a normal install those folders are under
~/agentport-workspaces. That Docker layout is covered in Self-hosted AI coding agent on your own server with Docker.
A morning prompt can report what changed since yesterday and whether tests look healthy. A nightly one can run tests and try a small fix on a branch, without pushing. Summarizing open pull requests needs the GitHub CLI signed in under Connectors. The agent only has that folder and those logins.
Pick a schedule
Under When, use a preset or type the cron line. Timezone starts as your browser's zone. The run is second 0 of that local minute.
- Every hour fires at minute 0.
- Weekday mornings and Every day use the Time field. Weekdays are Monday through Friday.
- Custom is the box labeled Five numbers: minute, hour, day, month, weekday.
*means every.
Weekday mornings at 09:00, every day at 21:30, and every hour:
Copy this and paste it on that computer. You do not need to type it by hand.
0 9 * * 1-5
30 21 * * *
0 * * * *Sunday is 0 or 7. Six fields and names such as JAN are rejected. If both the day-of-month and the weekday are restricted, either one can match. Read Next three times before you save. On a clock change, a missing local time is skipped and a repeated hour fires once.
The schedule runs on your computer, not on Cloudflare, and it survives a restart and update-node.sh. Run now does not move the next time. Switching the routine off and on again schedules only the next future slot.
Choose a permission mode
The field How much can it do on its own? saves Auto or Always approve. Ask first is not available, because nobody is there to tap Allow.
For Grok, both modes are listed. Auto still waits on edits and commands until you answer the card. Use Always approve when the job must edit or run tools while you are away. Keep the work in git and read the diff before you push.
For Antigravity the editor lists only Always approve. It cannot pause for a yes, and Auto would skip commands that need approval. The form says Antigravity can't pause, so this uses Always approve. Pick that when the job needs tools.
Where it runs
The agent runs in Docker on your computer. The browser connects straight to that machine over a secure WebSocket. The cloud handles sign-in, your plan, and the machine list. The cron, the prompt, and the chat stay on the computer. Close the tab and open the same chat later from a phone: Use an AI coding agent from your phone.
Read the result
Each run is one normal chat. History shows the status, the time in that timezone, and a short answer. Open chat continues the session. The list keeps the last 50 runs. Finished completed the turn. Didn't finish is an error or a restart mid-run. Stopped was cancelled. Skipped means that routine was already running. Missed means the computer was away too long to catch up. Missed and skipped rows have no chat. Two routine runs can go at once on one computer.
Peaceful mode only quiets the chat you open, and it leaves the routine's saved permission mode as it is.
The computer has to stay on
The timer sits in AgentPort on that machine. Sleep or shutdown pauses it. Back within an hour, it runs the latest missed slot once. A longer gap is a single Missed row.
Closing the laptop only works when the agent is on some other machine that stays awake. The laptop, or a phone, is then just the window. That setup is in Keep Grok Build running after you close your laptop. If you prefer running non-interactive scripts or standard crontabs directly without AgentPort, see How to run Grok Build headless (non-interactive): scripts, cron and CI.
A webhook can start one too
Since AgentPort 0.11.0 (9 November 2026), the same Routines tab can start a routine from an HTTP call. Under How it starts, choose Webhook, then save. The secret, the public URL, and what GitHub and Stripe can send are in Trigger an AI coding agent from a GitHub or Stripe webhook. You still read the outcome in History.
FAQ
Does the routine keep running if I close the browser?
Yes. The schedule and the agent live on your computer. Open AgentPort later, including from a phone, and use Open chat. The computer still has to stay on.
What happens if the computer is off at the scheduled time?
Back within an hour, it runs the latest missed slot once. A longer gap is one Missed row, not a stack of catch-up runs.
Why can't I save Ask first on a routine?
Ask first waits for an approval. The form only saves Auto or Always approve. On Grok, an approval card waits until you answer. You can also choose Allow for this chat or Always allow for a narrow action, such as saving files under one folder.
Which permission mode should an Antigravity routine use?
Always approve. Auto is not offered, because Antigravity cannot pause for a yes and would skip commands that need approval. Read the git diff when you are back.
Can a webhook start a routine today?
Yes, on AgentPort 0.11.0 or newer. Choose Webhook under How it starts and save. The walkthrough is Trigger an AI coding agent from a GitHub or Stripe webhook. Version 0.10.0 only runs a cron schedule, and that editor has no webhook setup.
Will an update delete my routines?
No. update-node.sh replaces the container and keeps the data volume that holds routines and chats. Grok and Antigravity logins stay on the computer too.
Can I schedule Codex CLI or Claude Code this way?
Not inside AgentPort yet. The Assistant menu is Grok and Antigravity. Both CLIs are on the roadmap. On your own server, see Run Codex CLI and Claude Code on a VPS, and use them from your phone.
Does AgentPort's cloud see the prompt or the answer?
No. The browser connects straight to your computer. The cloud keeps sign-in, the plan, and the machine list. The prompt and the chat stay on that machine.
Try it on your own computer
The Free plan covers 1 computer. Pro is $27/month for up to 3. You bring the AI login and pay that provider directly.