Homework until 16 Nov: setup and build with Claude Code

On this page

The same page online, in parts: https://huettner.io/abp/ws2/hw2/

Your goals for this homework

Before you start

Part A · Set up Claude Code

What is Claude Code?

Claude Code is a major innovation from Anthropic (OpenAI followed up with a clone called Codex; an open source alternative is called OpenCode). The idea is simple (which makes it even better).

  1. Instead of copy/pasting code back and forth from Chat interfaces (like ChatGPT or Claude), Claude Code is a tool that simply writes directly onto your computer.
  2. Instead of using complicated editors and heavy software, the tool is made to live directly in the terminal. This allowed Anthropic to quickly develop a robust tool, and to focus on the main ideas.
  3. Instead of editing code or documents yourself, you describe to the AI what you want to be changed. By design, you use it as an agent.

It started as a simple idea but proved to be revolutionary in software development. Quickly, people also realized its usefulness for working with other documents, like PowerPoint or Excel files.

Better safe than sorry

Even though Claude Code usually has good intentions, it might accidentally do things on your computer that have seriously bad consequences. Hence, it’s always asking you for permission before doing something. Quickly, people said yes to everything instead of reading the fine print. Hence, developers decided to build sandboxes: within the sandbox, the AI can do what it wants, it might also reach out on well-defined paths, but that’s it.

Claude Code as a robot in a sandbox called nono: inside, it may dig, play and build as it likes; nothing may leave the box.

We use the sandbox tool called nono. We configure it so that Claude Code can

Where do I find the folder ~/kingo-pod in Windows?

The folder lies in Ubuntu, not in your Windows folders. You still see it in the File Explorer of Windows.

Open the File Explorer and follow the left side:

Linux, then Ubuntu, then home, then your Linux user name, then kingo-pod

Your Linux user name is the name you chose when Ubuntu started for the first time.

In there, you find the folder claude. It is the one folder where Claude Code can write.

Typically, Claude Code uses the Claude models from Anthropic. Here, we use it with the model GLM 5.3 Flash, paid with the OpenRouter key you already have.

Quiz. Claude Code asks you before it does something on your laptop. Why do we still put it into a sandbox?

  • Because people get tired of the questions and just say yes
  • Because Claude Code is faster in a sandbox
  • Because n8n needs it
Show the answer

Because people get tired of the questions and just say yes. Think of a program that asks you 50 times a day: “May I do this?” After a while, you click yes without reading. The sandbox is a fence around Claude Code: whatever you click, Claude Code cannot get out.

1. Update kingo-pod to get the new command kingo claude

Open a terminal (in Windows, start WSL/Ubuntu) and run this one line:

cd ~/kingo-pod && ./kingo update

What does this line mean? It has five pieces. Match each piece with what it does.

Piece What it does
cd go into a folder (“change directory”)
~/kingo-pod the folder kingo-pod in your home folder (~ is short for your home folder)
&& and then, but only if the part before worked
./kingo run the program kingo that lies in this folder (./ means: right here)
update tell kingo what to do: get its newest version

So the whole line says: go into the folder kingo-pod, and then let kingo update itself.

When it is done, run

./kingo help

You should see a line that starts with kingo claude.

Stuck? Help for step 1

2. Install Claude Code and its sandbox

One line installs three programs: nono (the sandbox), psql (so that Claude Code can talk to your Postgres database) and Claude Code. Run the command in the terminal:

On a Mac:

brew install nono libpq && curl -fsSL https://claude.ai/install.sh | bash

On WSL (Ubuntu in Windows):

curl -fsSL https://nono.sh/install.sh | sh && sudo apt install -y postgresql-client && curl -fsSL https://claude.ai/install.sh | bash
Already using Claude Code?

Run the command anyway: it installs Claude Code the way Anthropic recommends, or brings it up to date. Your own settings and your login stay as they are.

Did you install Claude Code with Homebrew or npm instead? Then you now have two installations. ./kingo claude always takes the new one. To keep only the new one, remove the old one:

  • Homebrew: brew uninstall --cask claude-code
  • npm: npm uninstall -g @anthropic-ai/claude-code

Stuck? Help for step 2

3. Make a key in n8n

Claude Code works on your workflows through n8n's API. For that, it needs a key from n8n.

  1. Open n8n at http://localhost:5678 and sign in.
  2. Click Settings at the bottom of the left sidebar, then n8n API.
  3. Click Create API key. In the window Create API Key:
    • Label: claude
    • Expiration: Never. Then the key works for the whole course.
  4. Click Save. Copy the key and keep it for step 4: n8n shows it only once.

Stuck? Help for step 3

4. Start Claude Code and give it its keys

In the terminal, run:

cd ~/kingo-pod && ./kingo claude

Always start Claude Code for the course this way. A plain claude starts a standard Claude Code, without the sandbox and without the course settings (what is different).

The first time, kingo claude asks for two keys. You do not see a key as you paste it: that is on purpose.

  1. Paste your OpenRouter key (or your group’s key) and press Enter.
  2. Paste the n8n key from step 3, and press Enter.
Don’t I need to give it a key to Langflow?

