# Email Automation as an  Advanced  Workflow AI Agent with External Chat Browser

### **1. Use Case Overview**

**Objective:**\
Deploy a Soika AI Agent that automatically reads incoming emails, downloads and processes attachments, and sends replies with relevant information or requested documents.

**Primary Actors:**

* Email Sender (Customer, Client, Internal Staff)
* Soika AI Email Automation Agent
* Email Server (Gmail, Outlook, etc.)

**Target Platforms:**

* Email (Gmail, Outlook, IMAP/SMTP)
* Soika Mockingjay Platform

### **2. Business Value Proposition**

This automation:

* Reduces manual email handling
* Ensures faster response time
* Organizes attachments automatically
* Maintains consistent communication templates
* Supports customer service, HR, and document processing teams

**Benefits:**

* 80% faster response rate
* Zero missed attachments
* Auto-organization of incoming files
* Round-the-clock operation

### **3. Flow Summary**

**Agent Actions:**

1. Reads new incoming email
2. Reads and saves attachment
3. Optionally processes attachment (e.g., run OCR, validate file type)
4. Composes a reply based on request
5. Attaches required file&#x20;
6. Sends email back to sender

### **4. Step-by-step Process**

### **A. AI Agent Creation**

1. Open **Soika Mockingjay Platform**
2. Prompt:

   > "Create an Email  Workflow Automation Agent that reads incoming emails, attachments, processes them if needed, and sends back replies."
3. Choose AI Model (e.g., GPT-4o, Llama 3.3)

<figure><img src="/files/HnKhnoHIS4m0RB25tIFK" alt=""><figcaption><p>Using natural language create a agent</p></figcaption></figure>

<figure><img src="/files/umrzwSioS2zqwpqPWDIY" alt=""><figcaption><p>Agent is created</p></figcaption></figure>

<figure><img src="/files/IBb2JcTJHH65PQ2BNw2H" alt=""><figcaption><p>Email Automation Workflow Agent</p></figcaption></figure>

### **B. Creating the Workflow Nodes and Blocks**

**Let's understand each Node, Blocks, Input Parameters Step by step.**

<figure><img src="/files/PLyW9LIMRi1yxWWlzfQ8" alt=""><figcaption></figcaption></figure>

### **Tool Integration (Read Email ,Send Email, Document Extractor, Parameter Extractor)**

### **Step 1: Connect the Read Email Tool and Authorize it**&#x20;

<figure><img src="/files/NIRyTa3lYAvM1wOS4B60" alt=""><figcaption></figcaption></figure>

* Authorize with **IMAP/SMTP** credentials
  * Gmail IMAP: `imap.gmail.com`
  * SMTP: `smtp.gmail.com`
  * Use **App Passwords** for authentication

### Step 2: Add If /Else  Logical Conditional Block for the Email Attachments and the Input variables

<figure><img src="/files/UHGOj2VcRXlzVdX87T41" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FNX3w4w0QQq6xFX3ajQA" alt=""><figcaption></figcaption></figure>

### Step 3: Document Extractor Block to Extracts the document contents from .doc,.docx,.pdf

<figure><img src="/files/VelN0nIdlGLSH5XVya4q" alt=""><figcaption></figcaption></figure>

### Step 4: Add LLM Block to IF Condition-To Read the attachments and summarize it also provide system instructions

<figure><img src="/files/d6WBjFYPTZkG2IqlWwhH" alt=""><figcaption></figcaption></figure>

### Step 5:Parameter Execution Blocks to extract the parameters s.t. sender email id, Subject \&Body.

<figure><img src="/files/tOMUFZ7c7jHbeu3rAIkA" alt=""><figcaption><p>Extract the Parameter- Subject and body</p></figcaption></figure>

<figure><img src="/files/13looRKGb0pGDWJB4ngh" alt=""><figcaption><p>Sender Email Address</p></figcaption></figure>

### Step 6: Connect the Send Email Tool&#x20;

<figure><img src="/files/iGOtyrPlyxOL9hl4gDlI" alt=""><figcaption><p>Provide the details of To,Body,Subject( use / (backward slash ) to extract parameters)</p></figcaption></figure>

### Step 7:Add LLM Node for ELIF  Block -Reading the  Image Attachments and provide system instructions

<figure><img src="/files/vJt1yZFueipKj5qI8yU5" alt=""><figcaption><p>LLM to read Image attachments</p></figcaption></figure>

### Step 8 : Add LLM Node for ELSE Block- Email Without Attachments and provide system instructions

<figure><img src="/files/WTnbk7auT6yUS63eoeGF" alt=""><figcaption></figcaption></figure>

### Step 9: Add the End Node for all the Conditions

<figure><img src="/files/pGWGjZ17LFIvXeWl2HPa" alt=""><figcaption></figcaption></figure>

### Step 10 : To publish the workflow click on Publish

<figure><img src="/files/V25xIodjPO6FFGRM11q3" alt=""><figcaption><p>Click on Publish to execute the workflow</p></figcaption></figure>

### Step 11 : Accessing the External Chat Browser

**Click on Preview to launch the External Chat Browser**

Visibility Access should be changed to Public. So that we can use the Public URL to host the agents Publicly in the external chat browser.

<figure><img src="/files/51teHD1UCUNWIXYUDXtR" alt=""><figcaption><p>Click on Preview to launch the external chat</p></figcaption></figure>

**Click on execute, to execute the Workflow**

<figure><img src="/files/cOY4p7gi6p2mYDUJH9BI" alt=""><figcaption><p>Click on execute to run the workflow</p></figcaption></figure>

<figure><img src="/files/fzq2BLs8laUO7JHvjdXS" alt=""><figcaption><p>Execution of Workflow Completed and email shared to your email Id</p></figcaption></figure>

### Click Schedule for Scheduling your Emails

<figure><img src="/files/HTkfYo9sQtWDzvw87xoN" alt=""><figcaption><p>Click on Schedule for Scheduling Emails</p></figcaption></figure>

<figure><img src="/files/HROse4tc5dCAvZsAx9Pj" alt=""><figcaption></figcaption></figure>

### Output of the Email&#x20;

<figure><img src="/files/w9L95EtytrrfrhRCjfnH" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://soika-labs.gitbook.io/soika-mockingjay/use-cases/email-automation-as-an-advanced-workflow-ai-agent-with-external-chat-browser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
