This afternoon · Team C · K-Motor: the buyer decides on every bid

On this page

Today, you play the buyer. Your system does the routine work. You decide on every bid.

your page shows · n8n runs the steps · Langflow thinks · you decide

What happens to a bid

  1. A supplier sends a bid, by mail to your test Gmail account.
  2. n8n picks up the mail and passes it to Langflow.
  3. Langflow sorts and reads it. The flow Triage with Projects (Enron) gives the mail the action bid. The flow Read Bid (K-Motor) finds the supplier (its vendor ID, for example V-0015), the part, the unit price, the minimum order and the lead time.
  4. n8n checks the bid against fixed rules. Is the supplier on the approved-vendor list for this part (the roster), active, and with a contract that has not ended? Is the price at most 20 % above the median of past bids for this part? n8n does not guess.
  5. n8n saves the bid as a new row in the Data table WS2.12 - K-Motor - Bids. The bid waits for you.
  6. Your page shows the bid, with every rule it breaks. It gets the waiting bids from n8n.
  7. You decide: Approve or Reject, with a short note. Your page sends your click to n8n.
  8. The result: n8n writes your decision into the row: approved or rejected, by whom, when, and why. The templates stop here: no mail goes to the supplier, and nothing is ordered. What could come next? See Ideas in section 3.

New to n8n? Four words

You built most of your work in Langflow. These n8n words you need today:

1 · Set up the templates

The templates are a ready-made version of this system: two Langflow flows, three n8n workflows, three Data tables and your page.

Before you start, check that you have this from the homework:

All files you need are in your folder ws2_s2 from this morning (ws2_s2.zip).

  1. Langflow: open your project WS2 - Mail Assistant (Enron). Drag these two files from the folder ws2_s2/langflow onto its list of flows, as in the homework:

    • ws2_triage_with_projects_enron.json. In Langflow, it is called Triage with Projects (Enron): a copy of your flow Triage (Enron) that also knows the action bid. Your own Triage (Enron) does not change.
    • ws2_read_bid_k_motor.json. In Langflow, it is called Read Bid (K-Motor).
  2. n8n, Data tables: make three tables, as in Session 1. For each of them:

    1. In n8n, click Overview at the top left, then the tab Data tables. Click Create data table.
    2. Data table name: paste its name from below. Use it exactly: the workflows look for their tables by name.
    3. Pick Import CSV. Drop its file from the folder ws2_s2/data into the box.
    4. Turn on My CSV file contains a header row. Click Create.

    The first table, with the file ws2_12_k_motor_bids.csv:

    WS2.12 - K-Motor - Bids
    

    The second, with the file ws2_12_k_motor_roster.csv:

    WS2.12 - K-Motor - Roster
    

    The third, with the file ws2_12_k_motor_prices.csv:

    WS2.12 - K-Motor - Prices
    

    Roster and Prices come from your project data: the list of approved suppliers, and the median price of each part in the 2,500 past bids. Most contracts in the roster have already ended: most bids break that rule.

  3. n8n, workflows: import these three from the folder ws2_s2/n8n:

    • ws2_12_k_motor_bid_intake.json
    • ws2_12_k_motor_bid_queue.json
    • ws2_12_triage_new_mail_with_projects.json

    Does a node with a credential show a warning sign? Double-click it and pick its credential: one of the three from Before you start. The three submit_to_… nodes show a warning too: you fix them next.

    Then open WS2.12 - Triage New Mail with Projects. It hands each mail to the right workflow. After the import, it does not know your workflows yet. Change three of its nodes:

    • Double-click submit_to_bid_workflow. In the field Workflow, pick WS2.12 - K-Motor - Bid Intake.
    • Double-click submit_to_reply_with_approval. In the field Workflow, pick WS2.4 - Reply with Approval.
    • submit_to_quote_request_workflow is for team A. Right-click it and click Deactivate.
  4. n8n, switch on:

    • Switch off the triage workflow of Session 1: open WS2.3 - Triage New Mail, or WS2.3 - Triage New Mail - SOLUTION if you published that one. Click the small arrow next to Publish at the top, then Unpublish. Why: only one triage workflow takes each new mail. The old one does not know bids, so a bid would never reach your page.
    • Switch on your three new workflows: in each, click Publish at the top. In the window that opens, click Publish again.
  5. Your page: copy the file kmotor_bids.html into the folder claude/site of kingo-pod.

    1. Open a new terminal window: on Windows, the app Ubuntu from the Start menu; on a Mac, Cmd+N in the Terminal. In it, run this line. It opens the folder claude/site in a window. On Windows:

      cd ~/kingo-pod && mkdir -p claude/site && cd claude/site && explorer.exe .
      

      On a Mac:

      cd ~/kingo-pod && mkdir -p claude/site && open claude/site
      
    2. Drag the file kmotor_bids.html from your folder ws2_s2/pages into that window.

  6. Open your page: http://localhost:8080/kmotor_bids.html. Does the browser say that it cannot connect? Then the web server from this morning has stopped. Start it again in your second terminal window (on Windows: the app Ubuntu from the Start menu, not PowerShell), then reload the page:

    cd ~/kingo-pod && python3 -m http.server 8080 --bind 127.0.0.1 --directory claude/site
    
  7. At the top of your page, type your name into the box Your name. The page saves it with every decision.