kingo-pod can make this and hand it to Claude Code. To be honest, if you have superuser access to the database used by Langflow (and by n8n), and to the file system, then you can get a lot of credentials. Feel free to ask Claude Code more about this later. And while you’re at it, you can ask how an admin can extract credentials saved to n8n.

Then Claude Code starts and asks a few questions of its own:

  1. Pick a theme for Claude Code that you like, and press Enter.
  2. Do you trust the files in this folder? Choose Yes.

You see Claude Code waiting for your first words. Well done: your coding agent is set up.

Stuck? Help for step 4

5. Let’s try it out

Type this and press Enter:

List my n8n workflows and tell me in one sentence each what they do.

Before Claude Code runs a command, it asks you. Read what it wants to do, then agree. You should see WS2.0, WS2.1, WS2.3 and WS2.4, each with a sentence. That is Claude Code reading your n8n.

To leave Claude Code (and to get back to the terminal), run

/exit

Sometimes when exiting Claude Code, you get a question from nono sandbox, if it should give Claude Code further permissions. Only add something if you know what you’re doing.

Now you can continue using this terminal as usual (you can also just open another one like you can open another tab in your browser).

Quiz. Claude Code listed your n8n workflows. Did it change anything in your n8n?

  • Yes
  • No
Show the answer

No. It only read your workflows, through n8n's API with the key from step 3. A change would be a command of its own, and in manual mode Claude Code asks you before it.

Stuck? Help for step 5

6. See the instructions Claude Code reads at every start

Claude Code reads the file AGENTS.md in its folder at every start (actually, it reads CLAUDE.md which here just has a link to AGENTS.md). You can have a look inside (the cat command just prints the content of the file into the terminal and you can continue using the terminal as usual):

cat ~/kingo-pod/claude/CLAUDE.md

And

cat ~/kingo-pod/claude/AGENTS.md

With your team's rules in AGENTS.md, Claude Code builds the way your team decides: the same names, the same contracts between flows and between tools.

Start Claude Code again with

cd ~/kingo-pod && ./kingo claude

and ask:

What are our team's rules?

Claude Code should say that your team has not added its rules yet. That is right, and it shows that Claude Code has read AGENTS.md.

How do I change AGENTS.md myself?

Open it in a text editor, like any text file:

  • On a Mac, this line opens it in TextEdit:
    open -e ~/kingo-pod/claude/AGENTS.md
    
  • On Windows, in the Ubuntu app, this line opens it in Notepad:
    cd ~/kingo-pod/claude && notepad.exe AGENTS.md
    

Change it, then save with Cmd+S (Mac) or Ctrl+S (Windows).

Or do it in nano, an editor inside the terminal. It works the same on a Mac and in the Ubuntu app. Do not confuse nano with nono:

  • nano is the opposite of a huge tool like MS Word for a simple task.
  • nono is the opposite of saying "yes, yes, …" to Claude Code.
nano -w ~/kingo-pod/claude/AGENTS.md

(-w keeps long lines as they are.)

  • Move with the arrow keys, and type as usual. A mouse click does not move the cursor.
  • Paste: on a Mac Cmd+V, in the Ubuntu app a right click.
  • Save: Ctrl+O (on a Mac the key control, not command), then Enter.
  • Leave nano: Ctrl+X.

The two lines at the bottom of nano show these keys: ^O means Ctrl+O.

Claude Code reads AGENTS.md only when it starts. After a change, leave Claude Code with /exit and start it again.

Try it: add this line at the very end of AGENTS.md, with your own language if it is not Korean:

Always answer me in Korean.

Save, /exit and start Claude Code again with

./kingo claude

and ask it something: it answers in Korean. Keep the line, or delete it again.

It’s a good idea to add your team’s design rules to AGENTS.md.

Quiz. You change AGENTS.md while Claude Code is running. When does Claude Code follow the new rules?

  • At once
  • After its next start
Show the answer

After its next start. Claude Code reads AGENTS.md only when it starts. So leave it with /exit and start it again with ./kingo claude.

Stuck? Help for step 6

Part B · How Claude Code works here

7. What Claude Code can do, and what it cannot

Claude Code can Claude Code cannot
read and write in ~/kingo-pod/claude write anywhere else on your laptop
read kingo-pod: compose.yml, the guides change kingo-pod, or run ./kingo
change your n8n workflows and data tables, your Langflow flows and your Postgres database see your keys: it gets stand-ins
look things up on the web see your own Claude Code settings, if you use Claude Code already

Sometimes, Claude Code wants to execute a command (which we don’t allow), and then it’ll tell you to run a command on its behalf in the terminal.

Quiz. Claude Code says that the sandbox blocks a command, and asks you to run it in your own terminal. Should you?

  • Yes: Claude Code needs it to go on
  • Only if I understand the command
  • No, never
Show the answer

Only run a command in your own terminal if you understand it. Claude Code cannot leave its sandbox, but a command you type does. When Claude Code says that the sandbox blocks it, that is the sandbox doing its job.

Quiz. In step 4 you gave kingo your n8n key. Does Claude Code know the key now?

  • Yes: it needs the key to reach n8n
  • No: it gets a stand-in
Show the answer

No. Claude Code gets only a stand-in. nono keeps the real key and puts it into each request that Claude Code sends to n8n. Hence, your key is not uploaded to the provider of the LLM, but Claude Code can still use it. The Langflow key and your OpenRouter key are kept the same way.

