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

# Email channel (Gmail, Outlook)

> Connect a Gmail or Outlook inbox so your flow handles inbound email threads and replies in-thread.

Connect a real inbox (Gmail or Outlook) to your flow. The platform polls the inbox for new messages, hands each conversation thread to your flow, and replies in-thread when the actor speaks.

## When to use it

* A shared support inbox (`support@acme.com`) where users email in.
* An outbound campaign that needs personalised, threaded follow-ups.
* A customer service flow that should track context across email exchanges.

## Before you start

You need an **integration connection** to the email provider. Set this up once in **Integrations** → **Gmail** (or **Outlook**) and pick which account to connect.

[Manage integration connections →](/features/integrations)

## Adding the channel

<Steps>
  <Step title="Open Flow settings → Channels → Add Channel">
    Pick **Gmail** or **Outlook**.
  </Step>

  <Step title="Pick the connection">
    Choose from the connections set up in your workspace. Each connection represents one inbox.
  </Step>

  <Step title="Configure optional filters">
    | Field                       | Effect                                                                                                  |
    | --------------------------- | ------------------------------------------------------------------------------------------------------- |
    | **Label filter** (Gmail)    | Only handle messages with this label. E.g. `INBOX/Support`.                                             |
    | **Folder filter** (Outlook) | Only handle messages in this folder.                                                                    |
    | **Address filter**          | Only handle threads addressed to this specific recipient (useful if one account hosts several aliases). |

    Filters are optional. Without them, the flow handles **every** message in the inbox — usually too aggressive.
  </Step>

  <Step title="Save and Deploy">
    Saving stores the configuration. **Deploy** starts the listener.
  </Step>
</Steps>

## How inbound email works

```mermaid theme={null}
flowchart LR
    Sender[Customer sends email] --> Inbox[Configured inbox]
    Inbox --> Poll[Platform polls every minute]
    Poll --> Match{New thread?}
    Match -->|Yes| New[Open new conversation]
    Match -->|Existing thread| Continue[Continue existing conversation]
    New --> Flow[Route into flow]
    Continue --> Flow
    Flow --> Reply[Actor replies in-thread]
```

* Each **email thread** maps to one conversation.
* Replies are sent in-thread using the configured account.
* The participant identifier is the sender's email address. A second message from the same sender continues the same conversation.
* A new sender opens a new conversation.

## Outbound email (Initiator mode)

When the flow is in **Initiator** mode, you start a conversation by:

1. Clicking **Start Conversation** in the toolbar.
2. Picking the email channel.
3. Entering the recipient's email and optional initial parameters.
4. The first actor sends an opener email.
5. When the recipient replies, the reply lands back in the conversation.

[Read more: Start a conversation →](/conversation-flows/operate/start-conversation)

## Threading

The platform preserves email threading:

* Replies use the same `Subject` and `In-Reply-To` headers, so the recipient sees a normal threaded conversation.
* Attachments in incoming emails are ignored in v1 (text-only). The actor sees the body but won't process attachments.
* HTML emails are stripped to plain text before the actor reads them.

## Multiple inboxes on one flow

You can add **multiple email channels** to the same flow — for instance, Gmail for support and Outlook for sales. Each lives independently; conversations from each show up in the same Conversations history.

## Anti-patterns

<Warning>
  **Connecting a personal inbox.** Don't connect your own inbox to a deployed flow — every email you receive becomes a conversation handled by the flow. Use a dedicated, shared inbox.
</Warning>

<Warning>
  **No filters on a busy inbox.** If the connected inbox gets newsletter mail, autoresponders, or system notifications, the flow tries to reply to all of them. Always set a label or folder filter.
</Warning>

## Next

<CardGroup cols={2}>
  <Card title="Messaging (Slack / Teams)" icon="comments" href="/conversation-flows/channels/messaging">
    Connect a Slack channel or Teams chat.
  </Card>

  <Card title="Deploy a flow" icon="rocket" href="/conversation-flows/operate/deploy">
    Schedule the email listener.
  </Card>
</CardGroup>
