> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onlystack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Online nudges

> Send a fan a short hello a few minutes after he comes online, with openers you wrote.

**Instant message** is the one online automation. It notices when a fan comes online and sends him a personal hello a few minutes later, as if the creator had just noticed him. Every opener is one you wrote. No AI is involved. For how automations run in general, see [how automations work](https://docs.onlystack.com/automations/overview.md).

## Two different online nudges

OnlyStack has two, and they are not the same thing:

| | **Instant message** | The Engagement Agent's online nudge |
| - | - | - |
| Who writes it | You do, as openers for each time of day. | AI, fresh for each fan. |
| Where it lives | **Automations**, under **Online fans**. | **Agents**. See the [Engagement Agent](https://docs.onlystack.com/agents/engagement.md). |
| If he does not answer | It stays in his chat. | It is taken back. |
| While AI Chat is on | Sends nothing of its own. | Takes over. |

While AI Chat is on, a fan who comes online is handed to the Engagement Agent, which decides whether he gets a nudge and writes it. It writes one only while **Message him the moment he comes online, and take it back if he doesn't answer** is ticked in its settings, which it is by default. **Instant message** only sends when AI Chat is off.

## How it works

1. It watches who is online. A fan counts as newly online only after he has been offline for a while.
2. It queues a message for him, to go out a few minutes later, with a random extra delay so nudges never arrive at an exact time.
3. Just before sending, it checks again. If he went offline, started chatting with you, was nudged recently, is blocked or is on a skip list, nothing is sent.
4. It sends one of your openers for the time of day, with his name where you put it.

Fans past the limit it handles in one pass wait for the next pass. They are not dropped.

## Set it up

**1. Write your openers**

Open **Edit automation**. **Slot pools (time-of-day openers)** has one box for each part of the day: **Early morning (5–9)**, **Late morning (9–12)**, **Early afternoon (12–15)**, **Late afternoon (15–18)**, **Evening (18–21)** and **Night (21–5)**. Write one opener per line. `{name}` fills in the fan's name. One is picked at random each time.

**2. Set your time zone**

**Your time zone (UTC offset)** lets the morning and evening openers go out in your morning and evening. It does not move for daylight saving, so change it when the clocks change.

**3. Save and enable**

Choose the settings below, then press **Save and enable**.

A slot with no opener is skipped: **No opener yet, so this slot is skipped**.

## Settings

| Setting | What it does |
| - | - |
| **Slot pools (time-of-day openers)** | The messages to pick from for each part of the day. One is chosen at random each time. |
| **Treat as newly-online after offline (min)** | A fan only counts as newly online after being offline for at least this long. |
| **Wait before nudging (min)** | How long to wait after a fan comes online before sending, so it feels natural. |
| **Random extra delay up to (min)** | Adds a random extra wait of up to this long, so nudges never arrive at an exact, robotic time. |
| **Max fans queued per tick** | Overflow past this cap is deferred to the next tick, not dropped. |
| **Max online scanned** | The most online fans it checks each time it looks. |
| **Min hours between nudges per fan** | A fan gets at most one nudge in this many hours. |
| **Skip fans who DM’d within (hrs)** | Do not nudge someone in an active conversation. 0 means off. |
| **Your time zone (UTC offset)** | Hours your clock is ahead of UTC, or behind it as a minus number. |
| **Hold the chat for (hrs)** | After it sends a fan a message, other automations leave his chat alone for this many hours, unless he replies. 0 means no hold. |
| **Runs every** | How often it looks for fans who came online. |

## What it never does

* It never writes anything itself. Every message is one of your openers, as text. The slot editor offers **Pick images**, but Instant message sends text only.
* It never interrupts a live chat. A fan who wrote to you recently is skipped.
* It leaves a minimum time between two nudges to the same fan, and where a slot has more than one opener it avoids the line he got last time. A fan who never replies is nudged again each time that time passes, until he has not answered her last three messages in a row.
* It never nudges a fan who has not answered her last three messages in a row. See [how AI Chat works](https://docs.onlystack.com/agents/overview.md).
* It never messages a new fan before his welcome. A new fan's first message is the welcome.
* It never nudges a blocked fan or one who has opted out.
* It sends nothing of its own while AI Chat is on. It stays switched on and passes fans coming online to the Engagement Agent.

## Message everyone online

A different thing: **Message everyone online** is a single broadcast that you send by pressing a button, not an automation. See [mass messages](https://docs.onlystack.com/automations/mass-messages.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.