This post contains a referral link.
In Part 1, I wrote about how I tried to send myself Cambly lesson reminders through Gmail with a Claude agent, found it couldn’t send emails automatically, and decided to solve it with n8n.

This is Part 2, the final part: the system that works out how many Cambly tickets I have left and, if I’m about to waste some, sends me an email like this one (it’s in Japanese, but it says how many lessons I’ve taken this week and how many tickets are left).
This time I’ll cover the part where “I solved it with n8n,” in other words, every step of setting up the workflow.
The workflow itself just connects six nodes, so it’s not that complicated. But the Google OAuth setup tripped me up exactly the same way it had before. “Huh, something’s not working…” “What is this error?” “It says this page isn’t safe. Is it OK to click this? ( ゚д゚)” That happened again and again. I ran full speed into the so-called “authentication wall” lol
Luckily, I’d kept proper notes, and that saved me.
Once you get through it, the system keeps running, so I hope this helps anyone who runs into the same trouble.
First, the big picture of the workflow
Before getting into the settings, let’s look at the whole workflow I built.
[Node 1] Schedule Trigger
Starts automatically every Friday at 15:00 JST
↓
[Node 2] Code (works out the week)
Calculates this Monday 3:00 JST to next Monday 3:00 JST
↓
[Node 3] Google Calendar (gets events)
Gets all the “Cambly” events in that period
↓
[Node 4] Code (counts them)
Counts the lessons + writes the email text
↓
[Node 5] IF (fewer than 3?)
↓ only if true (fewer than 3)
[Node 6] Gmail (sends the email)
Sends the reminder email to myself

