Skip to content

Commit 0ad81f0

Browse files
Merge pull request #45 from amd/n8n-playbook
n8n playbook
2 parents fcc11ee + 63e32ac commit 0ad81f0

9 files changed

Lines changed: 589 additions & 7 deletions

File tree

Lines changed: 145 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,146 @@
1-
# Automating Workflows with n8n and gpt-oss-120b
1+
## Overview
22

3-
<!-- Playbook content goes here -->
3+
n8n is a workflow automation platform that lets you connect apps and services using a visual node-based editor. Instead of writing code, you build workflows by dragging, connecting, and configuring nodes.
4+
5+
This playbook teaches you how to set up an AI-powered financial news summarizer that scrapes the Financial Times website, extracts key headlines, and uses a local LLM running on your Ryzen™ AI Halo to generate an investor-focused summary.
6+
7+
## What You'll Learn
8+
9+
- How to install and launch n8n
10+
- Importing and configuring a pre-built workflow
11+
- Connecting to Lemonade using the native n8n integration
12+
- Understanding workflow nodes and data flow
13+
14+
## Why Lemonade?
15+
16+
[Lemonade](https://lemonade-server.ai) is a local LLM serving platform built for AMD hardware. It provides an OpenAI-compatible API that runs entirely on your machine—your data never leaves your device.
17+
18+
In this playbook, we use Lemonade to serve a local LLM that n8n connects to for AI-powered tasks. Unlike cloud-based LLM providers, Lemonade runs on your Ryzen™ AI Halo GPU, giving you full control over your models with zero API costs.
19+
20+
n8n includes a **native Lemonade node** (`Lemonade Chat Model`) that provides a first-class integration—no need to configure OpenAI-compatible endpoints manually. This makes connecting your local LLM to automation workflows straightforward.
21+
22+
## Prerequisites
23+
24+
<!-- @require:lemonade,nodejs -->
25+
26+
## Installing n8n
27+
28+
Your STX Halo has Node.js pre-installed. Install n8n globally using npm:
29+
30+
```bash
31+
npm install -g n8n
32+
```
33+
34+
## Launching n8n
35+
36+
Start n8n from the terminal:
37+
38+
```bash
39+
n8n start
40+
```
41+
42+
n8n starts a local web server. Open your browser to `http://localhost:5678` to access the editor.
43+
44+
> **Tip**: Keep the terminal window open while using n8n. Closing it will stop the server.
45+
46+
## Setting Up the Workflow
47+
48+
### Step 1: Sign Up or Log In to n8n
49+
50+
When you first open n8n, you'll be prompted to create an account or log in:
51+
52+
1. Open `http://localhost:5678` in your browser
53+
2. Create a new account with your email, or log in if you already have one
54+
3. Once logged in, you'll see the n8n dashboard
55+
56+
### Step 2: Import the Workflow
57+
58+
We've provided a pre-built workflow that you can import directly:
59+
60+
1. Download the workflow file: [financial-news-workflow.json](assets/financial-news-workflow.json)
61+
2. If this is your first workflow, click **Start from Scratch** to open the workflow editor. Otherwise, click **Add workflow** in the top right.
62+
3. Click the **...** menu (three dots) in the top bar and select **Import from file**
63+
4. Select the downloaded `financial-news-workflow.json` file
64+
5. The workflow will appear on the canvas
65+
66+
### Step 3: Understanding the Workflow
67+
68+
The imported workflow contains 7 connected nodes:
69+
70+
<p align="center">
71+
<img src="assets/workflow-overview.png" alt="n8n Financial News Workflow" width="800"/>
72+
</p>
73+
74+
| Node | Purpose |
75+
|------|---------|
76+
| **When clicking 'Execute workflow'** | Manual trigger to start the workflow |
77+
| **Fetch Financial News Webpage** | HTTP GET request to `https://www.ft.com/` |
78+
| **Delay to Ensure Page Load** | Wait node to ensure page content is fully loaded |
79+
| **Extract News Headlines & Text** | HTML node that extracts headlines, editor's picks, top stories, and regional news using CSS selectors |
80+
| **Clean Extracted News Data** | Set node that combines all extracted data into a single text field |
81+
| **AI Financial News Summarizer** | AI Agent that processes the news with a financial analyst system prompt |
82+
| **Lemonade Chat Model** | Connects to your local Lemonade server running the LLM |
83+
| **Structured Output Parser** | Formats the AI output as structured JSON |
84+
| **Convert to File** | Converts the summary to a downloadable file |
85+
86+
### Step 4: Configure Lemonade Credentials
87+
88+
Before running the workflow, you need to connect it to your local Lemonade server:
89+
90+
1. Double click the **Lemonade Chat Model** node
91+
2. In the dropdown menu **Credential to connect with** select **Create New Credential**
92+
3. Enter the following settings:
93+
94+
| Field | Value |
95+
|-------|-------|
96+
| **Base URL** | `http://localhost:8000/api/v1` |
97+
| **API Key** | `lemonade` |
98+
99+
4. Click **Save**
100+
101+
> **Note**: Ensure Lemonade is running before testing. The workflow uses `gpt-oss-120b-mxfp4-GGUF` by default—you can change this in the Lemonade Chat Model node settings.
102+
103+
### Step 5: Test the Workflow
104+
105+
1. Ensure Lemonade is running with a model loaded
106+
2. Click **Execute workflow** at the bottom center of the canvas
107+
3. Watch each node execute from left to right—they turn green when complete
108+
4. Click the **AI Financial News Summarizer** node to see the generated summary
109+
110+
## Understanding the AI Agent
111+
112+
The AI Financial News Summarizer uses a system prompt designed for financial analysis:
113+
114+
```
115+
You are an AI financial analyst. Your role is to read, understand, and
116+
summarize key financial news from today. The goal is to provide investors
117+
with a clear and concise market overview to support better investment decisions.
118+
119+
Investor Outlook
120+
Today's news points to [bullish/bearish/neutral] sentiment. Watch for
121+
[economic event/earnings report] tomorrow, which could influence market direction.
122+
```
123+
124+
The agent receives the cleaned news data and outputs a structured summary with market sentiment.
125+
126+
## Saving Your Workflow
127+
128+
Click the workflow name at the top and rename it if desired. Workflows auto-save as you work.
129+
130+
## Next Steps
131+
132+
- **Schedule automation**: Replace Manual Trigger with a **Schedule Trigger** to run daily
133+
- **Send notifications**: Add a **Discord**, **Slack**, or **Email** node to receive summaries
134+
- **Try different models**: Change the model in the Lemonade Chat Model node to experiment with different LLMs
135+
- **Customize extraction**: Modify the HTML Extract node's CSS selectors to target different news sections
136+
- **Try different backends**: n8n also supports [Ollama](https://n8n.io/workflows/?integrations=Ollama+Chat+Model), LM Studio, and other local LLM backends
137+
138+
### Explore n8n Templates
139+
140+
n8n has hundreds of pre-built workflow templates. Browse the official template library at:
141+
142+
**[https://n8n.io/workflows/](https://n8n.io/workflows/)**
143+
144+
Search for "AI", "LLM", or "automation" to find workflows you can import and customize.
145+
146+
For more information, check out the [n8n Documentation](https://docs.n8n.io/).

0 commit comments

Comments
 (0)