Your system is set up: your page says "No bid waits", and shows no red error message. Your page already talks to n8n. The test in section 2 checks the rest: your mail, Langflow and the workflows.

2 · Understand the templates

  1. Start Claude Code in the terminal. Is it still running from this morning? Then skip this line.

    cd ~/kingo-pod && ./kingo claude
    
  2. Send this to Claude Code:

    Look at our n8n workflows "WS2.12 - K-Motor - Bid Intake" and "WS2.12 - K-Motor - Bid Queue".
    In five short lines: what happens to a bid that arrives by mail, and where does a person decide?
    Change nothing.
    
  3. Try it with a mail. From your SKKU account, send a mail to your test Gmail account. Copy the subject and the text:

    Offer P-0001
    
    Vendor V-0015 offers P-0001 at 7,900 USD per unit, minimum order 100, lead time 30 days.
    

    Wait two minutes, then click Reload on your page. The bid waits there. It lists the rules it breaks: the supplier is not approved for P-0001, and the price is far above the median.

  4. Decide, as the buyer. Type a short note (why), then click Approve or Reject. The bid moves to the tab Decided, with your name and your note.

You decided on your first bid, with all the facts on one page. Your system did the routine work: it read the mail and checked the roster and the price. The buyer did one thing: decide.

Who does what? For each step: Langflow, n8n, or a person on your page?

Step Who
Picks up each new mail n8n
Decides that the mail is a bid Langflow
Finds the supplier, the part and the price in the mail Langflow
Checks the bid against the roster and the median price n8n
Approves or rejects the bid A person, on your page
Why

n8n picks up each mail and follows fixed rules: it checks the roster and the price the same way every time. Langflow reads the text: it sorts the mail and finds the values. The buyer decides on every bid.

3 · Change the templates for your team

Why these tools?

You can split the work differently. Some rules need judgement, for example "Are the supplier's payment or warranty terms unusual?" A fixed rule cannot check that well. For such a rule, let Langflow judge and write a note on your page. The buyer still decides.

Now make the templates fit your team's process. Claude Code changes copies of your workflows and flows, and the originals keep running. You test a copy. Then you switch to it, as in block 3 this morning: Claude Code tells you how.

Copy this request into Claude Code, but do not press Enter yet. Claude Code shows a long paste as one short line: that is fine. Type after it what is different in your team: a rule, a field, a step, or who decides. For example: A bid above 100,000 USD also needs the head of procurement. Then press Enter.

Our project is K-Motor Procurement. Change copies of our workflows and flows, one step at a time.
Before each change, show me what you will change. Then tell me how to test a copy, and how to
switch from the original to the copy. We publish ourselves.
Our process differs from the templates like this:

Ideas, if you need one. The first two go on where the templates stop:

Agentic AI in Business · Workshop II · Frank Huettner · SKK GSB.