Skip to content

Every 10 minutes

Draft replies to customer emails using your Airtable orders

When a customer emails, a reply with their real order details is waiting in your Gmail drafts.

Runs
Every 10 minutes
Apps
Airtable, Gmail
AI
Yes, uses the built-in AI allowance
Access
Gmail gmail.modify or gmail.compose; Airtable read

Send this to your assistant

Create a ClickRuntime automation: when a customer emails, look up their order in my Airtable Orders table and draft a reply in Gmail.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small online shop gets thirty emails a day asking where an order is or when it will ship. Each one means opening Airtable, searching for the customer, copying the status and tracking number, and typing a reply.

Having a draft ready with the right order details turns each of those emails into a quick check and send, while a person still decides what goes out.

What you get out of it

  • Faster answers to order questions

    Customers get a reply sooner because the slow part, finding the order, is already done when you open the draft.

  • You still approve every reply

    Replies are saved as drafts, not sent, so you can correct anything before the customer sees it.

  • Correct details every time

    Status, dates and tracking numbers come from your order table, so you do not mistype a number while switching windows.

  • A consistent tone

    Drafts follow the voice you describe, so replies sound the same whoever on the team sends them.

How it works

What happens, step by step

  1. Every few minutes ClickRuntime checks your Gmail for new customer emails.

  2. It looks up the sender in your Airtable Orders table and skips emails it has already drafted for.

  3. AI writes a reply using the customer's question and their order status, dates and tracking details.

  4. The reply is saved as a draft in the same Gmail thread for you to check and send.

Before it runs live

  • Connect Airtable
  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail

What you get

RunsEvery 10 minutes
Draft replies to customer emails using your Airtable orderstoday, 9:00Succeeded
Gmail · DraftHi Sam, your order #1042 shipped yesterday with Northwind Post, tracking NW381220. It should arrive Thursday.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Airtable and Gmail steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
auto_reply_to_customer_emails_from_airtable_data.pyexample
import base64
from email.message import EmailMessage
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
from clickruntime import on_trigger, credentials, ai, report_fetched, http

@on_trigger
def run(event):
    gmail = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()
    msgs = gmail.messages().list(userId="me", q="label:support is:unread -label:drafted").execute().get("messages", [])
    report_fetched(len(msgs))
    if not msgs:
        return {"summary": "No new emails"}
    for m in msgs:
        msg = gmail.messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject"]).execute()
        h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
        sender = h["From"].split("<")[-1].strip(">")
        orders = http.get("https://api.airtable.com/v0/appXXXXXXXX/Orders", headers={"Authorization": f"Bearer {credentials.secret('AIRTABLE_API_KEY')}"},
                          params={"filterByFormula": f"{{Email}}='{sender}'", "maxRecords": 3}).json()["records"]
        reply = ai.generate(f"Customer wrote: {msg['snippet']}\nTheir orders: {[o['fields'] for o in orders]}\nWrite a friendly, short reply.", max_output_tokens=300).text
        draft = EmailMessage()
        draft["To"], draft["Subject"] = sender, "Re: " + h.get("Subject", "")
        draft.set_content(reply)
        gmail.drafts().create(userId="me", body={"message": {"threadId": msg["threadId"], "raw": base64.urlsafe_b64encode(draft.as_bytes()).decode()}}).execute()
    return {"drafted": len(msgs)}

FAQ

Common questions

How does it find the right order?
It matches the sender's email address to the email column in your Orders table, and uses an order number from the message when one is given.
What if no order is found?
It drafts a polite reply asking for the order number, so you can send it as is or adjust it.
Will it reply to suppliers or newsletters?
It only handles emails sent to your support address or with a label you choose, so other email is left alone.
What permissions does it need?
Gmail gmail.modify or gmail.compose; Airtable read. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Draft replies to customer emails using your Airtable orders” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.