8. Claude Code always asks for permission: should we tell it to just do its job?

Claude Code always works in one of four modes. The mode decides who says yes before a command runs: you, the AI, or nobody. The line under your text shows the mode, for example ⏸ manual mode on.

The mode does not decide where Claude Code can write. The nono sandbox does that, as the table above shows: Claude Code cannot write into any other folder on your laptop, such as Documents or Desktop, with or without your permission. The mode only decides whether Claude Code asks you first.

To change the mode, press Shift+Tab. Each press takes you one mode further, in this order:

  1. ⏸︎ manual mode on: Claude Code asks you before it writes a file and before it runs a command. ./kingo claude always starts here.
  2. ⏵⏵ accept edits on: Claude Code writes files in its folder ~/kingo-pod/claude without asking. Before a command, it still asks you.
  3. ⏸︎ plan mode on: Claude Code changes nothing. It writes a plan and asks for your yes.
  4. ⏵⏵ auto mode on: the AI decides itself whether it needs to ask you for permission.

One more press of Shift+Tab, and you are back in manual mode.

Quiz. The line under your text says plan mode on. You ask Claude Code to rename a workflow. What happens?

  • Claude Code renames the workflow
  • Claude Code writes a plan and asks for your yes
Show the answer

Claude Code writes a plan and asks for your yes. In plan mode, it changes nothing before you agree to the plan.

⏵⏵ There is a fifth way, where nobody says yes or no: you start Claude Code with ./kingo yolo instead of ./kingo claude. Then Claude Code never asks for permission.

The difference, in five examples:

What Claude Code wants to do ⏸︎ In manual mode ⏵⏵ In accept edits mode ⏵⏵ In auto mode ⏵⏵ Started with ./kingo yolo
Write a file: save its findings in the file notes.md in its folder ~/kingo-pod/claude Claude Code asks you for permission first Claude Code writes the file without asking you Claude Code writes the file without asking you Claude Code writes the file without asking you
Run a command that only reads: list your n8n workflows Claude Code asks you for permission first Claude Code asks you for permission first The AI checks the command. If the AI judges it safe, Claude Code runs it without asking you. If not, the command does not run Claude Code runs the command without asking you, and the AI does not check it
Run a command that changes something: make a copy of a Langflow flow Claude Code asks you for permission first Claude Code asks you for permission first The AI checks the command. If the AI judges it safe, Claude Code runs it without asking you. If not, the command does not run Claude Code runs the command without asking you, and the AI does not check it
Run a command that you said no to: you wrote “Do not change the original flow”, but Claude Code gets confused and wants to change the original Claude Code asks you for permission first. If you say yes without reading, the command runs Claude Code asks you for permission first. If you say yes without reading, the command runs The AI checks the command. It sees that you said no to this: the command does not run. But the AI can get it wrong too: then the command runs Claude Code runs the command without asking you, and the AI does not check it
Write a file outside its folder: save a file on your Desktop The nono sandbox stops it, with or without permission The nono sandbox stops it, with or without permission The nono sandbox stops it, with or without permission The nono sandbox stops it, with or without permission

The fourth example shows the risk. An AI can get confused, and then it changes or deletes something that nobody asked for. This happened to a professor: he asked for new page numbers, and lost the lecture notes of a year.

Watch the video: “Claude Just Deleted a Year of Lecture Notes” (Better Stack, 1.5 minutes)

Who stops such a command?

So no mode makes you safe. Two other things do: the nono sandbox lets Claude Code write in its folder only, and every start of ./kingo claude saves a copy of your workflows and flows. There is no such copy of your Postgres database.

What does this mean for you? In this homework, Claude Code rarely writes files. It mostly runs commands to search, and to talk to n8n, Langflow and your Postgres database. In accept edits mode, Claude Code still asks you before each of these commands. The requests stop only in auto mode, or with ./kingo yolo.

Which mode should you use? Auto mode is okay. Claude Code runs inside the nono sandbox, so the sandbox protects your laptop in every mode. And every start of ./kingo claude saves your n8n workflows and your Langflow flows. In manual mode, you get many requests, and the commands are hard to read. So feel free to switch to auto mode: press Shift+Tab until the line under your text says auto mode on.

In manual mode, Claude Code asks before each command. Yes runs the command. No stops Claude Code: then tell it what to do instead, or type continue.

Quiz. You are in auto mode. Claude Code tells you that a request was blocked, and asks whether it may try again. It is the change you asked for. What do you do?

  • Type /exit and start again
  • Say yes, and name what it may do
  • Nothing: Claude Code finds another way
Show the answer

Say yes, and name what it may do, for example: Yes, retry saving the change to the copy. In auto mode, the AI may refuse a command that you asked for. Is it blocked again? Press Shift+Tab until the line under your text says manual mode on, and say it again.

9. You decide: ./kingo yolo starts Claude Code without any check

In each of the four modes, someone checks a command before it runs: you, or the AI. You can also start Claude Code with no check at all. To this end, you start it with this line:

./kingo yolo

The first time, Claude Code asks whether you accept this mode. Choose Yes, I accept.

