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.
-
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
-
Get the course files. Download
ws2_hw.zipand unzip it. You get a folderws2_hwwith two folders inside (langflowandn8n) andws2_hw_homework.html: this homework as one page, to read without the internet. Every name starts withws2_, for Workshop II. You need them now and in Part C. -
Load the Langflow flows. Make a new project called
WS2 - Mail Assistant (Enron). Open the folderws2_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. -
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.
-
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. -
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.
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 see | What to do |
|---|---|
| Triage shows an error | Check 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 empty | You 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 connected | At the bottom right of OpenRouter, set the menu to Model Response. Then drag a line from its dot to Answer on Check Triage. |