Automations

By the end of this page, you can pick a time and have the same message sent to the team on its own.

What an automation does

Some examples of what to hand over:

  • Every Monday at 09:00: “Turn this week's meeting notes into a one-page summary and send it to the team.”
  • 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 member 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, a member 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 or folders 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. You can address individual members with @mentions. To track a goal, open More settings under the message and fill in Goal to track. Click Next.
  2. Choose when it runs: Every day, On certain days or When something happens (the other times are under More settings), and click Next.
  3. Check the summary; Change goes back to a step. Open More settings to change the folders or file permission (the message names the chat), and under How it runs to start a new chat for each run.
  4. In the same More settings, choose Wait for my confirmation or Accept the team automatically, then choose whether the lead member should review replies, and click Create. 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 member fill in the form: click Fill it in for me at the top of the form (here, and in a chat's Automation window), then under Have the lead member fill it in 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 Write it. 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 first step of a new automation: the ten Common apps, Mail and Calendar selected, disabled choices with their status, and a goal to track under More settings.
The first step of a reminder about overdue invoices, 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 folder, 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 Settings → Apps → Mail and Settings → Apps → Calendar (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 members 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 a member wants to do beyond the chat's permission is refused, except what you already allowed always in this chat; the member 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 member then waits for you, up to a day per turn. With the Approve for me permission, what the lead member 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 members do not remember earlier runs: have them keep what must carry over in a file in the folder.

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 members 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.

A script can do the work without a model: in the automation's window, Run a fixed command first picks one of the folder's fixed commands. Each time, Harness Relay runs it in its own sandbox first; exit code 0 means nothing to do, and no message goes; exit code 10 (something new) or a failure sends the message to the team, with what the command printed. Tick Only run the fixed command, never the team for work that needs no member, such as posting at set times: then no message ever goes to the team, and what the command finds, or how it fails, is noted in the chat with what it printed. A member can propose such an automation for you, naming the command.

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 members 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 a member says the goal is reached, the automation switches itself off, with a note in the chat.
  • When a member 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 window: Weekdays at 09:00 · paused, with Run once now and Delete automation, and its Progress list, marked Done: each run's notes from @Mail_Reader and @Bookkeeper, newest first, the latest, from @Bookkeeper, saying the goal is met: every invoice is paid in full or has a written payment date. 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.

If something goes wrong

If nothing new shows up at the set time, first check that the app is open on this computer.

Next → Connect your mail

Advanced

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 members 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.