Pair Temporal's durable execution model with MultiMail's graduated oversight to build email workflows that pause for approval, survive process crashes, and resume exactly where they left off.
Temporal is a durable workflow engine that persists every step of a long-running process. When an AI agent needs to send an email that requires human approval, Temporal can pause the workflow indefinitely—surviving restarts, deploys, and network failures—then resume the moment approval arrives.
MultiMail's `gated_send` and `gated_all` oversight modes map directly onto Temporal's timer and signal primitives. A workflow activity calls `send_email` via the MultiMail API, receives a pending approval ID, then waits on a Temporal signal that fires when the human approves or rejects. No polling loops, no external state storage, no lost approvals.
This pattern is especially useful for high-stakes outbound email in regulated industries: loan offer notifications, patient communications, contract delivery. Temporal guarantees at-least-once execution of each activity; MultiMail guarantees the human stays in the loop before anything leaves the system.
MultiMail's approval queue exposes webhook events when a human approves or rejects a pending send. These events map cleanly to Temporal workflow signals, letting you pause a workflow at the send step and resume it without any external coordination logic.
Human approval may take hours or days. Temporal workflows can pause for weeks without losing state. Combined with MultiMail's persistent approval queue, you never lose a pending send because a worker restarted.
Start with `gated_all` while building confidence, then promote a mailbox to `monitored` or `autonomous` via the MultiMail API. Temporal workflow logic doesn't need to change—oversight behavior is a configuration property on the mailbox, not embedded in workflow code.
Temporal retries failed activities automatically, but MultiMail's idempotency keys prevent duplicate email delivery. Pass a deterministic key derived from the workflow ID and activity attempt number to ensure exactly-once delivery semantics.
MultiMail's `get_thread` endpoint retrieves complete conversation history. Temporal activities can fetch this context at any step, letting an AI agent craft replies with full awareness of prior exchanges without re-fetching from upstream sources.
No code, no dashboard. Paste this to your AI agent — it connects MultiMail, creates an inbox, and builds the flow for you.
Install the Temporal TypeScript SDK and set up a worker that runs on the `email-agent` task queue. The worker registers your workflow and activity functions.
Create a mailbox via the MultiMail API with `gated_send` oversight so all outbound messages wait for human approval. Retrieve your API key from the MultiMail dashboard.
Configure MultiMail to deliver `approval.approved` and `approval.rejected` events to your webhook endpoint. This endpoint will signal your Temporal workflows when humans act on pending sends.
Register your workflow and activities with the Temporal worker, deploy the webhook handler to your API, and start a Temporal workflow for each email that needs to be sent. Use the workflow ID as the correlation key between MultiMail events and Temporal executions.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a hosted MCP server. Formally verified in Lean 4.