← All articles Reliability

How to run and schedule an AI agent that works unattended in production

OBTO Team · Updated 21 October 2026

To run an AI agent unattended you need four things a chat window gives you for free. A trigger that fires when nobody is typing. A record of what each run did. A way to find out that a run failed. A number for what the run cost. The model is the smallest item on that list. This page takes the four in order and shows how each one works on OBTO, including the parts OBTO leaves to you.

1. The trigger: a scheduled job

Three places can hold the schedule.

On OBTO the third option is a scheduled job record. It holds a cron expression or an interval such as every 5 minutes, a timezone, and the script to run. The platform scheduler runs it on worker pods, so the job runs whether or not anyone is signed in. A new job is created switched off and is turned on in a separate step, after someone has read it. Today the OBTO team sets up and activates these jobs on request; the self-serve tool for them is limited to platform operators. Most teams begin with the second option, a scheduled task in their client that calls OBTO's MCP tools or API routes, and move the schedule onto the platform once the job has settled.

2. What the job is allowed to do

Unattended runs repeat, overlap and fail halfway. Anything that is unsafe to do twice becomes a hazard, so split the work by how hard it is to undo. Drafting, tagging, moving rows into a holding table and opening a proposal can run at night with nobody around. Refunds, deletes, customer emails and payments go on a queue a person clears in the morning. The agent gets most of its work done, and the few actions that are expensive to get wrong still wait for a human.

Give the job one default for doubt. When a precondition fails or confidence is low, it writes up what it found and what it would have done, then stops. A report you read over coffee costs less than a wrong action you reverse at noon.

Writes should be safe to repeat. On OBTO an agent can name each write with an idempotency key. A retry that carries the same key gets the stored receipt back instead of writing again, so a timed-out call that did land is never applied twice. An edit can also carry the hash of the text the agent last read; if the stored text has changed since, the edit is refused and nothing is written. Both checks run on the server, when the agent supplies the key or the hash. The write that knows it already ran covers the design.

3. The receipt: where each run lands

An unattended run is only as good as the record it leaves. On OBTO three records exist by default.

Output printed inside a job script is not kept. If you want a line in the record, write a row or throw an error.

4. How you find out it failed

An error thrown inside an OBTO scheduled job is logged under the job's name, and the job's failure count goes up with the reason attached. Read the app logs with the jobs flag set and you get the scheduler's view of every job in the app: last run, last finish, next run, failures. OBTO does not send you a page or an email when a job fails today. The reading is on you, or on an agent you point at it. Two habits make that workable. Pick a cadence you will look at, since a daily job you read beats an hourly one you ignore. And make the job loud on failure: throw rather than swallow, so the count moves.

A run that hangs is the worst case, because it neither finishes nor throws. Keep each run short, make its steps independent, and let the scheduler's own completion fallback close a run that forgot to.

5. What a run costs

OBTO bills a flat price per deployed application and does not meter tokens or requests. The model spend stays on your own API key or your AI client's subscription. So the cost of an unattended run on OBTO is the model provider's charge for that run, plus nothing from OBTO per run. The usage rows give you the volume side, calls per day and handler time per tool, which is what you need to notice a job that started calling ten times more often than it should. Turning that into a per-run number is the subject of know your AI cost per run.

If the agent has to run inside your network

"Self-hosted AI agents" means one of three things: the agent and its data stay in your network, you control the upgrades, or you can leave with your work. OBTO is a managed cloud by default and offers the first two on the Enterprise plan: bring your own models, and self-hosting by separate agreement. There is no binary to download and run on the standard plans. The third promise holds on every plan, because an OBTO app is a set of records you can query and export. The self-hosted agent platforms guide compares the open-source frameworks, the batteries-included platforms and the managed options on those three promises.

A checklist before the first unattended night

  1. The schedule lives somewhere that stays up without you.
  2. The job can only reach the tools it needs, and the irreversible ones are off its list.
  3. Every write is idempotent or guarded by the hash of what the agent read.
  4. You know which row to open in the morning, and what a healthy one looks like.
  5. A failure raises a count you check, and the job throws rather than prints.
  6. You know the run's model cost and its call volume for one normal day.

FAQ

Can you run an AI agent on a cron schedule?

Yes. A cron entry, a scheduled task in Claude or Claude Code, or a scheduled job on the platform the agent works in can all start the run. The scheduler is the easy part. The record of the run, the failure signal and the cost per run are what make the schedule safe to leave alone.

How do I know an unattended AI agent run failed?

Have the job throw on failure instead of printing, and read a failure count rather than a log. On OBTO each scheduled job carries its last run, next run, failure count and last failure reason, and each run writes a job-run row. OBTO does not send alerts today, so put the check on your own calendar or on an agent.

What does an unattended run cost on OBTO?

OBTO charges a flat price per deployed app and does not meter tokens or calls. The run's cost is your model provider's charge for that run. Daily usage rows show calls and handler time per tool so you can see the volume.

Can OBTO run the agent inside my own network?

On the Enterprise plan OBTO offers bring-your-own models and self-hosting by separate agreement. Standard plans run on OBTO's cloud. On every plan the app is data you can export.

Start with one scheduled task

Point a scheduled task in Claude or Claude Code at OBTO's MCP endpoint, give it one reversible job, and read the usage rows the next morning.

Get started

More from the OBTO blog