Skip to content
Autonomous AI Agents GuideTry Kortix

Scheduled AI agents: the schedule is the easy part

Scheduled AI agents are the easy half of autonomy: a cron entry fires a session and nobody is at the keyboard. Kortix is the open-source CompanyOS. What decides whether you can leave the run going is the branch it works on, the tool rules it follows, and the merge permission around its change request.

The manifest that sets up an unattended run

A weekly report, written into the manifest as one trigger entry.

kortix.yaml
triggers:  - slug: weekly-report    name: Weekly report    on:      cron: "0 0 9 * * 1"      timezone: Europe/Berlin    run:      agent: support      prompt: Write the weekly support report for the last 7 days.
Source: https://kortix.com/docs/developers#triggers-keys

The schedule is the easy part

Running an autonomous AI agent unattended is mostly a question of what you checked before you stopped watching. A trigger starts agent work with nobody at the keyboard. It has two parts: a source, which decides when it fires, and a target, which decides what a fire does. What makes the run safe to leave alone sits around those two parts, in the branch it works on, the calls it may make, and the form its output takes. Kortix is my pick for a run you leave going, and I work on Kortix's marketing, so weigh that accordingly.

The agents, the skills, the memory and the connectors live as files in one git repo, so every setting here has a diff history. The run you leave going on Friday is the run you can read on Monday. If you have not picked the library that runs the loop yet, open-source AI agent frameworks covers that choice before the first fire.

Five sources of a trigger, and the evidence each one needs

Scheduled AI agents are the common case, and a cron expression is how you say when one runs. The trigger entry holds the expression, the zone and the prompt, and each slot opens a new session with nobody at the keyboard. The other four sources exist because the clock is a poor proxy for "there is something to do".

SourceFires when
ScheduleA time arrives, or a fixed period passes (cron, every, at, in).
App eventOne of your own Kortix Apps reports something.
Connector eventSomething happens in a connected app.
WebhookAnother system sends a signed request to the trigger's address.
Change request mergedA change request of the workspace merges, into one branch or any branch.

Choose by the evidence that already exists. A weekly report is about a period of time, so the calendar is the evidence and a schedule covers it. A form submission is a request, so the trigger is a webhook, and it carries a secret. Anything else your own software already knows can be reported by a Kortix App, and an App event reads that report. To react to something outside Kortix, use a webhook when the other system can send one. Otherwise, use a schedule that checks it.

The kinds also fail differently, and that matters more than the fire itself. A schedule pointed at the wrong branch produces an empty summary and nothing else. A schedule skips a run while its previous run is still going, so a check that takes longer than its own interval quietly drops fires. A webhook whose secret nobody wrote down fails at validation, before any sender is involved.

The expression is six fields, and the seconds field comes first

A schedule needs nothing outside the repository. The weekly-report entry is the whole thing: a slug, a name, the cron expression, the zone, and the agent and prompt the session opens with.

A 6-field cron expression, seconds first: "0 0 9 * * 1" is 09:00 every Monday. A trigger fires at most once every 60 seconds. The seconds field arrives first, so a five-field expression carried over from another scheduler does not land where its author expects. Every value sits in a different position here. Read the six positions in order once and the rest of the string is ordinary.

timezone holds the zone the expression is read in, which is how 0 0 9 * * 1 lands at nine in the morning for the people who read the report. It defaults to UTC. A run that should happen once, rather than on a cadence, skips the expression and sets on.at to a single instant instead.

Either way the trigger is an entry under triggers: in kortix.yaml, or in a file listed under imports:, which Kortix merges before it validates anything. What differs is the route a change takes. A kortix.yaml edited in a session follows that session's branch and its change request. A merge that touches triggers needs the permission the direct edit needs, project.trigger.create, .update or .delete.

A webhook without a signature is a start button for anyone

A webhook trigger fires when a signed request reaches its URL. A webhook also needs a signing secret, stored as a workspace secret. The manifest key is required rather than optional: on.webhook.secret names the secret that signs requests to the trigger's webhook, and the flat form spells it secret_env. The repository therefore holds a name, never a value.

That is the whole security model of the kind. The sender's job is small: post the body, attach a header, and the shared secret does the rest. An inbound webhook arrives at an address built from the workspace id and the trigger's slug, and it authenticates with the trigger secret rather than a Kortix token. A sender sends an HMAC signature in X-Kortix-Signature or X-Hub-Signature-256, or X-Kortix-Token, or Authorization: Bearer <secret>.

Two things about that secret can be wrong before any request arrives, and both surface in validation. The name has to be declared under env in kortix.yaml. Without that line, kortix validate and kortix ship report the trigger's secret_env as an error. The value itself is set in Secrets and never written into the manifest, because kortix.yaml is in Git.

Cap the runs before you leave

