# Mystic Tarot Reader

An AI-powered spiritual guide that interprets tarot card images and text queries to offer soulful, empowering readings via iMessage. Supports both photo analysis of physical cards and virtual card draws.

## Workflow Preview

### Using the n8n HTTP Request Node to Send a [Blooio.com](/content/site-root.html) Message

Follow these steps to configure your existing HTTP Request node in n8n so you can send SMS or iMessage via the [Blooio.com](/content/site-root.html) API.

### 1. Open Your HTTP Request Node

- In your workflow, click on the HTTP Request node you’ve already added (e.g. **Send Message**).

### 2. Set Up the Request

| Field | Value |
| --- | --- |
| **Request Method** | `POST` |
| **URL** | `https://backend.blooio.com/v1/api/messages` |
| **Response Format** | `JSON` |
| **Body Content Type** | `JSON (application/json)` |

### 3. Add Required Headers

Add authentication using Bearer token:

```
Authorization: Bearer YOUR_API_TOKEN
Content-Type:  application/json
```

## Message Received Webhook (New Schema):

```json
{
  "event": "message.received",
  "message_id": "3FdaRdsf94pQRl85yi-vg",
  "external_id": "+11111111111",
  "text": "Draw me a card",
  "attachments": [
    {
      "id": "GEhyfDbTIGbNmyQlqlvac",
      "mime_type": "image/jpeg",
      "file_name": "tarot.jpeg",
      "url": "https://...",
      "size": 911831,
      "height": 975,
      "width": 731
    }
  ],
  "protocol": "imessage",
  "timestamp": 1763717044386,
  "received_at": 1763717039911,
  "device_id": "735E425E"
}
```

## 🔮 Start Here: Mystic Tarot Bot Setup

Welcome, seeker. Before your tarot bot can receive spiritual inquiries via iMessage and offer intuitive readings, follow these setup steps:

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

1. Go to [https://blooio.com](/content/site-root.html)
2. Sign up for a **Dedicated** or **Enterprise** plan (required for attachments)
3. Navigate to **Settings → API Keys**
4. Generate an API token and **copy it**

> 🔐 Paste it in the **Send Message** node under the Bearer Token credential.

### ✅ Step 2: Connect Blooio to n8n

In the **Webhook node**:

- Use the path `/tarot-ai` or another route of your choice
- Make sure your Blooio number is mapped to this endpoint in the Blooio dashboard

### ✅ Step 3: Test the Flow

Text your Blooio-connected number:

- Send **“Hi”** or **“Draw a card for me”** to trigger onboarding
- Or send a **photo of tarot cards** with a question

This will:

- Trigger the webhook
- Analyze the message/image with AI
- Return a mystical tarot reading via iMessage

### 🃏 What You Can Send

- ✨ A text-based question (e.g., “What’s the energy around my career?”)
- 🖼 A photo of drawn tarot cards
- 🧘‍♀️ A simple “Hi” to receive onboarding guidance

Let the mystery unfold, one message at a time… 🌙📩

## What This Workflow Does

### Input

Photo of tarot cards or text-based spiritual question

### Output

Mystical tarot reading with card interpretations, spiritual guidance, and empowering insights

## Quick Setup Guide

### Step 1

Get Your Blooio API Token  
1. Go to [https://blooio.com](/content/site-root.html)  
2. Sign up for a **Dedicated** or **Enterprise** plan (required for attachments)  
3. Navigate to **Settings → API Keys**  
4. Generate an API token and **copy it**

> 🔐 Paste it in the **Send Message** node under the Bearer Token credential.

### Step 2

Connect Blooio to n8n

In the **Webhook node**:

- Use the path `/tarot-ai` or another route of your choice
- Make sure your Blooio number is mapped to this endpoint in the Blooio dashboard

### Step 3

Test the Flow

Text your Blooio-connected number:

- Send **“Hi”** or **“Draw a card for me”** to trigger onboarding
- Or send a **photo of tarot cards** with a question

This will:

- Trigger the webhook
- Analyze the message/image with AI
- Return a mystical tarot reading via iMessage

## Requirements

- **Blooio Account**: Sign up for Blooio to get your API key and start sending iMessages.
- **n8n Instance**: Use n8n Cloud or self-host your own instance to run this workflow.
- **OpenAI API Key**: Required for AI-powered features in this workflow template.
