Integrate Generative APIs into n8n workflows
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:
- Adding a chat model to a workflow
- Adding an embedding model to a workflow
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A valid API key for API authentication
- Installed n8n on your local machine
Adding a chat model
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.
-
Open the n8n visual interface on your local machine.
-
Click
+
> Workflow in the top left corner to create a new workflow. -
Click Add first step to define what will trigger this workflow.
-
Type AI agent in the search bar, and select that option from the search results. A form displays prompting you to define parameters and settings for the AI agent. You can come back to this later, if necessary.
-
Click Back to canvas in the top left corner. A canvas displays, visually showing the trigger When chat message received, connected to the node AI agent.
-
Click Chat Model + underneath the AI agent node to define a chat model for the agent. A list of language models displays.
-
Select OpenAI Chat Model. A form displays prompting you to define parameters and settings for the model.
-
Under Credential to connect with, click Select Credential > Create new credential. A form displays prompting you to enter the credentials.
-
Fill in the form, to add where prompted:
- The secret part of your Scaleway API key
- The URL
https://api.scaleway.ai/v1
as your base URL
-
Click Save. 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. -
Close the credentials screen to go back to the model parameters.
-
Under Model, click your chosen model, e.g.
llama-3.3-70b-instruct
. -
Click Back to canvas in the top left corner.

Your AI agent node is now configured to use the model you configured via Scaleway Generative APIs.
Testing the model
You can test the model by opening a chat from the interface, asking it questions and checking the answers.
- Click the Open chat button at the bottom of the screen. The chat interface displays.
- Enter your question in the Chat box on the left, e.g.
How much is 1 + 1 ?
, and send it. - Check the result that displays in the Output box on the right, e.g.
I can calculate that for you. The answer is 2.
.
Adding tools
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.
In the example below, we create and add a code tool to provide weather information.
- Click Tool + underneath the AI agent node to define a new tool for the agent. A list of tools displays.
- Click Code Tool. A form displays prompting you to define parameters and settings for the tool.
- In the Description box, enter
This tool provides the weather in Paris.
- Under Language, select Javascript.
- In the Javascript code box, edit the return statement in the sample code as follows:
return "Paris is sunny with clear skies, and the temperature is 30 degrees"
- Click Back to canvas in the top left corner.
Now when you test 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
.
Adding an embedding model
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).
-
Open the n8n visual interface on your local machine.
-
Click
+
> Workflow in the top left corner to create a new workflow. -
Click Add first step to define what will trigger this workflow.
-
Select On chat message as the trigger, then click Back to canvas.
-
Test the chat by sending a message in the bottom left. The output is a JSON object containing session ID, action and chatInput fields.
-
Click
+
to the right of your When chat message received node to define what happens next. -
Type Simple Vector Store in the search bar, and select that option from the search results.
-
From the Actions sub-menu that displays, click Add documents to vector store. A form displays prompting you to define parameters and settings.
-
Click + under Embeddings at the bottom of the form to add an embedding. A list of embeddings nodes displays.
-
Click Embeddings OpenAPI. A form displays prompting you to define parameters and settings.
-
Under Credential to connect with, select existing credentials and skip to step 15, or click Select Credential > Create new credential. A form displays prompting you to enter the credentials.
-
Fill in the form, to add where prompted:
- The secret part of your Scaleway API key
- The URL
https://api.scaleway.ai/v1
as your base URL
-
Click Save. 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. -
Close the credentials screen to go back to the Parameters tab.
-
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). -
Click Back to canvas in the top left corner.
-
Click Document + underneath the Simple Vector Store node. A list of document loaders displays.
-
Click Default Data Loader. A form displays prompting you to define parameters and settings for the data loader.
-
Under Mode, select ** Load Specific Data**.
-
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. -
Click Back to canvas

Testing the workflow
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).
- Click the Open chat button at the bottom of the screen. The chat interface displays.
- Enter your chat input in the Chat box on the left, e.g.
This is a message to embed
, and send it. - In the middle Logs panel, click Simple Vector Store > Embeddings OpenAI.
- Check that the input shows your chat message, and the output is an embedding (list of vectors).
Going further
You now know how to add a simple embedding model to your n8n workflows. To go further, you can:
- Replace the Simple Vector Store node with a persistent storage node, such as Postgres PGVector Store or Qdrant Vector Store.
- Implement a RAG pipeline using Vector retrieval components, such as AI Agent and Query Data Tool (using for instance RAG Starter Template).