./kingo claude ./kingo yolo claude (without kingo)
Your laptop is protected by the nono sandbox and by Claude Code’s hesitations protected by the nono sandbox protected only by Claude Code’s hesitations: no sandbox
Your workflows, flows and database you see every change before it happens Claude Code changes them at once, mistakes too out of reach at first, as Claude Code has no keys for them; but it can read every file you can, your keys too
Your user experience many requests for permissions, often the same ones Claude Code works on by itself Anthropic's standard Claude Code: your own Anthropic login and bill, and the usual requests for permissions

The requests for permission protect your project from Claude Code's mistakes. If you let Claude Code work without asking, save your work first. This line saves your n8n workflows and your Langflow flows into ~/kingo-pod/backups/ (not your own tables in the database):

cd ~/kingo-pod && ./kingo backup

Quiz. Claude Code changed your n8n workflow WS2.3 - Triage New Mail, and now it does not work. Where is the version from before?

  • It is gone
  • In ~/kingo-pod/backups/flows/
  • In Claude Code's memory
Show the answer

In ~/kingo-pod/backups/flows/. Every start of ./kingo claude or ./kingo yolo saves each n8n workflow and each Langflow flow there as one JSON file, in a folder per start. The newest 10 starts stay. You can import such a file again in n8n or in Langflow.

10. What is different from a standard Claude Code, and where it is configured

The Claude Code you started with ./kingo claude is set up for the course.

Quiz. You are in the folder ~/kingo-pod/claude and type claude. Are you in the sandbox?

  • Yes: the folder belongs to kingo-pod
  • No
Show the answer

No. Then you get a standard Claude Code with Anthropic's settings: no sandbox, your own ~/.claude, your own Anthropic login. Even in ~/kingo-pod/claude, a plain claude runs without the sandbox and without the keys. Here, you're on your own, kid.

The course setup holds only when you start Claude Code with ./kingo claude or ./kingo yolo.

In detail: what ./kingo claude changes, and where

What is different from a Claude Code you install and start with claude, and the file where each part is configured:

A standard Claude Code Here, started with ./kingo claude Configured for the course in
Start claude, in any folder ./kingo claude in the kingo-pod folder; ./kingo yolo is the same without requests for permission. Claude Code works in kingo-pod/claude kingo-pod/kingo, the script behind every ./kingo command. Before Claude Code starts, it checks that n8n and Langflow run, asks for your keys the first time, copies AGENTS.md, CLAUDE.md and .claude/settings.json into kingo-pod/claude/ the first time, and writes the nono profile. Then it starts Claude Code inside nono.
Model and bill Claude models, with an Anthropic account or key GLM 5.3 Flash through OpenRouter, paid with your OpenRouter key kingo-pod/claude/.claude/settings.json names the model, for every role (ANTHROPIC_MODEL and the lines ANTHROPIC_DEFAULT_…_MODEL). The nono profile sends Claude Code's requests to OpenRouter instead of Anthropic, and puts your OpenRouter key into them. Claude Code does not know this model: kingo-pod/kingo tells it the context size to work with (CLAUDE_CODE_MAX_CONTEXT_TOKENS), 200,000 tokens.
Keys kept by Claude Code itself kept in ~/.config/kingo/; Claude Code sees only stand-ins kingo-pod/kingo asks for your OpenRouter and n8n keys, makes the Langflow key itself, and keeps them in ~/.config/kingo/, readable only by you. nono reads them from these files when it starts; they are never in an environment variable. The nono profile says, for OpenRouter, n8n and Langflow, which file holds the key and where nono's proxy puts it into a request.
Files Claude Code reads and writes wherever you may, after asking Claude Code writes only in kingo-pod/claude and ~/.kingo-claude, reads kingo-pod, and nothing else; the operating system enforces it The nono profile ~/.config/nono/profiles/kingo-claude.json lists the folders Claude Code may read and write, and the few environment variables that reach Claude Code: other keys on your laptop do not. kingo writes it anew at every start from kingo-pod/setup/claude/nono-profile.json, so a change to it does not last. On top, kingo-pod/claude/.claude/settings.json forbids Claude Code to read .env files, ~/.ssh and ~/.aws.
Sandbox Claude Code's own sandbox, for commands only, if you turn it on nono, around all of Claude Code: its commands, and its own tools for files too the nono profile. kingo-pod/claude/.claude/settings.json turns Claude Code's own sandbox off (sandbox.enabled): nono covers more.
Settings and history ~/.claude ~/.kingo-claude; your own ~/.claude stays untouched kingo-pod/kingo starts Claude Code with CLAUDE_CONFIG_DIR=~/.kingo-claude: Claude Code keeps its settings, sessions and history there. An Anthropic login stored there, kingo removes at every start: the course does not use it, and Claude Code could read it.
Instructions a CLAUDE.md that you write AGENTS.md: the part about kingo-pod and your team's rules; CLAUDE.md only points to it kingo-pod/claude/AGENTS.md, yours to change, and kingo-pod/claude/CLAUDE.md, which holds only @AGENTS.md. settings.json makes Claude Code skip the CLAUDE.md of kingo-pod itself, which is for kingo-pod's developers (claudeMdExcludes).
Memory hidden in ~/.claude/projects/ in kingo-pod/claude/memory/, where you can read it kingo-pod/claude/.claude/settings.json (autoMemoryDirectory)
What leaves the laptop the model's requests and the web pages Claude Code looks up, plus usage data, error reports and feedback to Anthropic; pages on claude.ai (artifacts) and Remote Control, if you use them the model's requests, to OpenRouter only, and the web pages Claude Code looks up; usage data, error reports, feedback, pages on claude.ai and Remote Control are off kingo-pod/kingo turns off pages on claude.ai, usage data, error reports and all traffic that is not needed, when it starts Claude Code. kingo-pod/claude/.claude/settings.json turns off the same, and also feedback (DISABLE_FEEDBACK_COMMAND), Remote Control (disableRemoteControl), pages on claude.ai (enableArtifact) and the check of each web address at Anthropic before Claude Code reads a page (skipWebFetchPreflight).
A way back none every start saves each n8n workflow and Langflow flow as a JSON file in kingo-pod/backups/flows/, a folder per start; the newest 10 stay. Claude Code can read them but not change them. A file can be imported again in n8n or in Langflow kingo-pod/kingo, before it starts Claude Code. It needs psql.
Requests for permission since version 2.1.283, Claude Code starts in auto mode: a model checks each command, runs what it judges safe and blocks the rest, without asking Claude Code asks before a command (manual mode). Shift+Tab switches the mode, to auto mode too: there, GLM 5.3 Flash is the judge. ./kingo yolo turns the requests off kingo-pod/kingo starts Claude Code with --permission-mode default, and ./kingo yolo starts it with --dangerously-skip-permissions. The sandbox stays the same.
Updates Claude Code updates itself no self-update: run the install line again kingo-pod/claude/.claude/settings.json: CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC also turns off the self-update.

