What this automation does
Every week your inbox fills with "Are you open this Sunday?", "What time do you close on Saturday?" Each answer is quick, but together they eat your morning.
This automation watches your Gmail inbox. When a customer asks about opening hours, it looks up your real hours in a Google Sheet and writes a short, friendly reply. It saves that reply as a draft in the same e-mail conversation. You read it, and if it's right, you press Send.
Who this is useful for
- Gift shops and boutiques
- Cafés and bakeries
- Salons and studios
- Repair shops
- Any shop whose hours change by season
What you will have when finished
- Opening-hours e-mails get a reply draft within about a minute.
- Each draft sits in the customer's conversation in Gmail, ready to send.
- All other e-mails are left exactly as they are.
Before you begin
- An n8n account: n8n Cloud (free trial) or self-hosted.
- The Gmail account your customers write to. This guide uses Gmail. Other mail services need a different first step.
- A second e-mail address you own, used as a pretend customer while testing. A free Gmail address works.
- An Anthropic (Claude) account for the API key.
Time: About 45–60 minutes the first time (our estimate).
How much it costs
The template itself is free. Running it uses a few services. Some are free and some charge you. Here is every one of them, in plain English.
| Service | Why you need it | Free option? | When might you pay? |
|---|---|---|---|
| n8n Cloud | Runs your automation 24/7 | Free trial, no credit card needed (trial limit: 1,000 runs) | After the trial. Starter is listed at €20/month billed annually for 2,500 runs a month. Pro is €50/month billed annually for 10,000. Paying monthly costs more. n8n pricing |
| n8n on your own computer or server (alternative) | Same automation, run by you | Yes, the community edition is free | For the server it runs on. It must be online all the time and reachable from the internet. This is the more technical option. |
| Claude AI (Anthropic API) | Reads messages and writes short replies | New accounts get some free credits (Anthropic doesn't state the amount) | Pay as you go. Claude Haiku 5.5 is $0.10 per million tokens read and $0.50 per million tokens written (a token is a small piece of a word). One real run of this template cost about $0.0002 (our estimate, see below). Anthropic pricing |
| Google Sheets | Stores your opening hours | Yes, with a personal Google account | Only if you choose Google Workspace for your business |
| Gmail | Reads new customer e-mails and saves reply drafts | Yes, with a personal Google account | If you want a business address like you@yourshop.com through Google Workspace (paid per user) |
Download the template
A template is a ready-made automation saved as a small file. The file ends in .json, which is simply the format n8n uses to save workflows. You don't need to open or edit it. You'll import it into n8n in the setup steps below.
small-shop-agents-email-draft.json
Free · no sign-up · contains no passwords or personal data · tested with n8n 2.48.7
See exactly what we tested in our template testing report.
Step-by-step setup
Write your opening hours in a Google Sheet
- Open sheets.new and name the file, for example Shop Info.
- Rename the tab at the bottom to exactly
Business Hours. - Copy this block and paste it into cell A1, then change the hours to yours:
day is_open hours_text note Monday TRUE 10 AM – 6 PM Tuesday TRUE 10 AM – 6 PM Wednesday TRUE 10 AM – 6 PM Thursday TRUE 10 AM – 6 PM Friday TRUE 10 AM – 6 PM Saturday TRUE 10 AM – 6 PM Sunday TRUE 11 AM – 4 PM
Real result Our test sheet. One row per day of the week. - day: the full English weekday name.
- is_open:
TRUEif you're open,FALSEif you're closed that day. - hours_text: written like
10 AM – 6 PM(with AM/PM). Leave it empty on closed days. - note: for your own notes. The automation ignores it.
Open n8n (or create a free n8n Cloud account)
n8n is the program that runs your automation. Think of it as a very reliable assistant that follows a checklist every time something happens.
- If you don't have n8n yet: go to n8n.io and start the free n8n Cloud trial. You don't need a credit card. Pick a name for your account when asked. It becomes part of your n8n address, for example
yourshop.app.n8n.cloud. - If you already use n8n: just sign in.
You'll land on the Overview page, which lists your workflows. A workflow is n8n's word for one automation.
- If you don't have n8n yet: go to n8n.io and start the free n8n Cloud trial. You don't need a credit card. Pick a name for your account when asked. It becomes part of your n8n address, for example
Import the template
- Click the Create workflow button in the top-right corner of the Overview page. An empty canvas opens.
- Click the three dots (⋯) next to the workflow name at the top.
- Point to Import, then click From file.
- Choose
small-shop-agents-email-draft.jsonfrom your Downloads folder. - If n8n asks "Importing this from an AI tool?", click Skip.
Real screenshot ① Click Create workflow. (n8n 2.48.7. Your list of workflows will be empty at first.)
Real screenshot ① Three dots → ② Import → ③ From file.
Real screenshot If this question appears, click ① Skip. You don't need it for this guide.
Real screenshot The template is now on your canvas. The blue Start here note lists what to connect. Each box is one step, and the grey text under each box says what it does. Connect the AI (Claude)
The AI steps need permission to use Claude. That permission is an API key (a long secret password that lets one program use another. Treat it like a bank PIN).
A. Create the key
- Go to platform.claude.com and sign up or sign in.
- Open Settings → API keys and click Create key. Name it n8n shop automations.
- Copy the key. It starts with
sk-ant-. You'll paste it into n8n in a moment. Don't paste it anywhere else. - If Anthropic asks you to add billing, follow their steps. New accounts get some free credits.
B. Add the key to n8n
- On the canvas, double-click the round Anthropic (classify) step.
- Click the Credential box at the top and choose Create new credential.
- Paste your key into API Key, then click Save. n8n stores it encrypted. It never appears in your template file.
- Double-click Anthropic (write) and choose the same credential in its Credential box.
Real screenshot ① The Credential box of the Anthropic (classify) step. (On our test computer an account was already connected. Yours will be empty until you create one.)
Real screenshot ① Paste your key into API Key, then ② click Save. The field in this screenshot is empty on purpose. Never share a picture of your real key. Connect your Google account (Gmail and Google Sheets)
Each Google step needs your permission to use your Google account. On n8n Cloud this is quick: n8n's docs describe it as "Sign in with Google directly on n8n, with no setup required on the Google Cloud Console."
- Double-click the Google step named below, click the Credential box and choose Create new credential.
- Click the button to sign in with Google. A Google window opens.
- Pick the Google account that owns your spreadsheet and inbox, then click Allow on the permissions page. You type your Google password only into Google's own window, never into n8n.
- Back in n8n, you'll see a success message. Close the credential window.
Tell the Google Sheets step which spreadsheet to use
Every Google spreadsheet has an ID, a long code in its web address. Here's how to copy it:
- Open your spreadsheet in Google Sheets. Look at the address bar:
docs.google.com/spreadsheets/d/1AbC…xyz/edit - Copy only the part between
/d/and/edit. That's the ID. - In n8n, double-click the Look Up Business Hours (Sheet) step.
- Check that ① Credential shows your Google account.
- In ② Document, replace
PASTE_YOUR_SPREADSHEET_ID_HEREwith your ID. - Check that ③ Sheet says
Business Hours, exactly the name of your tab.
Real screenshot ① Your Google account · ② the spreadsheet ID · ③ the tab name. - Open your spreadsheet in Google Sheets. Look at the address bar:
Choose whose e-mails are read (start with a test address)
For safety, the template only reads e-mails from addresses you list. While testing, that should be just your second, pretend-customer address.
- Double-click New Customer Email (Gmail). Check ① Credential. Then scroll down to Filters and, in ② Sender, replace
YOUR_TEST_ADDRESS@example.comwith your test address. - Close it and double-click Only Test Customer. In the code box, use your browser's search (Ctrl+F or ⌘+F) to find
const allowed = ["YOUR_TEST_ADDRESS@example.com"];near the bottom, and type your test address between the quotes. Change nothing else in this box.
Real screenshot ① Your Gmail account. The Sender filter is further down, under Filters. The trigger checks for new unread e-mails every minute. - Double-click New Customer Email (Gmail). Check ① Credential. Then scroll down to Filters and, in ② Sender, replace
Put your shop name into the reply
Double-click AI Writes the Reply. In the large text box that starts with "Write a short, friendly…", replace The Corner Shop (our fictional demo shop) with your shop's name. Change nothing else.
Check the draft step
Double-click Save Draft — Not Sent (Gmail). Check ① Credential, and that ② the operation is Create (a draft). There's no Send step in this workflow, and you shouldn't add one.
Real screenshot ① Gmail account · ② Create draft. It saves a draft and doesn't send.
Test your automation
Publish the workflow
Click Publish (top right). Gmail-triggered automations check your inbox on a schedule, so they need to be published to run on their own. You can unpublish any time.
Send a test e-mail
From your test address, send an e-mail to your shop's Gmail. Use the subject Quick question and the text Are you open this Sunday?
Wait about a minute
The automation checks every minute. Leave the e-mail unread, because it only picks up unread mail.
Open the e-mail in Gmail
Open the conversation. You should see a draft reply under the customer's message. Read it. If it's right, you can send it to your test address.
Try an unclear question
Send Are you open next Sunday? from your test address. No draft should appear, because "next Sunday" could mean two different days. That one is left for you.
What success looks like
- A draft like "Hi! Yes, we're open this Sunday from 11 AM – 4 PM. We'd love to see you!" appears in the conversation, using your hours.
- Nothing has been sent. Check your Sent folder.
- In n8n, the Executions tab shows a green, Succeeded run.
draft_problems: [] (no problems found). The test customer's address is blurred.Troubleshooting
- No draft appeared.
- Check that: the workflow is published; the e-mail came from the address in both the Sender filter and the Only Test Customer list; the e-mail was still unread; and it clearly named one day ("this Sunday", "tomorrow", "on Saturday"). Then look at Executions to see which step stopped it.
- "No row for Sunday in the Business Hours sheet — refusing to guess."
- Your sheet has no row for that day, or the tab or column names differ. Compare it with step 1. The automation stops instead of inventing hours.
- The draft says something simple like "Hi! Yes, we're open Sunday from 11 AM to 4 PM."
- That's the safety fallback. The AI's version didn't pass the hours check, so a fixed reply built from your sheet was used. The step output shows
draft_source: "template_fallback". - Every e-mail starts a run.
- Once you allow all senders (see "Turn it on"), every new e-mail starts a run. Most of them stop at the first check. Each still counts toward your n8n plan.
- A Gmail step says "invalid_grant" or "unauthorized".
- Reconnect Google in that step's credential.
How to turn the automation on for real customers
Test with a few friendly addresses first
Add more addresses to the Sender filter and the Only Test Customer list, for example your own other accounts or a family member who agreed to help.
Open it to every customer
When you're happy with the drafts:
- In New Customer Email (Gmail), clear the Sender filter.
- In Only Test Customer, change the list to
const allowed = ["*"];. The star means "anyone". Drafts are still only drafts. - Click Publish again to save the published version.
Turn it on: click Publish
While you build, the automation only runs when you test it. To make it run on its own, all day, every day:
- Click Publish in the top-right corner of the canvas.
- Confirm in the window that opens.
Real screenshot ① Publish switches your automation on. (Older n8n versions called this "Activate".) From now on, every opening-hours question gets a draft for you to review.
To switch it off later, open the same menu next to Publish and unpublish it.
How to keep it working
- Look at Executions once a week. Open your workflow and click the Executions tab at the top. Green means it worked. Red means a step failed. Click a red one to see which step and why.
- Reconnect Google if it stops. If a Google step fails with "unauthorized" or "invalid grant", open the step, click the credential and sign in with Google again.
- Watch your AI credits. In the Claude Console you can see what you've used and set a spending limit. If credits run out, the AI steps fail.
- Watch your n8n run count in your n8n account, especially in your first month.
- Update your sheet, not the workflow. When your hours change, change the sheet. The automation reads it every time.
- Get an e-mail when something fails (optional): n8n can run an "error workflow" that alerts you. See n8n's error handling guide.
Security and privacy
- Keep keys inside n8n. Paste API keys only into n8n's credential window. Never e-mail them, put them in a spreadsheet, or show them in a screenshot or video.
- Exported files are safe to share. When you download a workflow, n8n leaves your credentials out. Still, check for e-mail addresses you typed into steps.
- Customer messages are untrusted text. The templates tell the AI to only read and classify them and to ignore any instructions inside them. The important decisions are made by fixed rules, not by the AI.
- Collect only what you need. Don't ask customers for card numbers, passwords or ID numbers in your forms.
- Tell customers. Mention in your own privacy policy that messages are processed by automation tools (n8n, Google, Anthropic).
- Use a test sheet first. Make a copy called "(TEST)" while you try things out.