Skip to content

Workflow: Conversational Agent

Fresh 🌱

A complete inbound-to-reply loop: the agent receives a message, reasons over the thread, and replies in-thread. Labels track which conversations still need a response.

flowchart TD
    A[Inbound email arrives] --> B{Delivery method}
    B -->|Webhook| C[POST to your endpoint]
    B -->|WebSocket| D[Pushed over connection]
    B -->|Polling| E[List threads labeled 'unreplied']
    C --> F[Load thread context]
    D --> F
    E --> F
    F --> G[Agent reasons over thread]
    G --> H[Reply in-thread]
    H --> I[Re-label thread 'replied']
    I --> J{More unreplied?}
    J -->|Yes| F
    J -->|No| K[Idle until next event]

The loop

  1. Receive. Get inbound mail via webhooks, WebSockets, or polling threads with an unreplied label.
  2. Load context. Fetch the full thread so the agent sees the conversation history.
  3. Reason. Generate a reply. Use Talon reply extraction to strip quoted history and signatures from the inbound text.
  4. Reply in-thread so headers thread correctly.
  5. Re-label to mark the thread handled and avoid double-replies. See Preventing duplicate sends.

Reference implementations