Claude Code's memory. Claude Code writes down for itself what it learns about your project, so that it still knows it in the next session: for example a name your team chose, or a mistake it should not make again. Usually this memory is hidden in Claude Code's own folder. Here it lies in ~/kingo-pod/claude/memory/, so you can read what Claude Code remembers, and correct or delete it. The file MEMORY.md there lists everything it keeps.

Claude Code can explain all of this itself. Ask it:

How are you set up here, and what is different from a standard Claude Code?

Your mail AI assistant drafts answers based on earlier mails. In the preparatory homework, you first sent a mail about kimchi to your test Gmail account, then asked it about Korean food, and saw the power of semantic search. However, when you send another mail that asks about Korean food, you see that the mail AI assistant misses the info about the kimchi in its search. Let's use Claude Code to find out why. Then Claude Code will try to fix the search, and you measure whether the fix does better.

11. See the mistake: ask your mail AI assistant about Korean food

  1. In n8n, check that these four workflows are published:

    • WS2.0 - Embed Mails
    • WS2.3 - Triage New Mail
    • WS2.4 - Reply with Approval
    • WS2.4 - Approvals Page

    Published means: the dot on the button Publish is green.

  2. First the kimchi mail. Did you send Kimchi for Monday in step 12 of the preparatory homework? If yes, go on with 3. If you are not sure, search your test Gmail account for kimchi.

    If you did not send it, send it now: from your SKKU account, send this mail to your test Gmail account. Copy the subject and the text, then sign with your first name:

    Kimchi for Monday
    
    Hi,
    
    This weekend my family makes kimchi for the winter (gimjang).
    I will bring a box of it for everyone at the workshop on Monday.
    

    Wait two minutes: kingo-pod copies the mail into its database, and WS2.0 adds it to the search.

  3. Now the question. From your SKKU account, send a second mail to your test Gmail account. Copy the subject and the text:

    Is there any Korean home made food?
    
    Hi Vince, I'm getting hungry! Please reply.
    
  4. Wait two minutes. Then open the page with the drafts that wait for you: http://localhost:5678/webhook/approvals

  5. Read the draft of the reply to Is there any Korean home made food? (A draft of a reply to the kimchi mail may wait there too: leave it.) Most likely the draft says that nothing is known about Korean food and that someone will follow up. The kimchi mail is in your database, yet the draft does not use it.

Does your draft mention the kimchi? Then the search was lucky this time. Go on anyway: in step 14 you measure it.

Side note: the address in sub-step 4 is a webhook