My Cambly plan is three 30-minute lessons a week, so I set it up to start automatically at 3 p.m. on Friday and send me an email if I’ve taken fewer than three Cambly lessons that week.
The only place you need to write a little code is Node 2, which calculates the week starting from “Monday 3:00 JST.” Everything else is basically just connecting nodes and filling in values, so I think it’s fine even if you’re not good at programming.
Stuck again! Setting up Google OAuth
Yes, I got stuck again. It’s always the part where I go, “???” But I’d kept logs with Claude, so it could remind me right away.
To use Google Calendar and Gmail in n8n, you need to create OAuth2 credentials in the Google Cloud Console.
Create OAuth2 credentials in the Google Cloud Console
First, open the Google Cloud Console.
Google Cloud Console → create a new project → APIs & Services → Credentials → Create credentials → OAuth client ID
For the application type, choose “Web application.”
Here’s sticking point ①.
There’s a field for your n8n URL under “Authorized redirect URIs,” and if you enter an IP address, you get an error.
A red error appeared, something like “must end with a public top-level domain,” and I went, “Huh? Why?” (;´Д`A
Google’s OAuth2 doesn’t accept URLs in IP address form. I run n8n on a Synology NAS and use my Tailscale (a VPN tool) MagicDNS host name in the URL, so when I entered that, it went through.
https://(your Tailscale URL)/rest/oauth2-credential/callback
It also has to be HTTPS, not HTTP. I use Tailscale Funnel for that (the commands are in the re-authentication steps below).
Set up the OAuth consent screen
Next, set up the OAuth consent screen.
APIs & Services → OAuth consent screen
Here’s sticking point ②.
I was setting things up in testing mode at first, and when I tried to authenticate, I got this error: “Access blocked: has not completed the Google verification process.”
I panicked, thinking I needed Google to review the app, but actually you just need to add your own Gmail address as a test user.
The UI is a bit confusing: choose “Audience,” and on that screen, where the “Publishing status” is shown, the field for adding test users is at the very bottom. Enter your own Gmail address there and you’re done.
There’s a big “Publish app” button on the screen, but it involves a review process, so you don’t need to press it at first. (However, in this state there’s a trap where the token expires after 7 days. That problem comes up later, and I’ll get to it below.)
A “Google hasn’t verified this app” warning: is it OK to click through?
This was the biggest trap.
When you click “Sign in with Google” on n8n’s Credentials screen and go through the authentication flow, a screen like this appears partway through:
“Google hasn’t verified this app”
You have two choices: “Back to safety,” or “Advanced” → “Go to (app name) (unsafe).”
If you press “Back to safety,” it looks as if the credential was saved even though authentication isn’t finished. Then later, when you run a node, you get errors like “Could not load list” or “Unable to sign without access token,” and you go, “Huh? Why?”…
The right answer is “Advanced” → “Go to…”.
An OAuth app you made yourself hasn’t been reviewed by Google, so in testing mode this warning always appears. But it’s your own app, so there’s no problem. When you continue, the screen asking for permission to access Google Calendar appears, and once you allow it, authentication is complete.
It took me quite a while to figure this out…
Set up the Gmail credential too
Google Calendar and Gmail each need their own credential.
However, you can reuse the same OAuth2 client ID and secret. Enable the Gmail API as well in the Google Cloud Console, and when you create a new Gmail credential in n8n, enter the same client ID and secret.
The “unverified app” warning appears again, but this time I went straight ahead with “Go to…” without hesitating lol
Setting up the six nodes
Once you’re over the authentication wall, all that’s left is building the workflow.
Node 1: Schedule Trigger (every Friday at 15:00 JST)
Change the Trigger Rule to Custom and enter a Cron Expression.
0 15 * * 5
This runs automatically every Friday at 15:00.
n8n’s schedule runs in the time zone set for your n8n. If you run it in Docker, that’s the GENERIC_TIMEZONE you set when starting it, and if you set nothing, it’s New York time. My n8n is set to Japan time (Asia/Tokyo), so I can just write 15:00 as it is. If you want a different time zone for one workflow, you can change it in that workflow’s Settings → Timezone.
Node 2: Code (works out this week’s period)
For me in Japan, the Cambly week resets at 3:00 on Monday, Japan time. So I needed to calculate the period from “this Monday 3:00 JST to next Monday 3:00 JST” and pass it to the next node, Google Calendar.
The code looks like this:
const jstOffset = 9 * 60 * 60 * 1000;
const nowUTC = new Date();
const nowJST = new Date(nowUTC.getTime() + jstOffset);
// The Cambly week resets at Monday 3:00 JST
const dayOfWeek = nowJST.getDay(); // 0=Sun, 1=Mon, ..., 5=Fri, 6=Sat
const daysFromMonday = dayOfWeek === 0 ? 6 : dayOfWeek - 1;
const lastMondayJST = new Date(nowJST);
lastMondayJST.setDate(nowJST.getDate() - daysFromMonday);
lastMondayJST.setHours(3, 0, 0, 0);
const nextMondayJST = new Date(lastMondayJST);
nextMondayJST.setDate(lastMondayJST.getDate() + 7);
// Convert to UTC and pass to the API
const weekStart = new Date(lastMondayJST.getTime() - jstOffset);
const weekEnd = new Date(nextMondayJST.getTime() - jstOffset);
return [{ json: {
weekStart: weekStart.toISOString(),
weekEnd: weekEnd.toISOString()
}}];
The reason only getDay() = 0 (Sunday) uses 6 is to make Monday the starting point. On Friday (5), Monday was “5 − 1 = 4 days ago”; on Saturday (6), “6 − 1 = 5 days ago”; only Sunday (0) is special: Monday was “6 days ago.”
This code quietly tripped me up lol. At first I wrote code that started the week on Sunday, and it took me a while to realize Cambly resets at 3:00 on Monday.
Node 3: Google Calendar (gets the events)
- Resource: Event
- Operation: Get Many (← easy to confuse with Get an Event, but this is the one for getting several events in a date range)
- Calendar: Primary
- Return All: ON
- After: {{ $json.weekStart }}
- Before: {{ $json.weekEnd }}
- Options → Add option → Query: Cambly
“Get an Event” gets one event by its ID, while “Get Many Events” gets several within a date range. At first I chose “Get an Event” and went, “Wait, I can’t get more than one!?” ( ゚д゚)
Putting Cambly in Query narrows it down to just the Cambly events in your calendar.
Node 4: Code (counts them + writes the email)
This counts the events it got and writes the email text.
const events = $input.all();
const count = events.length;
const remaining = 3 - count;
return [{ json: {
count,
remaining,
subject: `⚠️ You have ${remaining} Cambly lesson(s) left this week`,
body: `Cambly lessons this week: ${count}\n\nYou still have ${remaining} lesson(s) left.\nThe week resets at Monday 3:00 JST (late Sunday night), so book early!\n\n👉 https://www.cambly.com`
}}];
The fewer lessons you’ve taken that week, the more you have left, so I put remaining in the email subject to show at a glance how many lessons I can still use.
(My actual email is in Japanese. I’ve translated the text here.)
Node 5: IF (fewer than 3?)
This one had a quiet sticking point too.
In the latest version of n8n, the IF node doesn’t have an “Operation” dropdown. There’s a “T” (text type) icon at the left end of the condition row, and you need to click it and change it to Number before choosing “is less than.”
- Value 1: {{ $json.count }} (※ change the type to Number before entering it)
- Operation: is less than
- Value 2: 3
If you don’t set the type to Number, the numbers aren’t compared properly. They get compared as text, and the IF check goes wrong. I didn’t understand this at first either and scratched my head for a while lol
Node 6: Gmail (sends the email)
- Operation: Send
- To: your own Gmail address
- Subject: {{ $json.subject }}
- Message: {{ $json.body }}
Now the email only goes out when “count < 3.”
The test run
With everything set up, I pressed the run button.
I’d already taken three Cambly lessons that week, so the IF check came out false and no email was sent.
For a second I panicked, “Huh, it’s not working?”, but this is the correct behavior lol
I’d done three lessons, so there was no need to notify me, and it judged that correctly! (´∀`)
The next Friday, I confirmed the email arrived properly, and the setup was done ╰(*´︶`*)╯
The token expired 7 days later
Just when I thought it was working, 7 days later the emails suddenly stopped coming.
When I checked n8n’s Executions tab, the “Get many events” node showed this error:
The provided authorization grant or refresh token is invalid, expired, revoked...
Why!?? ( ゚д゚)
The cause: the OAuth app was still in testing mode.
While a Google OAuth2 app is in testing mode, the refresh token expires after 7 days. And to re-authenticate, I’d have to open Tailscale Funnel again and access n8n from the HTTPS URL…ヽ(´o`;
The real fix: switch the OAuth app to “In production”
1. Google Cloud Console → APIs & Services → OAuth consent screen
2. Press the “Publish app” button → confirmation dialog → Confirm
3. If you’re only using it yourself, you don’t have to go through Google’s verification (you’ll just see the unverified-app warning, and it’s limited to 100 users)
4. Re-authenticate once after the change, and from then on the token no longer expires after 7 days (though you’ll need to re-authenticate again if, for example, it goes unused for six months or you change your Google password)
The button name “Publish app” makes it sound like “Once it’s published, anyone can use it!?”, but this app is only connected to my own n8n, so in practice I’m the only one who uses it. So I went ahead and pressed it.
Re-authenticating (Tailscale Funnel needed)
After switching to production, you need to re-authenticate once. This part is a bit of a pain lol
1. Connect to the Synology over SSH and turn on Funnel
sudo tailscale funnel --bg 5678
2. Open the Tailscale HTTPS URL in your browser (the Tailscale URL, not the local IP)
3. n8n → Credentials → the credential → Reconnect
4. The “unverified app” warning → authenticate with “Go to…”
5. When you’re done, turn Funnel off
sudo tailscale funnel --https=443 off
If you try to re-authenticate with n8n still open on its local IP, you get {"status":"error","message":"Unauthorized"}. Always re-authenticate with n8n open on the Tailscale HTTPS URL. This is the most important point when re-authenticating.
After switching to production and re-authenticating, it has kept running well past 7 days ♪
Summary
That was long, but here it is in a nutshell:
- The n8n workflow itself is simple: just six connected nodes
- The easy place to get stuck: the Google OAuth setup
- Redirect URIs can’t be IP addresses → a MagicDNS host name + HTTPS is required
- For the “Google hasn’t verified this app” warning, “Advanced” → “Go to…” is right (“Back to safety” leaves authentication unfinished)
- In testing mode, the token expires after 7 days → move it to production with “Publish app”
- For me in Japan, the Cambly week starts at Monday 3:00 JST (this matters. Not Sunday, so be careful)
- Now an email arrives automatically every Friday, and my wasted tickets have dropped dramatically
That’s the two-part series: in Part 1, I got stuck because a Claude agent couldn’t send Gmail automatically and solved it with n8n. I hope it helps if you use Cambly. For all my fellow English learners, let’s waste as few tickets as possible and become fluent (´∀`)
Referral link: if you sign up through it, I may receive free lesson minutes.
📅 I’ve kept using it long enough to build automatic reminders
Talking with native tutors, you come across lots of expressions you never see in textbooks. You can start a lesson any time, 24 hours a day, without booking, so you can talk whenever the mood strikes, even late at night after work. Through my referral link, you get 10 extra minutes when you buy a trial. I’ve been taking lessons on Cambly since July 2021.
Try Cambly with my referral link →
The referral program isn’t available in every region.
English expressions I learned (B2–C1)
I’m aiming for Eiken Grade 1, so I had AI pick out some useful phrases from this topic.
① grant access (to give permission to use something)
You’ll need to grant access to your Google Calendar when setting up the OAuth credentials.
An expression for exactly the moment in OAuth setup when you allow access to your calendar. “Grant” has the nuance of formally allowing or giving something.
② token expiry / token expiration (a token running out)
Our automation broke after 7 days because of token expiry. We hadn’t switched from testing mode.
Both “expiry” (British) and “expiration” (American) work. You see them often in IT contexts.
③ work around (to find a way around a problem)
We worked around the IP address restriction by using a MagicDNS host name instead.
The nuance is dealing with a problem by going around it rather than solving it head-on. It comes up a lot when people talk about troubleshooting.
☕ Enjoyed this post?
I'm a Japanese blogger who spent 8 years relearning English from scratch.
If this post helped you, a coffee would mean a lot — thank you for reading!






















Leave a Reply