How to Auto-Draft Email Replies with OpenClaw in Paradime
Feb 26, 2026
How to Auto-Reply to Emails with Paradime, OpenClaw, and the Gmail API
Every data team has felt this sting: a stakeholder pings a question about a metric, nobody replies for two days, and by the time someone does, the answer references a dashboard that was deprecated last quarter. The root causes are painfully familiar — stale documentation nobody trusts, missing context buried across Slack threads and Google Docs, and tribal knowledge locked inside the heads of two senior analysts who happen to be on vacation.
These aren't cosmetic problems. They erode trust in data, slow decision-making, and turn every new hire's first month into an archaeological dig. The good news? You can build an automated workflow that catches unanswered email threads, drafts context-rich replies using AI, and saves them as Gmail drafts for human review — achieving near-100% response coverage without sacrificing quality.
In this guide, you'll wire together Paradime (for pipeline orchestration and scheduling), OpenClaw (an open-source AI agent framework), and the Gmail API into a fully automated email auto-reply system — scheduled, monitored, and production-ready.
Figure 1: End-to-end architecture — Paradime Bolt triggers the OpenClaw agent on a cron schedule, which fetches unanswered Gmail threads, generates draft replies via Anthropic, and saves them back as Gmail drafts for human review.
What Is Paradime?
Paradime is an all-in-one, AI-native data platform purpose-built as a replacement for dbt Cloud™. It lets fast-moving data teams code, ship, fix, and scale data pipelines for analytics and AI from a single workspace.
Paradime's core capabilities include:
Code IDE — An AI-native IDE for dbt™ and Python development, with integrated AI-assisted coding via DinoAI, cutting development time by 83%+.
Bolt — A scheduler and orchestration engine for dbt™ pipelines, featuring cron-based and event-driven triggers, CI/CD, TurboCI, and AI-powered debugging.
Radar — FinOps tooling to cut Snowflake and BigQuery costs, freeing budget for AI use cases.
dbt™-llm-evals — An open-source package for warehouse-native LLM evaluation, letting you monitor AI output quality without data egress.
For this tutorial, we'll lean heavily on Bolt — Paradime's production scheduler — to run our email auto-reply agent on a reliable, twice-daily cron schedule.
Here's a taste of how dbt™-llm-evals lets you evaluate AI-generated content right inside your dbt™ project:
This kind of warehouse-native evaluation is exactly the quality-assurance layer you'd want on top of any AI-generated email drafts at scale.
What Is OpenClaw?
OpenClaw is an open-source, self-hosted AI agent framework (MIT license) designed to run locally or on your own hardware. Formerly known as Moltbot and ClawdBot, it was rebranded to OpenClaw in early 2026.
OpenClaw follows an autonomous agent loop: perceive → plan → act → observe → repeat. Its architecture has four layers:
Layer | Purpose |
|---|---|
Core Runtime | Manages agent loop, memory, and state |
LLM Backbone | Connects to model providers (OpenAI, Anthropic, Google, Ollama) |
Tool Registry | Plugin system where each tool exposes a schema |
Memory System | Short-term (conversation) and long-term (vector store, file-based) |
OpenClaw is model-agnostic — it works with Claude (Opus, Sonnet, Haiku), GPT-4o, Gemini 2.5 Pro, or local models via Ollama. For our email auto-reply workflow, we'll use Anthropic's Claude as the LLM backbone.
Key features we'll use:
Built-in cron scheduler — persists jobs under
~/.openclaw/cron/, survives restarts.Gmail integration — via OAuth and the Gmail REST API.
Tool ecosystem — file system, code execution, API calls, and custom plugins.
Local-first privacy — email content is processed on your machine; nothing leaves unless you explicitly send it.
Setup: openclaw-sdk + Gmail API (Read + Draft Scope)
Prerequisites
Node.js ≥ 22 (required by OpenClaw)
Python 3.8+ (for the Gmail automation script)
A Google Cloud account with access to the Google Cloud Console
An Anthropic API key (console.anthropic.com)
A Paradime account (paradime.io)
Step 1: Install OpenClaw
The onboard wizard installs the Gateway daemon (via launchd on macOS or systemd on Linux) so it stays running in the background.
Step 2: Enable the Gmail API and Create OAuth Credentials
Figure 2: OAuth credential setup flow — from Google Cloud Console to a verified OpenClaw connection.
Go to Google Cloud Console → New Project → Name it
OpenClaw Email Agent.Navigate to APIs & Services → Library → Search for Gmail API → Click Enable.
Go to APIs & Services → OAuth consent screen → Select External → Fill in app name (
OpenClaw Agent), support email, and developer contact.On the Scopes screen, add these two scopes:
Go to Credentials → Create Credentials → OAuth client ID → Application type: Desktop app → Name:
OpenClaw Desktop Client→ Click Create.Download the credentials file and save it:
Step 3: Configure the OpenClaw Google Adapter
Create the adapter config:
Step 4: Authorize OpenClaw
Start OpenClaw and run the connection command:
This opens a browser window for Google sign-in. Grant the requested permissions. Tokens are stored locally. Verify the connection:
Step 5: Install Python Dependencies
Script: Fetch Unanswered Threads >24h, Generate Draft Replies, Save as Gmail Drafts
This is the heart of the automation. The script does three things:
Fetches email threads from your inbox that are older than 24 hours and have no reply from you.
Generates a context-aware draft reply using Anthropic's Claude.
Saves each reply as a Gmail draft for human review.
Figure 3: Script execution flow — each unanswered thread is processed individually, with drafts saved back to Gmail.
scripts/auto_reply_agent.py
⚠️ Important: This script never auto-sends. All replies are saved as Gmail drafts for human review. You retain full control over what gets sent.
Environment Variables: GOOGLE_CREDENTIALS_JSON and ANTHROPIC_API_KEY
The script relies on two environment variables. You can set them in multiple places depending on your deployment model.
Option A: Shell Environment / .env File
Option B: OpenClaw Config (openclaw.json)
OpenClaw's config supports inline env vars and ${VAR} substitution:
For production, use OpenClaw's SecretRef system for sensitive values:
Option C: Paradime Environment Variables
If you're running this through Paradime Bolt, set the environment variables in your Paradime workspace settings. These will be securely injected into the Bolt schedule runtime.
Figure 4: Environment variable flow — both secrets feed into the auto-reply script at runtime.
Environment Variable Precedence in OpenClaw
OpenClaw resolves env vars with this precedence (highest to lowest):
Process environment (parent shell / daemon)
.envin current working directoryGlobal
.envat~/.openclaw/.envConfig
envblock in~/.openclaw/openclaw.jsonLogin-shell import (opt-in via
env.shellEnv.enabled)
Bolt Schedule: Cron Twice Daily
With the script ready and environment variables configured, you need a reliable scheduler. Paradime's Bolt is purpose-built for this — it provides cron-based scheduling with built-in monitoring, notifications, and AI-powered debugging.
Option A: Schedule via Paradime UI
Navigate to the Bolt application from the Paradime Home Screen.
Click + New Schedule → + Create New Schedule.
Configure the schedule:
Field | Value |
|---|---|
Type | Standard |
Name |
|
Commands |
|
Git Branch |
|
Owner Email |
|
Trigger Type | Cron Schedule |
Cron Schedule |
|
Timezone | Your local timezone |
The cron expression 0 8,17 * * * runs the agent at 8:00 AM and 5:00 PM daily — catching unanswered threads at the start and end of the workday.
Option B: Schedule as Code (paradime_schedules.yml)
Define the schedule in your dbt™ project's root directory alongside dbt_project.yml:
Paradime auto-reads paradime_schedules.yml from your default branch and refreshes every 10 minutes. You can also manually click Parse Schedules in the Bolt UI.
💡 Validate your cron expression at crontab.guru before deploying.
Alternative: OpenClaw Built-In Cron
If you prefer to keep everything within OpenClaw, use its native cron scheduler:
Or via the tool-call JSON format:
OpenClaw cron jobs persist under ~/.openclaw/cron/jobs.json, so they survive Gateway restarts.
Monitoring and Debugging
Monitoring with Paradime Bolt
Bolt provides comprehensive monitoring out of the box:
Figure 5: Paradime Bolt monitoring stack — from run history to multi-channel notifications.
Three tiers of logs are available for each run:
Log Type | What It Shows | When to Use It |
|---|---|---|
Summary Logs | DinoAI-generated overview with warnings and potential fixes | Quick health assessment |
Console Logs | Detailed chronological execution record | Finding specific errors |
Debug Logs | System-level operations and internals | Deep performance tuning |
Notification channels — Set up alerts via Email, Slack, or Microsoft Teams for:
✅ Success — confirmation the agent ran cleanly
❌ Failure — immediate alert when something breaks
⏰ SLA breach — alert if the run exceeds your
sla_minutesthreshold
Monitoring with OpenClaw
If you're using OpenClaw's native cron, monitor runs with:
Debugging a Failed Run in Bolt
Check notifications — Slack or email alerts fire immediately on failure.
Open Bolt UI → click the failed schedule → navigate to Run History.
Select the failed run → scroll to Logs and Artifacts.
Review Summary Logs first — DinoAI will often pinpoint the root cause and suggest a fix.
Dive into Console Logs if you need the full error traceback.
Test the fix — copy the failing command, run it locally, verify, then push the fix to
main.
Troubleshooting Common Issues
Gmail API Issues
Problem | Cause | Fix |
|---|---|---|
| Missing OAuth scopes | Delete |
| API not enabled | Go to Google Cloud Console → APIs & Services → Enable Gmail API, wait 5 minutes |
| Stale OAuth token | Delete |
| Another process on the port | Script uses |
Rate limiting ( | Too many API calls | Add |
OpenClaw Issues
Problem | Cause | Fix |
|---|---|---|
Gateway won't start | Port conflict or auth misconfiguration | Run |
Cron job didn't fire | Scheduler disabled or Gateway not running | Check |
Cron runs but no output delivered | Delivery channel misconfigured | Run |
| Context too long or rate limited | Reduce |
Agent memory loss after restart | Compaction or missing persistence | Use |
No replies from OpenClaw | Pairing or mention gating | Run |
Paradime Bolt Issues
Problem | Cause | Fix |
|---|---|---|
Schedule not appearing in Bolt |
| Merge to |
Schedule runs but fails immediately | Missing environment variables | Set |
SLA breach notifications firing | Script taking too long | Increase |
Cron expression not matching expected times | Timezone mismatch | Verify |
Quick Diagnostic Checklist
Wrapping Up
The workflow you've just built closes one of the most frustrating gaps in data team operations: unanswered questions that erode trust.
Figure 6: Before vs. After — from missed questions and tribal knowledge to automated draft replies with human oversight.
Here's what you've achieved:
Eliminated the blind spot — Every unanswered email thread older than 24 hours gets caught, every time, twice a day.
Preserved human judgment — AI generates the drafts, but you review and send. No auto-sending, no risk of rogue replies.
Production-grade reliability — Paradime Bolt's cron scheduler, SLA monitoring, and multi-channel notifications ensure the agent actually runs.
Full auditability — Bolt's three-tier logging (Summary, Console, Debug) and OpenClaw's run history give you complete visibility into every execution.
Local-first privacy — OpenClaw processes email content on your machine. Anthropic sees only the thread context you explicitly send for draft generation.
The key insight is that stale docs, missing context, and tribal knowledge aren't just documentation problems — they're response-time problems. When nobody can find the answer, nobody replies. By pairing an AI agent with a robust scheduler, you transform a systemic communication failure into a structured, monitored workflow.
Next Steps
Customize the prompt — Tune the system prompt in
generate_draft_reply()to match your team's voice and domain knowledge.Add knowledge base integration — Feed OpenClaw's long-term memory with your team's docs, runbooks, and FAQ pages for richer draft replies.
Scale with dbt™-llm-evals — As draft volume grows, use dbt™-llm-evals to evaluate reply quality at the warehouse level.
Add triage rules — Use OpenClaw's inbox-triage skill to categorize emails by urgency before drafting.
Monitor costs — Use Paradime Radar to track warehouse costs and Anthropic's usage dashboard to keep API spend in check.
Your data team's inbox doesn't have to be a black hole. With Paradime, OpenClaw, and the Gmail API, every question gets a thoughtful, human-reviewed answer — on time, every time.

