Skip to content

Commit 04f5545

Browse files
feat(ai): add n8n doc (#5382)
* feat(ai): add n8n doc * Update pages/generative-apis/reference-content/integrate-with-n8n.mdx * Apply suggestions from code review * Apply suggestions from code review * feat(n8n): add to other doc * Apply suggestions from code review Co-authored-by: ldecarvalho-doc <[email protected]> * Update pages/generative-apis/reference-content/integrate-with-n8n.mdx Co-authored-by: ldecarvalho-doc <[email protected]> * Apply suggestions from code review Co-authored-by: ldecarvalho-doc <[email protected]> --------- Co-authored-by: ldecarvalho-doc <[email protected]>
1 parent f0514b2 commit 04f5545

File tree

6 files changed

+198
-8
lines changed

6 files changed

+198
-8
lines changed

menu/navigation.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,10 @@
864864
"label": "Adding AI to the Zed IDE",
865865
"slug": "adding-ai-to-zed-ide"
866866
},
867+
{
868+
"label": "Integrating Generative APIs with n8n",
869+
"slug": "integrate-with-n8n"
870+
},
867871
{
868872
"label": "Integrating Generative APIs with popular AI tools",
869873
"slug": "integrating-generative-apis-with-popular-tools"
57.6 KB
Loading
62.2 KB
Loading
28.3 KB
Loading
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
---
2+
title: Integrate Generative APIs into n8n workflows
3+
description: Learn how to integrate Scaleway Generative APIs with open-source workflow automation tool n8n
4+
tags: generative-apis ai machine-learning n8n workflow automation
5+
dates:
6+
validation: 2025-08-06
7+
posted: 2025-08-06
8+
---
9+
import Requirements from '@macros/iam/requirements.mdx'
10+
11+
import scwN8nInterface from './assets/scw-n8n-interface.webp'
12+
import scwN8nChatmodel from './assets/scw-n8n-chatmodel.webp'
13+
import scwN8nEmbeddings from './assets/scw-n8n-embeddings.webp'
14+
15+
n8n is an open-source workflow automation tool that allows users to build automated workflows by connecting various AI agents, apps, and services. It provides a visual interface to facilitate the creation of workflows - this document will show you how to use this interface to integrate Scaleway Generative APIs, by:
16+
- Adding a chat model to a workflow
17+
- Adding an embedding model to a workflow
18+
19+
<Requirements />
20+
21+
- A Scaleway account logged into the [console](https://console.scaleway.com)
22+
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
23+
- A valid [API key](/iam/how-to/create-api-keys/) for API authentication
24+
- [Installed n8n](https://docs.n8n.io/hosting/installation/docker/) on your local machine
25+
26+
## Adding a chat model
27+
28+
You can add a chat model to a workflow by adding an **AI Agent** node, and configuring it to use Scaleway Generative APIs. Follow the steps below.
29+
30+
1. Open the n8n visual interface on your local machine.
31+
32+
<Lightbox image={scwN8nInterface} alt="The visual interface of n8n displayed in a browser" />
33+
34+
2. Click `+` > **Workflow** in the top left corner to create a new workflow.
35+
3. Click **Add first step** to define what will trigger this workflow.
36+
4. Type **AI agent** in the search bar, and select that option from the search results.
37+
A form displays prompting you to define parameters and settings for the AI agent. You can come back to this later, if necessary.
38+
5. Click **Back to canvas** in the top left corner.
39+
A canvas displays, visually showing the trigger **When chat message received**, connected to the node **AI agent**.
40+
6. Click **Chat Model +** underneath the AI agent node to define a chat model for the agent.
41+
A list of language models displays.
42+
7. Select **OpenAI Chat Model**.
43+
A form displays prompting you to define parameters and settings for the model.
44+
8. Under **Credential to connect with**, click **Select Credential** > **Create new credential**.
45+
A form displays prompting you to enter the credentials.
46+
9. Fill in the form, to add where prompted:
47+
- The secret part of your [Scaleway API key](https://console.scaleway.com/iam/api-keys)
48+
- The URL `https://api.scaleway.ai/v1` as your base URL
49+
<Message type="tip">
50+
If you are using a Project other than your [default Project](/organizations-and-projects/concepts/#default-project), modify the base URL accordingly: `https://api.scaleway.ai/{project_id}/v1`
51+
</Message>
52+
10. Click **Save**.
53+
The credentials are saved, and an automatic connection test is carried out, displaying the message **Connected tested successfully**. This confirms that n8n can access the `/v1/models` and `/v1/chat/completions` endpoints.
54+
11. Close the credentials screen to go back to the model parameters.
55+
12. Under **Model**, click your chosen model, e.g. `llama-3.3-70b-instruct`.
56+
13. Click **Back to canvas** in the top left corner.
57+
58+
<Lightbox image={scwN8nChatmodel} alt="The visual interface of n8n shows the chat model workflow" />
59+
60+
61+
Your AI agent node is now configured to use the model you configured via Scaleway Generative APIs.
62+
63+
### Testing the model
64+
65+
You can test the model by opening a chat from the interface, asking it questions and checking the answers.
66+
67+
1. Click the **Open chat** button at the bottom of the screen.
68+
The chat interface displays.
69+
2. Enter your question in the **Chat** box on the left, e.g. `How much is 1 + 1 ?`, and send it.
70+
3. Check the result that displays in the **Output** box on the right, e.g. `I can calculate that for you. The answer is 2.`.
71+
72+
### Adding tools
73+
74+
You can add **tools** to the AI Agent node you created, to define new capabilities and actions for the agent. A "tool" lets the agent, for example, call another n8n workflow, make an HTTP request, or run pre-defined code.
75+
76+
In the example below, we create and add a code tool to provide weather information.
77+
78+
1. Click **Tool +** underneath the AI agent node to define a new tool for the agent.
79+
A list of tools displays.
80+
2. Click **Code Tool**.
81+
A form displays prompting you to define parameters and settings for the tool.
82+
3. In the **Description** box, enter `This tool provides the weather in Paris.`
83+
4. Under **Language**, select **Javascript**.
84+
5. In the **Javascript** code box, edit the return statement in the sample code as follows:
85+
```javascript
86+
return "Paris is sunny with clear skies, and the temperature is 30 degrees"
87+
```
88+
6. Click **Back to canvas** in the top left corner.
89+
90+
Now when you [test the model](#testing-the-model) by asking a question such as `What's the weather in Paris?`, you should see via the workflow that the agent calls the code tool, and ultimately returns the answer `Paris is sunny with clear skies, and the temperature is 30 degrees`.
91+
92+
<Message type="tip">
93+
94+
You can also specify a schema to define the input the tool receives, and modify the code accordingly. For example, edit the tool description with `This tool provides the weather in a city`, and edit the Javascript as follows:
95+
96+
```
97+
let weather = "unknown";
98+
if (query.city === "Paris") {
99+
weather = "sunny";
100+
} else if (query.city === "London") {
101+
weather = "rainy";
102+
}
103+
return weather;
104+
```
105+
106+
Toggle the **Specify Input Schema** setting on, and under **Schema Type** select **Define using JSON Schema**. Add the following input schema:
107+
108+
```json
109+
{
110+
"type": "object",
111+
"properties": {
112+
"city": {
113+
"type": "string",
114+
"description": "City name"
115+
}
116+
}
117+
}
118+
```
119+
120+
Now when you ask `What's the weather in London?` you should get the output `rainy.`, and `What's the weather in Tokyo` should generate the response `unknown`.
121+
</Message>
122+
123+
## Adding an embedding model
124+
125+
You can add an embedding model to a workflow by adding a **Simple Vector Store** node, and configuring it to use Scaleway Generative APIs. Follow the steps below to see how to create a workflow that takes a chat message as an input, and outputs an embedding of the message (list of vectors).
126+
127+
1. Open the n8n visual interface on your local machine.
128+
129+
<Lightbox image={scwN8nInterface} alt="The visual interface of n8n displayed in a browser" />
130+
131+
2. Click `+` > **Workflow** in the top left corner to create a new workflow.
132+
3. Click **Add first step** to define what will trigger this workflow.
133+
3. Select **On chat message** as the trigger, then click **Back to canvas**.
134+
4. Test the chat by sending a message in the bottom left. The output is a JSON object containing session ID, action and chatInput fields.
135+
5. Click `+` to the right of your **When chat message received** node to define what happens next.
136+
6. Type **Simple Vector Store** in the search bar, and select that option from the search results.
137+
7. From the **Actions** sub-menu that displays, click **Add documents to vector store**.
138+
A form displays prompting you to define parameters and settings.
139+
8. Click **+** under **Embeddings** at the bottom of the form to add an embedding.
140+
A list of embeddings nodes displays.
141+
9. Click **Embeddings OpenAPI**.
142+
A form displays prompting you to define parameters and settings.
143+
10. Under **Credential to connect with**, select existing credentials and skip to step 15, or click **Select Credential** > **Create new credential**.
144+
A form displays prompting you to enter the credentials.
145+
11. Fill in the form, to add where prompted:
146+
- The secret part of your [Scaleway API key](https://console.scaleway.com/iam/api-keys)
147+
- The URL `https://api.scaleway.ai/v1` as your base URL
148+
<Message type="tip">
149+
If you are using a Project other than your [default Project](/organizations-and-projects/concepts/#default-project), modify the base URL accordingly: `https://api.scaleway.ai/{project_id}/v1`
150+
</Message>
151+
12. Click **Save**.
152+
The credentials are saved, and an automatic connection test is carried out, displaying the message **Connected tested successfully**. This confirms that n8n can access the `/v1/models` and `/v1/chat/completions` endpoints.
153+
13. Close the credentials screen to go back to the **Parameters** tab.
154+
14. Under **Model**, click your chosen model, e.g. `bge-multilingual-gemma2` (other listed models are not supported by Scaleway Generative APIs at the time of writing).
155+
<Message type="note">
156+
For n8n versions earlier than `1.104.1`, a [known issue](https://github.com/n8n-io/n8n/issues/16716) prevents the model list from displaying. If you cannot upgrade your n8n version, you can still Select **Expression** instead of **Fixed** and type the model name.
157+
</Message>
158+
15. Click **Back to canvas** in the top left corner.
159+
16. Click **Document +** underneath the Simple Vector Store node.
160+
A list of document loaders displays.
161+
17. Click **Default Data Loader**.
162+
A form displays prompting you to define parameters and settings for the data loader.
163+
18. Under **Mode**, select ** Load Specific Data**.
164+
17. Drag and drop the **chatInput** field from the **Input** panel on the left into the **Data** field of the main form. Alternatively type `{{ $('When chat message received').item.json.chatInput }}` into the **Data** field.
165+
18. Click **Back to canvas**
166+
167+
<Lightbox image={scwN8nEmbeddings} alt="The visual interface of n8n shows the embeddings workflow" />
168+
169+
170+
### Testing the workflow
171+
172+
You can test the workflow by opening a chat from the interface, sending it a message, and checking that the output is an embedding (list of vectors).
173+
174+
1. Click the **Open chat** button at the bottom of the screen.
175+
The chat interface displays.
176+
2. Enter your chat input in the **Chat** box on the left, e.g. `This is a message to embed`, and send it.
177+
3. In the middle **Logs** panel, click **Simple Vector Store** > **Embeddings OpenAI**.
178+
5. Check that the input shows your chat message, and the output is an embedding (list of vectors).
179+
180+
### Going further
181+
182+
You now know how to add a simple embedding model to your n8n workflows. To go further, you can:
183+
184+
- Replace the **Simple Vector Store** node with a persistent storage node, such as **Postgres PGVector Store** or **Qdrant Vector Store**.
185+
- Implement a RAG pipeline using Vector retrieval components, such as **AI Agent** and **Query Data Tool** (using for instance [RAG Starter Template](https://n8n.io/workflows/5010-rag-starter-template-using-simple-vector-stores-form-trigger-and-openai/)).

pages/generative-apis/reference-content/integrating-generative-apis-with-popular-tools.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The following table compares AI tools and libraries supported by Scaleway's Gene
2222
| [Zed AI](#zed-ai-coding-assistance) | IDE including AI-powered coding assistance | Code completion, code review | Low |
2323
| [Bolt.diy](#boltdiy-code-generation) | Software to create applications | Code generation, code edition | Low |
2424
| [Chatbox AI](#chatbox-ai) | Desktop client for generative APIs, available on Windows, Mac, Linux | AI copilot for documents, images, or code| Low |
25+
| [n8n](#n8n) | Workflow automation tool | Connecting AI agents, apps, and services. | Low |
2526
| [cURL/Python](#custom-http-integrations) | Direct HTTP API calls for custom integrations | Custom applications, data processing | High |
2627

2728
<Message type="note">
@@ -242,14 +243,6 @@ Zed is an IDE (Integrated Development Environment) including AI coding assistanc
242243
Refer to our dedicated documentation for [connecting Zed to Generative APIs](/generative-apis/reference-content/adding-ai-to-zed-ide/)
243244
</Message>
244245
245-
## Chatbox AI
246-
247-
Chatbox AI is a powerful AI client and smart assistant, compatible with Scaleway's Generative APIs service. It is available across multiple platforms, including Windows, macOS, Android, iOS, Web, and Linux.
248-
249-
<Message type="tip">
250-
Refer to our dedicated documentation for [installing and configuring Chatbox AI with Generative APIs](/tutorials/configure-chatboxai-with-generative-apis/)
251-
</Message>
252-
253246
## Bolt.diy (code generation)
254247
255248
Bolt.diy is a software enabling users to create web applications from the prompt.
@@ -291,6 +284,14 @@ Chatbox AI is a powerful AI client and smart assistant, compatible with Scaleway
291284
Refer to our dedicated documentation for [installing and configuring Chatbox AI with Generative APIs](/tutorials/configure-chatboxai-with-generative-apis/)
292285
</Message>
293286
287+
## n8n
288+
289+
n8n is an open-source workflow automation tool that allows users to build automated workflows by connecting various AI agents, apps, and services. It provides a visual interface to facilitate the creation of workflows.
290+
291+
<Message type="tip">
292+
Refer to our dedicated documentation for [integrating Generative APIs into n8n workflows](/generative-apis/reference-content/integrate-with-n8n/)
293+
</Message>
294+
294295
## Custom HTTP integrations
295296
296297
You can interact with Scaleway's Generative APIs directly using any HTTP client.

0 commit comments

Comments
 (0)