An uncapped trigger keeps starting sessions, and the count grows while nobody is watching. The usual cause is a webhook sender that retries on a timeout, or an App event that arrives in a batch after an outage. Each of those turns one session into forty while nobody is at the keyboard.

A trigger starts at most 60 runs an hour unless you set another limit under Options → Run limits. You can add a daily limit too. In the manifest the keys are max_runs_per_hour, default 60, and max_runs_per_day (triggers keys). Both belong in the trigger's entry next to the schedule, where a reviewer reads them in the same diff as everything else. A trigger that hits its hourly limit for 2 hours in a row pauses itself. That is the behavior you want from a loop, and it makes the pause visible instead of silent.

The minute floor is the other half of the same idea. A trigger fires at most once every 60 seconds, so a schedule written for every thirty seconds cannot be expressed at all. Nothing queues up behind a fire that fast.

What the person on the other end receives

An unattended run ends somewhere a person can act. Every session starts its own isolated cloud computer, called a sandbox. The agent works there on its own branch of the workspace's repository. By default, a session can push only to its own branch. The default branch keeps its shape while the run is in progress and after it finishes.

Then the work travels. When the agent finishes, it opens a change request: a request to merge that branch into the shared one. It appears on the Review page. A person reads the changes and approves, closes, or asks for changes. Merge is default-deny for agents, so the grant is what changes the answer. An agent that declares kortix_permissions merges only when the grant includes project.gitops.merge. An agent without kortix_permissions cannot merge. The rule for a session's own change request is narrower. A session cannot merge a change request it opened unless its grant in kortix.yaml includes project.gitops.merge. Without it, the merge returns 403 CR_SELF_MERGE_REFUSED. The reviewer reads a diff and can refuse it, and a refusal costs the default branch nothing, because the work never left its branch.

One more rule belongs here rather than with the schedule. If an automated session waits on a person, it waits at most 30 minutes, then stops. A run that asks for approval nobody grants does not hang for a day holding a sandbox, and the failure is visible on the Triggers page instead.

The self-host failure that looks like a healthy schedule

Self-hosting adds one way for an unattended run to do nothing without saying so. An instance started in domain mode (--domain <domain>) or tunnel mode (--tunnel cloudflare) starts sessions. Local mode, started with neither flag, binds 127.0.0.1 and starts no session because the sandbox cannot reach the API. The trigger exists and reads correctly, and the fire produces nothing.

That failure is worth knowing because it is invisible from the outside. It also explains the shape of the checks worth running. Each one asks what a person could confirm from the files, without waiting for a run to prove it.

The checks to run before you stop watching

  • The trigger names a kind you can point at, and the thing that fires it exists: a slot, a sender with the secret, or an App of yours that reports events.
  • The expression has six fields and a zone, and a one-off run uses on.at instead.
  • A webhook trigger has its signing secret, the name is declared under env, and the sender sends a signature or a bearer secret.
  • max_runs_per_hour and max_runs_per_day are both set, or a limit is set under Options → Run limits.
  • The merge grant is written where the agent reads it: without project.gitops.merge in kortix.yaml, a session cannot merge the change request it opened. The tool rules are written down for the calls that cannot be undone.

The clock is the part you configure in a minute. The five conditions around it are what you are actually trusting at 03:00.

Three pages go deeper on the pieces. What autonomous AI agents are sets out the three parts a definition needs to be checkable. Autonomous vs human in the loop places the person at one of three levels and shows what each costs. Autonomous agent examples shows the work these runs hand back, from a Monday digest to a signed request that becomes a record.

What holds a run you are not watching

Three settings to check before the first fire, and where each one lives.

Where the work landsa change request, merge by permission

Every tool callallow, ask or deny

Connector credentialsnever enter the machine

Questions that come up before the first fire

Add a cron trigger to kortix.yaml with a daily time in it. A 6-field cron expression, seconds first, so "0 0 9 * * *" is 09:00 every day, and on.timezone names the zone it fires in rather than leaving the trigger on UTC.

A signed request reaches the trigger's address, and that fire starts a session. A webhook also needs a signing secret, stored as a workspace secret, and the sender proves itself with an HMAC signature in X-Kortix-Signature or with Authorization: Bearer <secret>.

Set max_runs_per_hour and max_runs_per_day in the trigger's manifest entry, or under Options → Run limits. A trigger starts at most 60 runs an hour by default, and one that hits its hourly limit for 2 hours in a row pauses itself.

Onto a branch of its own, and then into a change request. Every session starts its own isolated cloud computer, called a sandbox. The agent works there on its own branch of the workspace's repository. Session work reaches main through a change request, and merge is default-deny for agents, so a session merges its own only when its agent's grant in kortix.yaml includes project.gitops.merge.

Start with one trigger and one reviewer.

The trigger, the policy and the merge rule are all files you can open.