This is the shortest lesson in the course and the one that changes what you have. Up to now your agent is a very capable thing you have to remember to go and use, which makes it a tool. After today it produces its work before you open your laptop, which makes it an agent.
A cron trigger is a schedule Cloudflare keeps for you. At the time you name, it wakes your worker up and runs the job, whether or not your laptop is open and whether or not you remembered.
Your worker already has the code for this. It has been sitting in the template since lesson 5, waiting for a schedule to exist.
A schedule only wakes your agent up. When it wakes, all it has is its job and whatever it can read by itself.
So if your agent cannot start until you tell it something (which client, which lab came back, what happened on a call), a schedule will have it write the same thing every morning. That job has a good home in a Claude Project or a ChatGPT Project, where you are the trigger. You paste the job description in once as the project's instructions, then type the one detail each time and get the draft back.
For this course, go back to your list from lesson 1, take the next one down that can run on its own, and rewrite JOB. It takes about ten minutes on the same worker, and everything you have built so far still counts.
Do this before you touch Cloudflare, because it is the only decision in the lesson that matters.
Pick a time you will actually read it. An agent that runs at 3am and leaves you something you get to on Thursday is a filing cabinet. One that runs an hour before your day starts is a colleague.
Pick a time early enough to be useful and late enough to be current. For most practices that lands somewhere between 5am and 7am. If your agent reads live data, running it too early means it looked before the day had anything in it.
Match the rhythm to the job. A follow-up agent earns its keep daily. A weekly review agent does better on a Sunday evening or a Monday morning, and running that one every day just teaches you to skim past it. More often is worse rather than better, and an agent producing something you have stopped reading costs you more than one producing less.
Some of them you can paste exactly as they are.
| You want | Enter this |
|---|---|
| Every day at 6am UTC | 0 6 * |
| Every weekday at 6am UTC | 0 6 1-5 |
| Every Monday at 7am UTC | 0 7 1 |
| Every Sunday at 6pm UTC | 0 18 0 |
Reading left to right, the five fields are minute, hour, day of month, month, and day of week, and a * means every one of them.
⚠️ Cloudflare runs on UTC and it has no idea where you are. This is the single most common thing to get wrong in this lesson, and it shows up as an agent arriving in the middle of your afternoon. Work out the difference between your own time and UTC, then apply it to the hour field. The quickest way is to search "current UTC time" and compare it with the clock on your screen. Five hours behind UTC and wanting 6am your time gives you 0 11 *.
If your clocks change for daylight saving, your difference from UTC changes with them, twice a year, while UTC itself stays put. So the week the clocks move, your agent starts arriving an hour early or an hour late, and you fix it by moving the hour field by one.
Get it wrong the first time and nothing breaks. You change one number in the trigger and deploy again.
Your agent runs at 6am while you are asleep, so it needs to put the answer somewhere that will still be there when you wake up. That somewhere is a KV namespace, which is a small store belonging to your worker.
The storage has to exist before your worker can be connected to it, so this part happens in two places.
First, make the storage.
-memory on the end, so follow-up-agent-memory, and click Create.Then connect it to your worker.
MEMORY. Your worker looks for that word and nothing else.follow-up-agent-memory from the dropdown and click Add binding. That deploys it for you./health now says memory is true, which is four of the five.
Without this your agent still runs and still thinks, and the answer evaporates. You would find nothing waiting at /latest and no clue as to why.
Do not go to bed hoping.
/run?key=yourpassword by hand once, which confirms the job and the key still work./latest?key=yourpassword. Your answer should be sitting there in plain text, and that is the proof your memory binding is wired up.15 19 *. Add it, and go and make a coffee./?key=yourpassword, which shows the whole record your agent saved, including when it ran. Find the line beginning "ranAt". It should show a time from the last few minutes, later than the run you did by hand in step 1, and if it does, your schedule works and nothing about tomorrow is a hope. (That time is written in UTC, the same clock your trigger uses.)Step 3 is the one to make yourself do. Running it by hand proves the job works, and it proves nothing whatsoever about the schedule, which is the part that has to work while you are asleep.
Give it a few minutes of grace. Cloudflare's schedules run a few minutes loose, so a cron set for 6:00 can land at 6:04, and you can leave it exactly as it is.
If ten minutes have passed and the time has not moved, the cron never ran. Check that the trigger is listed under Trigger Events in your worker's Settings, and add it again if it's missing.
If this step does not do what it says here, stop and post it in the VIP chat. Do not push through it and do not sit on it. I cannot fix what nobody tells me about, and you are almost certainly not the only one on this exact step today.
Tomorrow morning, before you open anything else, visit /latest?key=yourpassword.
Something will be waiting that you did not ask for and did not remember. Read it properly, because you are about to spend two weeks deciding whether it is any good, and lesson 8 is how you make that call.
| What you see | What it means | Fix |
|---|---|---|
/latest says "Nothing yet" after the schedule fired | Usually the cron trigger never got added | Open Settings, then Trigger Events, check it is listed, and add it again if it's missing |
| It arrives at the wrong time of day | The UTC offset, almost every time | Recalculate the hour field in the trigger and deploy again |
/latest is blank after the schedule fired | The last run failed, and a failed run saves no answer. Almost always the AI key or the credit rather than the schedule | Visit /run?key=... by hand and read the error it gives you |
/latest shows an old answer and never updates | The schedule never fires | Open Settings, then Trigger Events, check the trigger is listed, and add it again if it's missing |
memory still says false at /health | The binding is named something other than MEMORY, or the storage was made and never connected | Open your worker's Bindings tab and add the binding again with MEMORY as the Variable name, that exact word |
| It writes the same thing every morning | It has nothing new to read, so the job needs you to hand it something each time | Read Check the job before you schedule it, near the top of this lesson |
If your screen looks nothing like this, drop it in the chat and I will answer you there.
Post it in the VIP chat and ask your question there. If a step does not work, if your screen does not match what is written here, or if something just reads confusingly, that is worth saying out loud.
I am building this while you are walking through it. If you do not tell me a thing is broken, I do not know it is broken, and it stays broken for whoever comes next. Tell me and I will fix it as fast as I can.
Wins go in the same place. They tell me which parts are landing.