Skip to content
Frank Huettner

Agentic AI in Business · Workshop II

Homework, Part B: Test Langflow

Step 8: load the course flows, let Triage sort a mail.

On this page
Gmailyour test Gmail accountPart A · steps 1–7 ✓
Mailkingo-pod's service: copies the mails, masks addressesPart A · steps 1–7 ✓
PostgreSQLevery mail as a rowPart A · steps 1–7 ✓
n8ndoes the workPart C · steps 9–13
Langflowthinks: sorts and draftsPart B · step 8 · you are here
Part A · steps 1–7 ✓
Part C · steps 9–13
Part B · step 8 · you are here

8. Test Langflow: load the course flows and let Triage sort a mail

This part checks that Langflow works with the OpenRouter key Yanbo gave you, and with the flows of the course.

We prepared a Langflow flow for you: Triage (Enron). It reads one mail and decides what to do with it: reply, calendar, forward or archive. On 9 November, your AI assistant will use this flow for every new mail. Now you test it by hand.

Open Langflow: http://localhost:7860.

  1. Check your key. Langflow needs the OpenRouter key Yanbo gave you. Langflow keeps keys as global variables: you enter a key once, and every flow can use it.

    • Click your profile icon (top right) → Settings → Global Variables.
    • Is there a variable called OPEN_ROUTER_API_KEY? Then go on with step 8.2.
    • If not, click Add New. Name: OPEN_ROUTER_API_KEY. Type: Credential (then Langflow hides the key on screen). Value: your key. Save.
    • More help: Langflow: Global variables
  2. Get the course files. Download ws2_hw.zip and unzip it. You get a folder ws2_hw with two folders inside (langflow and n8n) and ws2_hw_homework.html: this homework as one page, to read without the internet. Every name starts with ws2_, for Workshop II. You need them now and in Part C.

  3. Load the Langflow flows. Make a new project called WS2 - Mail Assistant (Enron). Open the folder ws2_hw/langflow (from step 8.2) next to your browser. Select all four files in it and drag them onto the page of your new project, where its flows are listed (not into an open flow). Langflow loads all four at once. Or use the small button with an arrow pointing up, next to Projects in the left column. It says Upload a flow when you point at it.

  4. Give the flow a mail. Open the flow Triage (Enron). Copy this mail into the box Text of the component Text Input:

    From: Thomas Gygax <thomas.gygax@enron.com>
    To: Vince J Kaminski
    Date: Wed, 09 May 2001 03:49:00 GMT
    Subject: Clewlow/Strickland, "Energy Derivatives"
    
    Dear Vince,
    
    I'm working in the Continental Power Structured Products group here in London, and we'd like to use the
    Clewlow/Strickland book "Energy Derivatives. Pricing & Risk Management".
    Is there such a thing as an "Enron discount", and if so, how should we purchase the book (two copies) to get it?
    
    Thanks,
    THOMAS.

    If you see a yellow note “Legacy” on Text Input or Text Output, ignore it. If Langflow says Flow needs review, click Dismiss All.

  5. Run it. On the component Text Output, click ▶ (Run component). Wait a few seconds. Then click the small icon next to Output Text (Inspect output). You see "action": "reply" and a short reason after "why". Thomas asks a question, so the AI assistant would draft an answer. At the end you see "checks_ok": true: the component Check Triage checked the answer before it left Langflow.

  6. Change the mail. Replace the whole text in Text Input with this mail. Run it again:

    From: Thomas Gygax <thomas.gygax@enron.com>
    To: Vince J Kaminski
    Date: Wed, 09 May 2001 03:49:00 GMT
    Subject: Meeting next Tuesday
    
    Dear Vince,
    
    I'm working in the Continental Power Structured Products group here in London. I will be in Houston next week.
    Could we meet on Tuesday at 10 am in your office?
    
    Thanks,
    THOMAS.

    Now the action is calendar. Thomas wants a meeting, so the AI assistant would mark the mail for the calendar.

    Done testing? You can now delete the mail in Text Input. On 9 November, n8n will put in each new mail itself.

Well done: an AI just sorted a real mail for you. This flow is the brain of your AI assistant. On 9 November, n8n will give it hands: n8n will notice new mail, then reach out to this Langflow flow, check the answer, and act in your test Gmail account.

Stuck? Help for step 8

Next: Part C · Set up n8n and test it →

If something goes wrong

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

Step 8

What you seeWhat to do
Triage shows an errorCheck the name OPEN_ROUTER_API_KEY in Langflow. Check that your key still has credit.
A component says the API key is missing, or its API key field is emptyYou loaded the flows before you made OPEN_ROUTER_API_KEY. Langflow then empties the key fields. Delete the four flows and load them again (step 8.3).
OpenRouter and Check Triage are not connectedAt the bottom right of OpenRouter, set the menu to Model Response. Then drag a line from its dot to Answer on Check Triage.