Automations

An automation sends the team a message as if you had sent it: at the times you set, when something happens, or when you click to run it. The team works while you are away, and you read what it did when you are back.

What an automation does

Some examples of what to hand over:

  • Every weekday at 09:00: “@Reviewer look at the pull requests merged yesterday and list the risks.”
  • When a mail from a customer arrives: “Triage this mail and draft a reply.”
  • When a CI run fails: “CI failed: find out why.”

There are three ways to start one:

  • New automation, the button with a lightning bolt beside New chat in the sidebar (it reads Automation where the whole name does not fit). It opens a chat for the automation, and the lead agent designs a team for its message.
  • Automation at the top of a chat you already have. Its message then goes to that chat's team, which you must have confirmed first.
  • A Proposed automation card in a reply: when you ask in a chat for something to be done later or again, an agent can propose one, with its message, when it runs and its goal. Create automation creates it as it is, Change it in the form opens it in the chat's Automation window first, and Dismiss sets it aside. Nothing is scheduled until you create it, and it replaces the chat's current automation.

Harness Relay sends only while it is running, on a computer that is awake. A conversation has one automation.

Create one

  1. Click New automation in the sidebar and type or dictate what the team should do. Attach any files to send with each run. Relay checks app connections in the background when you sign in. Select Common apps (the four squares before the paperclip) to choose available services to mention in every run’s message. Each disabled option shows its status. If Slack needs verification, select Check Slack connection to let Codex read your own Slack profile. Relay checks your choices again before creating the automation. To set up a connection, select Manage app connections, then Return to automation draft. Your message, attachments, schedule and apps you can still use stay in place. The create button stays at the bottom of the form card while you scroll through the form. You can address individual members with @mentions.
  2. Optionally fill in Goal to track, then choose a trigger under When.
  3. Open Workspace and chat settings to change the folders, file permission or title. The next section, Webhooks and run settings, lets you start a new chat for each run.
  4. Choose Wait for my confirmation or Accept the team automatically, then choose whether the lead agent should review replies and click Create automation. Its chat opens for team design. The task runs when triggered.

Use Manage team templates above the confirmation options to edit the same templates available in New chat.

Or have the lead agent fill in the form: under Have the lead agent fill it in, at the top of the form (here, and in a chat's Automation window), say in a sentence what should happen and when, such as "every weekday at 9 a.m., sum up yesterday's merged pull requests", and click Fill it in. It writes the message, the times, what to wait for and the options, using only the mail accounts and calendars you set up, and lists what changed. Nothing runs until you review it and save.

The new automation draft shows the ten Common apps, Mail and Calendar selected, and disabled choices with their status.
A reminder scheduled for 09:00 every weekday, with a goal to track. See the related use case Chase overdue invoices until they are settled.

Run it now, pause it, delete it

Automation at the top of its chat opens the automation again. There, Run once now sends the message at once, to try it before its first time; untick On to pause it without deleting it (one with no set times has nothing to pause); and Delete automation removes it.

A clock next to the conversation in the sidebar shows it has an automation (point at it for the next time). It turns amber when the last time was not sent, or the last check of what it waits for failed. The messages it sends are marked Automation in the chat. If the team is still replying when a time comes, the message waits its turn, like one you send then.

When it runs

When What sends the message
No set times Only Run once now, or a program calling its webhook. For a task you start yourself now and then.
Once A date and time.
Every day A time of day.
Every week The days you pick, at a time.
Every few hours Every so many hours, counted from when you set it.
When something happens Something new that it waits for (below).

Before you save, the next three times are shown, in the automation's time zone.

When something happens

Under What to wait for, choose what starts it. Harness Relay checks for it itself, every few minutes:

  • A new mail arrives in one of your mail accounts, in a folder you pick (the inbox at first), optionally only from a sender or with words in the subject. Where the mail server can say at once that mail arrived, as Gmail and iCloud can, it starts within seconds.
  • An event is about to begin in one of your calendars, a number of minutes before it begins.
  • A pull request or a failed CI run on GitHub, in a repository you name, checked with your own GitHub CLI (gh), signed in.
  • A file appears or changes in the working directory, matching a pattern such as reports/*.csv. Files the team itself changes there do not start it again.

The mail accounts and calendars come from the Mail and Calendar rows under Settings → Apps and tools → Common apps (see Tools). The first check only notes what is already there: what comes after it starts the automation, with a list of what is new for the agents to read. Add another waits for one more thing, up to five, and any of them starts it. Check now checks at once and says what it found. When a check fails, say a wrong password, the automation says why.

While nobody is watching

An automation's runs may happen while you are away, so three choices say what happens then:

Actions outside the permission
Refuse automatically, at first: whatever an agent wants to do beyond the chat's permission is refused, except what you already allowed always in this chat; the agent is told and works around it, and the chat shows what was refused. Choose Ask me to be asked in the chat as usual; the agent then waits for you, up to a day per turn. With the Approve for me permission, what the lead agent approves goes ahead in these runs too, and this choice decides only the rest.
Missed times
A time missed while Harness Relay was closed or the computer slept is skipped, with a note in the chat (Skip), or sent once when Harness Relay runs again (Send once when it starts), however many were missed.
Start a new chat each time
Instead of this chat, each run opens a new one with the same team and settings. Every run starts clean and this chat does not keep growing, but the agents do not remember earlier runs: have them keep what must carry over in a file in the working directory.

When the chat has team checks, a run nobody watched that fails them counts as that time's failure, shown on the automation, and nothing waits for you. A new automation starts with your default team checks.

With full access, an automation's agents can run any command without asking, with nobody there to see it. Team settings warns you when a chat with an automation has full access. See Permissions and approvals.

Track a goal

A Goal to track says, in your words, what done means: for example “everyone has confirmed a time and place for dinner”. The automation then follows the task across runs and days:

  • Each run, the agents are told the goal and what earlier runs reported, and end their reply with where it stands. That shows as a small Progress card in the reply, and in the automation's Progress list.
  • Once an agent says the goal is reached, the automation switches itself off, with a note in the chat.
  • When an agent says it is held up, the conversation is marked Goal held up and you are notified, until a later reply says otherwise.
  • When every reply of a run fails, say on a usage limit, the same run is tried again after 5, 30 and 120 minutes.
The automation's Progress list, marked Done: each run's notes from @Mail_Reader and @Tally_Keeper, newest first, the latest two saying the goal is met; On is unticked at the bottom, since the automation switched itself off.
Progress run by run, until the goal was reached and the automation switched itself off. A frame of the use case Chase overdue invoices until they are settled.

Let a program start it

In a saved automation, webhook controls are under Let another program start it (webhook). A webhook is an address a program on this computer can call to send the automation's message at once: a git hook, a CI runner on this computer or a script, say. It works while the automation's times are off too.

  • On the New automation page, open Webhooks and run settings and tick Create a webhook too; for an automation already saved, click Add a webhook.
  • The program must send the webhook's token, which is shown only once, with an example of the call: copy it then. New token replaces it; Remove webhook takes the webhook away.
  • What the program sends goes after the message, under What the webhook sent, as data the agents read but never take as instructions.

Harness Relay takes these calls only from programs on this computer. To pass on events from the internet, run a program here that receives them and calls the webhook.