Build Your Own AI Team
Lesson 5

The box

What you walk away with
A worker of your own, deployed, live, with an address that belongs to you. It does nothing yet, and that is deliberate.
Time
About thirty minutes, and most of that goes on setting up an account.
Cost
Nothing. All of this sits inside Cloudflare's free tier and stays there.

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.

What a worker actually is

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.

Name it before you make it

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 spaces

Examples 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.

1A Cloudflare account

  1. Go to dash.cloudflare.com and sign up. It is free, and nothing this course does needs a card on file.
  2. Verify the email they send you.

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.

2Make the worker

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.

  1. Find Workers & Pages in the left menu. On a lot of accounts it now sits inside the Compute section, so open that if you can't spot it, or type "Workers" into the search bar at the top of the dashboard.
  2. Click the blue Create application button, which is how Cloudflare makes a new worker.
  3. Click Start with Hello World! (some accounts show Create Worker here instead, and either one takes you to the same place).
  4. Name it using the convention above, because this becomes your address permanently.
  5. Click Deploy.

Cloudflare deploys a starter that says "Hello World." That one is theirs, and you are about to replace it with yours.

  1. Edit code, top right
  2. Select everything in the code box and delete it
  3. Open 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)
  4. Deploy again

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.

3Check that it is alive

Visit your address with /health on the end.

https://follow-up-agent.yourname.workers.dev/health

What 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.

LineTurns true in
passwordlater in this lesson
joblesson 6, when you tell it what to do
aiKeylesson 6, when it can think
memorylesson 7, when it can leave you answers
readsFromlesson 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.

4Lock the door

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.

  1. In your worker, open Settings and find Variables and Secrets.
  2. Click Add.
  3. Set the Type to Secret rather than Text, because this one is a lock, and a lock you can read back is a lock sitting next to its own key.
  4. In Variable name, type SHARED_KEY, exactly that, all capitals, with the underscore.
  5. In Value, invent a password. Long and boring beats short and clever.
  6. Click Deploy. There's no separate Save button in this panel, so Deploy is what keeps it.

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 laterUse it for
TextYesAnything you will want to edit, so settings, addresses, and instructions
SecretNo, ever. You replace it insteadAnything 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.

✅ You now have

Nothing thinks yet. That is lesson 6, and it takes an AI key plus a job description you write yourself.

If something looks wrong

What you seeWhat it meansFix
"There is nothing here yet"The paste did not take, or you did not deploy after pastingEdit code, check the template text is there, Deploy again
A page of red error textPart of the template got cut off on the way overDelete everything, copy the template again from the very first line to the very last, paste, Deploy
/health returns nothing at allThe address is wrong, usually a typo in the worker nameCopy it from the Cloudflare page rather than typing it out
unauthorized on any other addressCorrect behavior. Everything except /health wants your passwordAdd ?key=yourpassword on the end
password still says falseNamed something other than SHARED_KEY, or the panel closed before you clicked DeployOpen 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.

Stuck, or something not flowing? Tell me

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.

Print this or save it as a PDF with Cmd+P, or Ctrl+P on Windows.