Skip to Content
Harnix
Build

Schedules

Have an agent run on its own at set times with a fixed prompt: frequency, time zone, limits, Run now, history.

A schedule has an agent do its work at set times, with no one sending a message: summarize yesterday's orders every morning, sweep unanswered tickets every hour, digest industry news every week. At each due time, Harnix creates an ordinary run of the agent with the schedule's prompt as the user's message. That run has a trace, uses tokens and follows the limits like any other run.

The result is the agent's answer, kept in the run and its conversation. To send it somewhere (email, Slack, a CRM…), give the agent a connector with a tool that does that, and say so in the prompt.

Create a schedule

In the console at app.harnix.vn, open Agents, pick an agent, then open its Schedules tab.

Click Add schedule. Fill in Name (up to 100 characters, unique among your organization's schedules) and Prompt.

Choose the frequency under Repeat and the Time zone (see below). Turn on after saving is on by default; turn it off to save the schedule without running it yet.

Click Create schedule. The console tells you the next run time, for example "Next run: Mon 16 Nov, 08:00 (Vietnam time)".

For each schedule the tab lists its name and frequency in words, Time zone, Next run (in the schedule's time zone, or Off), Last result and an On switch. The row menu has Run now, History, Edit and Delete…. An edit applies from the next run.

Frequency

RepeatOptions
MinutesEvery 15 or 30 minutes
HoursEvery 1, 2, 3, 4, 6, 8 or 12 hours, at the minute you choose
DailyAt HH:MM
WeeklyOn one or more days (Mon…Sun) at HH:MM
MonthlyOn day 1 to 28 at HH:MM

The shortest interval is 15 minutes. Monthly leaves out days 29 to 31 so the schedule runs every month. The minute and hour steps divide an hour or a day evenly, so the gap between two runs is always the same.

Time zone

Run times follow the schedule's Time zone, Asia/Ho_Chi_Minh (Vietnam time) by default. Any IANA time zone works, for example Asia/Singapore or America/New_York. Daily at 08:00 Vietnam time is 01:00 UTC. In a zone with daylight saving time, the schedule still runs at 08:00 local time after the clocks change. The list and the history show times in the schedule's time zone, not your computer's.

Limits

  • The shortest interval between two runs is 15 minutes.
  • An organization has at most 20 schedules, across all its agents. The tab shows how many are in use ("1 of 20 in your organization"); at 20, Add schedule is disabled until you delete one. Contact Harnix if you need more.
  • The Prompt can be no longer than your organization's message limit (32,000 characters by default, see Message length). If the organization later lowers the limit below the prompt's length, runs are skipped until you shorten the prompt.
  • Schedules have no budget of their own: scheduled runs count against the organization's and the agent's daily token budget, and against the organization's concurrency and queue limits, like runs from messages.

When no one is there to ask

A scheduled run has no user waiting on it, so it never stops to wait for a person:

  • Tools that need confirmation (a connector's write tools, say, or web_fetch with Ask the user before opening a page on) are refused at once and never run. The agent gets the result "No one is available to approve this tool in a scheduled run." and carries on with what it has. Read-only tools run as usual. See Confirmation before a tool call.
  • ask_user gets the fixed answer "No user is available to answer in a scheduled run." at once. The agent decides the rest on its own.
  • Connectors that sign in per user (per_user) are left out of the run: the agent doesn't see their tools. Connectors on the organization's account work as usual.

So write a prompt clear enough for the agent to finish without asking, and leave writes to tools that need no confirmation.

Each run

Each run opens a new conversation; runs don't continue one another. The run's end-user is the schedule itself: in Runs and Conversations, its runs and conversations carry a Schedule tag with the schedule's name, and the trace reads "Schedule: name", linking back to the agent's Schedules tab. Schedules never appear in the End-users directory. On the Runs page, Started by → Scheduled shows only scheduled runs (Messages does the opposite).

A failed run is retried like any run; when its attempts run out it is Failed.

Run now

Run now in the row menu creates a run with the schedule's prompt right away, even while the schedule is off, so you can try it before turning it on. It doesn't change the next run time and counts against the budget as usual. The console shows "Started a run of …" with an Open run button. If the run can't start (budget used up, queue full, agent inactive, prompt over the limit), the console says why and no run is created. Run now results don't count toward turning the schedule off (below).

History, skips and late runs

History (in the row menu, or click the row) lists each due time, newest first, with its Result and an Open run link to the trace. Rows from Run now carry a Run now tag.

When a due time comes and no run can be created, it is recorded as Skipped with the reason, and the schedule waits for its next due time (no retry):

  • the daily token budget ran out (the organization's or the agent's);
  • too many runs were waiting;
  • the agent was inactive (Deactivate on the agent page);
  • the prompt is longer than the current message limit.

If Harnix can't run on time (during maintenance, say), each schedule runs once for the due times it missed, as soon as it can, then carries on from its next future due time; missed runs are never replayed in bulk. That run is tagged Late when it starts more than 5 minutes after its due time.

Turned off after 3 runs that did not succeed

A schedule with 3 runs in a row that did not succeed (a Failed run or a Skipped due time) turns itself off, so a broken schedule doesn't burn tokens forever. A success resets the count. The Schedules tab shows the warning "… was turned off after 3 runs in a row did not succeed" with View history and Turn back on: find the reason in the history, fix it (raise the budget or reactivate the agent, say), then turn it back on, which also resets the count.

Rarely, Harnix can't work out a schedule's next run time; that schedule turns off too, with a warning to open Edit schedule, choose its frequency again and save.

Turn off and delete

The On switch pauses or resumes a schedule; turned back on, it runs from its next future due time, with no catch-up for the time it was off. Delete… stops the schedule and deletes its history; the runs and conversations it created stay in Runs and Conversations.

On this page