How it works
When someone replies to your agent’s email, Commune:- Receives the reply on your inbox address
- Resolves it to the correct conversation thread
- POSTs the full parsed email to your webhook endpoint
- Your agent processes and replies
Step 1: Set a webhook on your inbox
Step 2: Handle the webhook
Every inbound email POSTs to your endpoint:Always include
thread_id when replying. This is what keeps the conversation correctly threaded for both your agent and the recipient’s email client.Step 3: Verify webhook signatures
Commune signs every webhook with HMAC-SHA256. Verify before processing:How threading works
Commune resolves replies to threads in this priority order:- Routing token — a unique token embedded in the
Reply-Toheader of your outbound email - RFC 5322 Message-ID — standard email header threading
- Subject line matching — fallback for replies that strip headers
Read conversation history
Before generating a reply, your agent can read the full thread:Related
Webhooks
Full webhook reference including payload schema and signature verification.
Threads
Thread management API for reading conversation history and resolving message chains.
How to Add Email to a LangChain Agent
Complete tutorial covering multi-agent email patterns with LangChain.

