Haruno Knowledge base

Connect a hook to events

A rule links a hook to an event from a connected account, such as a new email, a message or an upcoming meeting. This page shows where rules live and how to read what a hook did.

  • Mac appIn developmentSwitched off for every customer. On the Mac it is called automation triggers, and comes with a gallery of ready-made automations and automations Haruno drafts in a chat. The Scheduled screen stays time-based only.
  • Windows appAvailableRules that start a hook are edited in the advanced view.
In development in the Mac app. It is not available to customers yet. Do not promise it.

A hook says what Haruno should do. A rule says when. Each rule links one hook to one kind of event from one connector.

Rules live in Settings ▸ Connectors, on the connector the events come from. They are set up in the advanced view. In the normal view you cannot edit them, but the ones you already made keep running.

Add a rule

  1. Make the hook first

    Create the hook on the Hooks page. If there is none, the rules section says: Create a hook on the Hooks page first, then add a rule here.

  2. Open the connector

    Go to Settings ▸ Connectors and open the connector, such as Gmail. Its Rules section lists the words you can use in a hook's message template, such as {from} and {subject}.

  3. Press Add rule

    Choose the Hook and the Trigger, fill in any filter, and press Save.

    A rule: which hook, which trigger, and any filter.
    The Rules section of a Gmail connector. One rule is shown with Hook set to Review mail, Trigger set to Matching event, empty From regex and Subject regex fields, an Enabled switch, and the buttons Save, Open conversation and Remove. Add rule is below.The Rules section of a Gmail connector. One rule is shown with Hook set to Review mail, Trigger set to Matching event, empty From regex and Subject regex fields, an Enabled switch, and the buttons Save, Open conversation and Remove. Add rule is below.

The Enabled switch turns a rule on or off. Remove deletes it.

What can start a hook

ConnectorTriggers
GmailEvery event (each new email), or Matching event with a From regex and a Subject regex
Google Calendar and Outlook CalendarUpcoming event, with Lead minutes for how early, or New event. Both can filter by From regex and Subject regex.
DiscordEvery event, Command (messages that use a command word you choose), or Matching event with Message matches (regex)
TelegramEvery event, or Command

A regex is a pattern for matching text. Leave a filter empty and it matches everything. For a Command rule, type the word, such as review, in the Command field.

See what a hook did

Press Open conversation on the rule. Haruno opens the hook's own conversation in Chat, so you can read what it saw and what it replied. Each rule keeps one conversation that carries on from message to message. Until the hook has handled an event there is no conversation yet, and nothing opens.

A hook's conversation is kept out of History and out of search. It holds whatever arrived, such as email subjects, senders and login codes, so it should not sit in your list of chats. Open conversation is the way to read it. You cannot branch it into a new chat.

Deleting a rule deletes its conversation

When you delete a rule, Haruno removes the conversation it kept, so the messages it held do not end up in History.

Last updated · PR #2944 · View this version on GitHub

History (1 version)
  1. Internal knowledge base for staff: site, reader keys, assistant, 197 pages and the PR rule (#2944)
    What changed
    @@ -0,0 +1,58 @@
    +---
    +title: Connect a hook to events
    +summary: A rule links a hook to an event from a connected account, such as a new email, a message or an upcoming meeting. This page shows where rules live and how to read what a hook did.
    +feature: hooks
    +covers:
    +  - windows-client/Haruno.Desktop.Services/Hooks/HookConversations.cs
    +  - windows-client/Haruno.Desktop.ViewModels/IntegrationHooksViewModel.cs
    +  - windows-client/Haruno.Desktop.Core/Models/Hooks/HookRule.cs
    +  - Integrations/gmail/hook.schema.json
    +  - Integrations/calendar/hook.schema.json
    +  - Integrations/outlookcalendar/hook.schema.json
    +  - Integrations/discord/hook.schema.json
    +  - Integrations/telegram/hook.schema.json
    +  - windows-client/docs/hook-conversations.md
    +---
    +
    +A [hook](/windows/automation/hooks/) says what Haruno should do. A **rule** says when. Each rule links one hook to one kind of event from one connector.
    +
    +Rules live in **Settings ▸ Connectors**, on the connector the events come from. They are set up in the **advanced view**. In the normal view you cannot edit them, but the ones you already made keep running.
    +
    +## Add a rule
    +
    +<Steps>
    +<Step title="Make the hook first">
    +Create the hook on the **Hooks** page. If there is none, the rules section says: *Create a hook on the Hooks page first, then add a rule here.*
    +</Step>
    +<Step title="Open the connector">
    +Go to **Settings ▸ Connectors** and open the connector, such as Gmail. Its **Rules** section lists the words you can use in a hook's message template, such as `{from}` and `{subject}`.
    +</Step>
    +<Step title="Press Add rule">
    +Choose the **Hook** and the **Trigger**, fill in any filter, and press **Save**.
    +
    +<Shot src="/m/a2c29f3eeee1-windows-automation-hook-rule-light.png" dark="/m/2fc182fbeeb8-windows-automation-hook-rule-dark.png" alt="The Rules section of a Gmail connector. One rule is shown with Hook set to Review mail, Trigger set to Matching event, empty From regex and Subject regex fields, an Enabled switch, and the buttons Save, Open conversation and Remove. Add rule is below." caption="A rule: which hook, which trigger, and any filter." />
    +</Step>
    +</Steps>
    +
    +The **Enabled** switch turns a rule on or off. **Remove** deletes it.
    +
    +## What can start a hook
    +
    +| Connector | Triggers |
    +|---|---|
    +| Gmail | **Every event** (each new email), or **Matching event** with a **From regex** and a **Subject regex** |
    +| Google Calendar and Outlook Calendar | **Upcoming event**, with **Lead minutes** for how early, or **New event**. Both can filter by **From regex** and **Subject regex**. |
    +| Discord | **Every event**, **Command** (messages that use a command word you choose), or **Matching event** with **Message matches (regex)** |
    +| Telegram | **Every event**, or **Command** |
    +
    +A **regex** is a pattern for matching text. Leave a filter empty and it matches everything. For a **Command** rule, type the word, such as `review`, in the **Command** field.
    +
    +## See what a hook did
    +
    +Press **Open conversation** on the rule. Haruno opens the hook's own conversation in **Chat**, so you can read what it saw and what it replied. Each rule keeps one conversation that carries on from message to message. Until the hook has handled an event there is no conversation yet, and nothing opens.
    +
    +A hook's conversation is kept out of [History](/windows/chat/history/) and out of search. It holds whatever arrived, such as email subjects, senders and login codes, so it should not sit in your list of chats. **Open conversation** is the way to read it. You cannot branch it into a new chat.
    +
    +<Callout variant="warning" title="Deleting a rule deletes its conversation">
    +When you delete a rule, Haruno removes the conversation it kept, so the messages it held do not end up in History.
    +</Callout>