# Blooio iMessage bot example

A conversational AI chatbot that responds via iMessage with a natural, casual texting style. Powers msg.new - demonstrates multi-message responses, typing indicators, read receipts, and memory persistence.

## Workflow Preview

This workflow powers [msg.new](https://msg.new/) - a conversational AI chatbot that responds via iMessage with a natural, human-like texting style.

### ✅ Step 1: Get Your Blooio API Token

1. Visit [https://blooio.com](/content/site-root.html)
2. Sign up for a dedicated instance
3. Navigate to **Settings → API Keys**
4. Generate a new token and **copy** it.

> 🔐 Keep it safe! You’ll paste it in the HTTP Request nodes.

### ✅ Step 2: Configure Credentials

Update the Bearer token in these nodes:

- **Read** (sends read receipts)
- **Type** (shows typing indicator)
- **Stop typing** (hides typing indicator)
- **HTTP Request** (sends messages)

### ✅ Step 3: Set Up Your Database

This workflow uses Postgres for chat memory. Update the **Postgres Chat Memory** node with your database credentials.

### ✅ Step 4: Configure AI Model

Update the **Anthropic Chat Model** node with your Anthropic API key. The workflow uses Claude Haiku 4.5 by default.

### 🎯 How It Works

01. **Webhook** receives incoming iMessages
02. **If** filters for `message.received` events
03. **Check attachments** routes text vs image messages
04. **Wait** adds a natural delay before responding
05. **Read** sends a read receipt
06. **Type** shows typing indicator
07. **AI Agent** generates a response using Claude + chat memory
08. **Stop typing** hides the indicator
09. **Code** splits response into multiple messages
10. **Loop** sends each message separately for natural feel

### 💬 Customization Tips

- Edit the **system prompt** in the AI Agent to change the bot’s personality
- Adjust the **Wait** duration for different response timing
- Modify the **Code** node to change message splitting logic

## What This Workflow Does

### Input

Any text message conversation

### Output

Natural, conversational AI responses split into multiple iMessages

## Quick Setup Guide

1. ### Step 1
   Get Your Blooio API Token
   1. Visit [https://blooio.com](/content/site-root.html)
   2. Sign up for a dedicated instance
   3. Navigate to **Settings → API Keys**
   4. Generate a new token and **copy** it.

> 🔐 Keep it safe! You'll paste it in the HTTP Request nodes.

---

2. ### Step 2
   Configure Credentials
   Update the Bearer token in these nodes:
   - **Read** (sends read receipts)
   - **Type** (shows typing indicator)
   - **Stop typing** (hides typing indicator)
   - **HTTP Request** (sends messages)

---

3. ### Step 3
   Set Up Your Database
   This workflow uses Postgres for chat memory. Update the **Postgres Chat Memory** node with your database credentials.

---

4. ### Step 4
   Configure AI Model
   Update the **Anthropic Chat Model** node with your Anthropic API key. The workflow uses Claude Haiku 4.5 by default.
