DEV Community

David Harvey
David Harvey

Posted on

Build Your Own iMessage AI Bot in Minutes with blooio

Try msg.new - Then Build Your Own

Want to see what's possible? Text msg.new right now and chat with an AI via iMessage. It responds like a real person—complete with typing indicators, read receipts, and natural multi-message replies.

msg.new is a proof of concept we built to showcase what you can create with Blooio. The entire workflow is open source, running on n8n, so you can deploy your own iMessage bot in minutes.

Why Build iMessage Bots with Blooio?

Building iMessage bots has traditionally been complex and locked behind Apple's ecosystem. Blooio changes that with a REST API for iMessage. With Blooio and this n8n workflow, you can:

  • Deploy in minutes: Import the workflow, add your API keys, and you're live
  • Full iMessage features: Read receipts, typing indicators, attachments
  • AI-powered: Uses Claude for natural conversations with memory
  • Open source workflow: Customize every part of the bot's behavior

How the msg.new Workflow Works

The workflow powering msg.new is elegantly simple:

  1. Webhook receives incoming iMessages from Blooio
  2. Event filter checks for message.received events
  3. Attachment check routes text vs image messages
  4. Natural delay adds realistic response timing
  5. Read receipt marks the message as read via Blooio API
  6. Typing indicator shows the bot is "typing" via Blooio API
  7. AI Agent generates responses using Claude + Postgres chat memory
  8. Message splitting breaks responses into natural, short messages
  9. Loop sends each message separately via Blooio API for authentic texting feel

Key Features

Conversational AI with Memory

The bot uses Postgres to store conversation history, so it remembers previous exchanges. This is powered by the n8n Postgres Chat Memory node connected to Claude.

Multi-Message Responses

Real people don't send wall-of-text messages. The workflow splits AI responses into multiple shorter messages:

// Split by newline and remove empty lines
const lines = aiOutput
  .split("\n")
  .map(l => l.trim())
  .filter(l => l.length > 0);

// Each line becomes a separate message
return lines.map(line => ({ json: { line } }));
Enter fullscreen mode Exit fullscreen mode

Natural Texting Behavior

The system prompt instructs Claude to text like a casual human:

  • Short, 1-3 sentence messages
  • Lowercase, minimal punctuation
  • Authentic reactions and occasional humor
  • No corporate speak or over-explaining

Full iMessage Integration via Blooio

Using Blooio's API endpoints:

  • POST /v1/api/read/{external_id} - Send read receipts
  • POST /v1/api/typing/{external_id} - Show typing indicator
  • DELETE /v1/api/typing/{external_id} - Hide typing indicator
  • POST /v1/api/messages - Send messages

Build Your Own iMessage Bot

1. Try msg.new First

Visit https://msg.new and text the bot to see what's possible.

2. Get the Workflow

Full code and setup instructions: https://blooio.com/integrations/n8n/workflows/imessage-bot-example

3. What You'll Need

  • A Blooio account (for the iMessage API) - Sign up here
  • n8n instance (cloud or self-hosted)
  • Anthropic API key (for Claude)
  • Postgres database (for chat memory)

4. Quick Setup

  1. Sign up for Blooio and get your API token
  2. Import the workflow JSON into n8n
  3. Add your Blooio API token to the HTTP Request nodes
  4. Configure your Postgres credentials in the Chat Memory node
  5. Add your Anthropic API key
  6. Activate the workflow
  7. Set the webhook URL in your Blooio dashboard

Customization Ideas

The open-source nature means you can modify anything:

  • Change the personality: Edit the system prompt to make your bot formal, funny, or professional
  • Add tools: Connect the AI Agent to other services (weather, calendar, databases)
  • Handle attachments: The workflow already detects attachments—add image analysis with vision models
  • Response timing: Adjust the Wait node duration for faster/slower replies
  • Message splitting logic: Modify the Code node to control how responses are broken up

Technical Highlights

The workflow uses several advanced n8n features:

  • AI Agent with memory: Maintains conversation context across sessions
  • Split in Batches: Loops through messages to send them sequentially
  • HTTP Request nodes: Direct API integration with Blooio
  • Conditional routing: Handles different event types and message formats
  • Code node: Custom JavaScript for message processing

Why Blooio?

Blooio provides a REST API for iMessage, letting you:

  • Send and receive iMessages programmatically
  • Access read receipts and typing indicators
  • Handle attachments (images, videos, files)
  • Scale to multiple phone numbers
  • Get webhooks for real-time message events

No need to reverse-engineer Apple protocols or maintain Mac infrastructure. Blooio handles the complexity so you can focus on building your bot's features.

What You Can Build

This workflow is just the beginning. With Blooio, you can create:

  • Customer service bots
  • Personal AI assistants
  • Automated notifications and alerts
  • Two-way communication systems
  • Integration with existing business tools

The combination of Blooio + n8n + AI makes iMessage automation accessible to developers without deep iOS knowledge.

Get Started Today

  1. Try msg.new to see a live example: https://msg.new
  2. Get the workflow: https://blooio.com/integrations/n8n/workflows/imessage-bot-example
  3. Sign up for Blooio: https://blooio.com

The entire setup takes less than 10 minutes if you have your API keys ready. Start building your iMessage bot today!

Have you built any iMessage automations? What would you use this for? Drop a comment below!

Top comments (0)