This lesson carries one idea, which is that something of yours is now running somewhere other than your laptop. The AI key and the job description could have gone in here as well, and then this would be a ninety-minute lesson where a snag at step fourteen makes step three feel like wasted effort. They wait for lesson 6. Half an hour from now you have something alive on the internet with your name on it.
Two minutes on this, because the alternative is clicking buttons in the right order without knowing why, which holds up beautifully until the morning something breaks.
A worker is a small program that lives on somebody else's computer and answers when something visits its address.
That is the whole of it, and three useful things follow from it.
It does not live on your laptop. Close the lid, go and see clients, get on a plane. It is still there and still answering. Something that only runs while your own machine is awake is a program you have to babysit rather than an agent.
It has an address, the same way a website does. Yours will look like https://follow-up-agent.yourname.workers.dev. That address is how you talk to it, how your command center talks to it, and how it gets woken up.
It does something only when something asks it to. It sits there costing nothing at all until it is visited or its schedule fires, which is why running several of them costs approximately nothing. They are absent until needed rather than idling in the background.
Nothing to maintain. You do not rent a server, patch anything, keep anything updated, or leave a machine running somewhere on your behalf.
You are going to have more than one of these. Decide the naming convention now, while you have zero of them, rather than in four months with five workers called some variation of worker-2.
The convention this course uses today and everywhere after it.
<job>-agent all lowercase, hyphens between words, no spacesExamples are follow-up-agent, weekly-review-agent, and monday-brief-agent.
Name it after the job rather than after the tool. follow-up-agent will still make sense to you a year from now, whereas claude-worker describes the wiring instead of the work and stops being true the day you change which AI you use.
The name becomes part of the address permanently, and changing it afterward means building the worker again, so it earns ten seconds of thought.
Use the sentence you wrote in lesson 1. "My first agent will find anyone who inquired and never got a reply" gives you follow-up-agent.
They will offer you domains and paid plans on the way through, and you need none of it. If you are looking at a price, you have wandered off the path, so come back to Workers.
Cloudflare rearranges its dashboard every so often, so if a button has wandered off from where a step says, type its name into the search bar at the top of the dashboard.
Cloudflare deploys a starter that says "Hello World." That one is theirs, and you are about to replace it with yours.
agent-worker-TEMPLATE.js from your course files, copy all of it, and paste it in (download a fresh copy if it's missing from your folder)Copy your address now and keep it handy. It looks like https://follow-up-agent.yourname.workers.dev, every lesson after this one asks you for it, and in Part 4 it goes into your first password manager entry.
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.
Visit your address with /health on the end.
https://follow-up-agent.yourname.workers.dev/healthWhat comes back looks like this.
{
"ok": true,
"agent": "Your agent",
"configured": {
"password": false,
"job": false,
"aiKey": false,
"memory": false,
"readsFrom": null
}
}Four of those say false, the fifth says null, and every one of them is a pass.
Your agent is alive and telling you exactly which pieces it is missing. Nothing is broken. Those five lines are the rest of this course.
| Line | Turns true in |
|---|---|
password | later in this lesson |
job | lesson 6, when you tell it what to do |
aiKey | lesson 6, when it can think |
memory | lesson 7, when it can leave you answers |
readsFrom | lesson 10, when it can see your own data |
Come back to /health first whenever something misbehaves. It is the fastest way to find out which piece is missing, and the habit will save you more time than anything else in this course.
Right now anybody who guesses your address can visit it. There is nothing behind it worth having yet, and that changes in the next lesson, so lock it while it is still a two-minute job.
SHARED_KEY, exactly that, all capitals, with the underscore.Text and Secret, since this is the first time you have met the choice. Cloudflare offers two kinds of variable and it asks you which one every single time.
| Can you read it back later | Use it for | |
|---|---|---|
| Text | Yes | Anything you will want to edit, so settings, addresses, and instructions |
| Secret | No, ever. You replace it instead | Anything that costs you money or access if it leaks |
When you cannot decide, choose Secret. The cost of a Secret you wanted to read is retyping it once. The cost of a Text you should have made a Secret is a key sitting in plain view if a stranger ever gets into your account.
Put that password in your password manager now, because Cloudflare cannot hand it back to you afterward. Secret means secret.
This is the first entry lesson 4 told you was coming. Name it after your agent and what it holds, so follow-up-agent, password, and put your agent's address on the line for where it is used, next to SHARED_KEY.
Now visit /health again. password says true.
Nothing thinks yet. That is lesson 6, and it takes an AI key plus a job description you write yourself.
| What you see | What it means | Fix |
|---|---|---|
| "There is nothing here yet" | The paste did not take, or you did not deploy after pasting | Edit code, check the template text is there, Deploy again |
| A page of red error text | Part of the template got cut off on the way over | Delete everything, copy the template again from the very first line to the very last, paste, Deploy |
/health returns nothing at all | The address is wrong, usually a typo in the worker name | Copy it from the Cloudflare page rather than typing it out |
unauthorized on any other address | Correct behavior. Everything except /health wants your password | Add ?key=yourpassword on the end |
password still says false | Named something other than SHARED_KEY, or the panel closed before you clicked Deploy | Open Variables and Secrets, check the name character by character, and add it again if it's wrong or missing |
If your screen looks nothing like this guide, the tool moved a button. Note what you see and drop it in the chat. Cloudflare redesigns things, and this page is written against one version of it.
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.