The address you opened in sub-step 4 (http://localhost:5678/webhook/approvals) is a webhook, that is, an address where someone (here, that is you) can call n8n. In other words, n8n hands out a hook that you can pull. In this case, your browser pulled the hook by calling the address, and the n8n workflow WS2.4 - Approvals Page answered: it read the drafts that wait for you from the database, made a web page of them, and sent this page back to your browser. The page carries a little sticker that you do not see: "pull the hook again in 15 seconds". So your browser does that for you, and the page is never more than 15 seconds old. n8n looks into the database only when someone pulls the hook: close the page, and WS2.4 - Approvals Page rests.

A webhook is how someone else calls n8n. The other way round, n8n calls someone else, often with an HTTP Request node: WS2.4 - Reply with Approval, for example, calls the Langflow flow Draft Reply (Enron) with one.

A webhook: someone else calls n8n
Your browseryou open the page
calls /webhook/approvals← the page
n8nWS2.4 - Approvals Page
An HTTP Request node: n8n calls someone else
n8nWS2.4 - Reply with Approval
calls Langflow's Run API← the draft
LangflowDraft Reply (Enron)
Who calls whom: the left side calls, the right side answers.

Stuck? Help for step 11

12. Let Claude Code find the cause

Start Claude Code (you find cd ~/kingo-pod && ./kingo claude in your terminal's command history with the up arrow) and paste this:

My mail AI assistant drafted a reply to my mail "Is there any Korean home made food?"
without the mail "Kimchi for Monday", which is in the database. Find out why.

Look at:
- the last run of WS2.4 - Reply with Approval in n8n: what it sent to the Langflow flow
  Draft Reply (Enron), and what came back as sources;
- the code of the component Mail Search in that flow.

Do not change anything. Then explain the cause to me in plain words.

Claude Code reads the run, the flow and the code. To this end, it runs several commands to dig deeper and to find the reason. Before running a command, it asks you for permission. Most of these requests are searches: Claude Code looks into your database, or into the runs that n8n keeps. A search changes nothing, so you can approve it.

So many requests in a row are tiring, right? Did you switch to auto mode? Press Shift+Tab until the line under your text says auto mode on. Then a model checks each command and runs what it judges safe, without asking you. More about the modes: step 8: Claude Code always asks for permission: should we tell it to just do its job?

Did you stop Claude Code by accident, or say no to a request? Type continue, and Claude Code goes on.

At the end, Claude Code answers your question: it explains why the search did not find the kimchi. Read this answer twice (the answer at the end, not the reasons Claude Code gives for its requests): this is the most important finding of this part.

Feel free to ask Claude Code to say the answer in simple words if you find it too complicated:

Say this again in simple words.

Quiz. The kimchi mail is in your database. In our test, why did the search miss it?

  • The kimchi mail was too old
  • The search got the whole mail, with the lines From, To and Date
  • The database had lost the mail
Show the answer

The search got the whole mail, with the lines From, To and Date. These lines say nothing about food, and they pull the search away from the question. Did your Claude Code find another cause? Then compare the two.

Stuck? Help for step 12

13. Let Claude Code fix the search, in a copy of the flow

The fix goes into Langflow only, not into n8n: n8n builds the mail text, and the prompt and the check of the draft still need all of it. Only the search should get less.

Make a copy of the Langflow flow Draft Reply (Enron) and name it
"Draft Reply (Enron) - Search Fix". Put the copy into the same Langflow project
(folder) as the original.

In the copy only, change what goes into the search of Mail Search, following the cause
you found. The prompt and Check Draft keep the whole mail.

In the copy, check every component that needs an OpenRouter API key: it must use the
global variable OPEN_ROUTER_API_KEY. If the key is missing, set it.

Do not change the original flow, and do not change n8n.

You should see the new flow Draft Reply (Enron) - Search Fix in your Langflow, next to the original. The original is unchanged, and Claude Code saved its JSON in ~/kingo-pod/claude/backups/.

Quiz. Claude Code made the copy Draft Reply (Enron) - Search Fix. Did your original flow Draft Reply (Enron) change?

  • Yes
  • No
Show the answer

No. The fix is in the copy only. n8n still calls the original, so your mail AI assistant works as before. That is why you can try a fix without fear.

Stuck? Help for step 13

14. Measure: three mails, two flows

One mail proves nothing: a fix for one mail can break another. So you test both flows on three mails. All three are in your database.

Run both flows, Draft Reply (Enron) and Draft Reply (Enron) - Search Fix,
on three mails from the table n8n_workshop_mail.messages.

Give each mail to the flow as WS2.4 does (From, To, Date and Subject lines, then the text),
and as its date one second before the mail was sent, so that the search does not find
the mail itself.

The mails, by subject, and the sources I expect:
1. "Is there any Korean home made food?" (my own mail):
   "Kimchi for Monday"
2. "Re: FW: Wharton Resume Submission - Summer Intern" (from Kristin Gandy, 26 January 2001):
   "FW: Wharton Resume Submission - Summer Intern"
3. "Dr. Michelle Foss- Energy Institute" (from Aisha Jamal, 23 April 2001): one of
   "Re: Tiger Team Event", "Re: Leonard Hilton Reception-DIRECTIONS-PARKING",
   "Wharton Business Plan Competition", "@Jones: News and Information from the Jones School",
   "Invitation-WhartonETEvent-Apr20/PlsRSVP"

Show me a table: for each mail and each flow, was an expected source among the sources?

You should see a table with six answers. When we measured the search alone on 10 November, our table looked like this:

Mail Draft Reply (Enron) Draft Reply (Enron) - Search Fix
Korean home made food not found found
Wharton Resume Submission found found
Energy Institute found not found

In our table, the fix brings in the kimchi, and the Energy Institute drops out: the fix helped one mail and hurt another.

Your table may look different. Your mailbox holds other mails than ours, and Claude Code may have built your fix in another way. Read your own table:

That is the lesson of this part: a change is better only when you measured it on more than one case.

Quiz. With the fix, the search finds the kimchi mail. Is the fix better than the original?

  • Yes: it solved the problem
  • Only if it also does well on other mails
Show the answer

Only if it also does well on other mails. A fix for one mail can break another. A change is better only when you measured it on more than one case.

Stuck? Help for step 14

Optional · Get ready for SMS

An SMS lets your system reach a person who is not at the laptop, for example the person who approves a draft. You need an account with a company that sends SMS, for example Twilio (or SOLAPI). The steps here use Twilio.

Twilio costs money. Its free trial account is enough for the two test SMS here, and it needs no credit card: it has 100 SMS, ends after 30 days, and sends only Twilio's sample texts, not your own.

An SMS is not a safe channel. Never send a name or the text of a mail, even with a paid account. An SMS passes through the SMS company and the phone networks, and it can show up on a locked phone. Send only a short note, such as "A draft waits for you".

15. Make a free Twilio trial account

  1. Open https://www.twilio.com/try-twilio and sign up with your SKKU address.
  2. Confirm your address with the mail Twilio sends you.
  3. Twilio asks for your mobile number and sends it a code. Type the code in.
  4. Send yourself a first SMS on Twilio's website. This also makes your number a verified tester: a trial account sends SMS only to verified numbers.
    • On the first page of your Twilio account, under Try it out, tab Communications, click Send an SMS. The page Try out SMS opens.
    • Under To, open the list. Your number is there, with +82 in front and without the first 0 (010-1234-5678 becomes +821012345678)? Pick it. If not, pick Add a verified tester, type your number like that, and type in the code Twilio sends you.
    • Click Send SMS. Your phone shows it within a minute: Twilio works. Keep the SMS: you need the number it comes from in step 16.

Stuck? Help for step 15

16. Copy three things from Twilio into a note

  1. On the first page of your Twilio account (Home in the menu on the left), find the box with the name of your account, at first My First Twilio Account. Next to Account SID, click the copy icon, and paste it into a note.
  2. Next to Auth Token, click the copy icon too, and paste it into the same note. The token stays hidden as dots; the eye shows it.
  3. Add the number the SMS of step 15 came from, as a + and then only digits: +1 (737) 250-8034 becomes +17372508034. A trial account has no number of its own: it sends from numbers that Twilio shares among many accounts.

17. Give n8n the Twilio login: a credential

  1. In n8n, click the + at the very top left, then New credential.
  2. Type Twilio into the search box, pick Twilio API, and click Continue.
  3. Top left, name it Twilio.
  4. Paste the Account SID and the Auth Token from step 16. Click Save.

Stuck? Help for step 17

18. Send yourself an SMS from n8n

Build a small n8n workflow with two nodes:

  1. Make a new workflow and name it WS2.4 - TEST - SMS: a test, as the rules page names tests.
  2. Add a first node: the trigger Trigger manually. Name it trigger_manual.
  3. Add a Twilio node, the action Send an SMS/MMS/WhatsApp message. Name it send_sms.
    • Credential: Twilio
    • From: the number from step 16, such as +17372508034
    • To: your own mobile number with +82 in front and without the first 0: 010-1234-5678 becomes +821012345678
    • Message: sms_internal_alerts. A trial account sends only Twilio's sample texts; this name picks the alert.
  4. Click Execute workflow, once.

Within a minute your phone shows Twilio's sample alert, in Korea marked [국제발신]: Alert: System downtime detected. … Well done: your n8n can now reach a phone. Your own text needs a paid Twilio account. SOLAPI seems to give you more freedom in its trial: from what it writes, the points you get at sign-up already send your own text, from your own number. For this, you need a Korean phone number in your own name.

Stuck? Help for step 18

If something goes wrong

Find your step. Still stuck? Write to Frank: then we fix it together.

Step 1

What you see What to do
./kingo help shows no kingo claude Run ./kingo update again and look for errors near the end. Send Frank what ./kingo version shows.

Step 2

What you see What to do
brew: command not found (Mac) The line needs Homebrew. It is missing, or your Terminal does not find it. Do Step 1 — Install Homebrew of the kingo-pod Mac guide, with its "Next steps" lines. Open a new Terminal window and run the line again.
Unable to locate package (Windows) Run sudo apt update, then the line again.
A download error Check that you are online, then run the line again.
The line says that a folder is not on your PATH Nothing to do: ./kingo claude finds the programs anyway.

Step 3

What you see What to do
You closed the window before you copied the key Make a new key the same way. In the list on the page n8n API, delete the old one.

Step 4

What you see What to do
nono is not installed or Claude Code is not installed Run the line of step 2 again.
Sandbox initialization failed: WSL2: proxy-only network mode cannot be kernel-enforced (Windows) Your kingo-pod is too old for Windows. Run ./kingo update, then step 4 again. After the update, ./kingo version shows 1.4.6 or newer (on Kingo 1.5: 1.5.5 or newer).
WARNING: WSL2 insecure proxy mode (Windows) Nothing to do: on Windows, this line comes at every start. There, the sandbox cannot lock the network, and in this course Claude Code may use the internet anyway.
n8n and Langflow must be running first Run ./kingo up, then step 4 again.
n8n did not accept the key Make a new key as in step 3. Then run ./kingo claude again: it asks for the key.
openrouter did not accept the key Check the key Yanbo gave you. Then run ./kingo claude again: it asks for the key.
Claude Code asks you to log in to Anthropic Do not log in. Type /exit and write to Frank.
Model "z-ai/glm-5.3-flash" isn't recognized · context assumed to be 200k tokens Nothing to do: Claude Code works. After ./kingo update, the line no longer comes (./kingo version shows 1.4.10 or newer; on Kingo 1.5: 1.5.9 or newer).
removed an Anthropic login You logged in to Anthropic inside ./kingo claude. kingo removed that login again: the course does not use it, and Claude Code could read it there. Your own Claude Code login is not affected.

Step 5

What you see What to do
Claude Code says it cannot reach n8n Check that n8n opens at http://localhost:5678. If not, run ./kingo up in your own terminal, then ask again.
Claude Code does not ask before it runs a command, and the line under your text says auto mode on Your kingo-pod is too old: there, a newer Claude Code starts in auto mode, where a model decides which commands run. It may refuse things that you asked for. Type /exit, run ./kingo update, then ./kingo claude. The line under your text then says manual mode on, and ./kingo version shows 1.4.9 or newer (on Kingo 1.5: 1.5.8 or newer).

Step 6

What you see What to do
No such file or directory ./kingo claude makes these files at its first start. Do step 4 first.

Step 11

What you see What to do
No draft for your mail on the page Check in Gmail that the mail arrived (look in Spam too). Check that WS2.3 and WS2.4 are published. In n8n, open Executions and look for a run of WS2.3 with your mail.
No draft, and the mail has left the inbox of your test Gmail account (you find it under All Mail) Your mail AI assistant filed the mail instead of answering it. Triage decides for every mail, and for a short mail not always the same way. Send the mail of sub-step 3 again, with exactly the text given there, and wait two minutes.
The page does not open Check that WS2.4 - Approvals Page is published.
Claude Code says in step 12 that the kimchi mail is not in the search WS2.0 - Embed Mails was not published when the kimchi mail came. Publish it, wait two minutes, then send the question again (sub-step 3).

Step 12

What you see What to do
Claude Code does not find the cause Ask it: What exactly does Mail Search get as its search query? Show me the text. Then: Which lines of that text help to find the kimchi mail, and which do not?
Claude Code cannot find the run Ask it for the newest run of WS2.4 - Reply with Approval, with its data.

Step 13

What you see What to do
No new flow in Langflow Reload the page of Langflow. Still none? Ask Claude Code: Did you save the copy? Show me its name and id.
In the new flow, Text Input and Text Output show a Legacy mark (Kingo 1.5 only) Nothing to do: they work as before. The newer Langflow of Kingo 1.5 marks these two components as old.
Claude Code changed the original flow Ask Claude Code to put the original back from its backup in ~/kingo-pod/claude/backups/.
The new flow is in another Langflow project, for example Starter Project Ask Claude Code: Move the flow Draft Reply (Enron) - Search Fix into the same Langflow project as Draft Reply (Enron).
Claude Code says that the permission system refuses to change your Langflow, and the line under your text says auto mode on In auto mode, the AI decides which commands run, and it refused this one. Claude Code asks whether it may try again: say yes, and name what it may do, for example Yes, retry saving the change to the copy. Is it blocked again? Press Shift+Tab until the line under your text says manual mode on, and say it again. Did you not switch to auto mode yourself? Then your kingo-pod is too old: type /exit, run ./kingo update, then ./kingo claude. ./kingo version then shows 1.4.9 or newer (on Kingo 1.5: 1.5.8 or newer).

Step 14

What you see What to do
Claude Code says that it cannot reach your database (Mac) Your kingo-pod may be too old. Type /exit, run ./kingo update, then ./kingo claude, and send the text of step 14 again. After the update, ./kingo version shows 1.4.6 or newer (on Kingo 1.5: 1.5.5 or newer).
Claude Code cannot find one of the mails Ask it to search n8n_workshop_mail.messages by the subject, with ILIKE.
A flow fails because the API key is missing The key field of Draft Reply (Enron) is empty, and the copy took that over. Repair the original as in the preparatory homework (its help row "A component says the API key is missing"). Then ask Claude Code to make the copy again, as in step 13.
Both flows find the same sources for every mail Check with Claude Code that the copy really is a changed copy: Show me what you changed in the copy.

Step 15

What you see What to do
Twilio does not accept your Korean mobile number Write to Frank, with a screenshot.
The SMS from Twilio's website does not come Check the number under To: +82, then your number without the first 0. Then open the tab Logs on the same page and look at the status of your SMS.

Step 17

What you see What to do
The credential test fails Copy the Account SID and the Auth Token again: no space before or after.

Step 18

What you see What to do
The number … is unverified A trial account sends only to verified numbers. Check the number in To: +82, then your number without the first 0. Check that the same number is in the list under To on Twilio's page Try out SMS (step 15).
Another error from Twilio in send_sms Check From: the number from step 16, a + and then only digits. Check Message: exactly sms_internal_alerts, as a trial account sends only Twilio's sample texts.
No SMS after five minutes On Twilio's page Try out SMS (step 15), open the tab Logs and look at the status of your SMS. Send Frank a screenshot.
Agentic AI in Business · Workshop II · Frank Huettner · SKK GSB.