I need some help to fix this problem:
I like to add the Apache Cassandra Database to n8n but there is no possibility. so, I need help here to fix this problem how do I add Cassandra in n8n ?.
I need some help to fix this problem:
I like to add the Apache Cassandra Database to n8n but there is no possibility. so, I need help here to fix this problem how do I add Cassandra in n8n ?.
hello @Ashiqur_rahman
Can you share a bit more detail here, what are you trying to accomplish exactly? If you have a workflow, can you please share it?
Thanks!
If you wanna talk to Apache Cassandra from n8n, unlike PostgreSQL or MySQL, there’s no built-in database adapter for Cassandra in n8n. But don’t worry—Stargate acts as a bridge, allowing you to interact with Cassandra using HTTP requests!
First, you need to install Cassandra and Stargate and make sure they’re running on the same Docker network as your n8n instance. If you’re using the self-hosted-ai-starter-kit from GitHub, check that your network is properly set up:
docker network inspect self-hosted-ai-starter-kit_demo
Now, launch Cassandra first, then Stargate (order matters!):
docker run --name cass1 \
--network self-hosted-ai-starter-kit_demo \
-e CASSANDRA_CLUSTER_NAME=stargate-cluster \
-d cassandra:4.0
docker run --name stargate \
--network self-hosted-ai-starter-kit_demo \
-p 8080:8080 -p 8081:8081 -p 8082:8082 -p 9049:9042 \
-e CLUSTER_NAME=stargate-cluster \
-e CLUSTER_VERSION=4.0 \
-e SEED=cass1 \
-e SIMPLE_SNITCH=true \
-e ENABLE_AUTH=true \
-d stargateio/stargate-4_0:v1.0.57
Once the containers are up and running, it’s a good idea to run a sanity check using the Cassandra Query Shell (CQLSH
).
Or, an even easier way—test Stargate’s API using Postman! The Stargate Postman Collection lets you fire requests and confirm everything is working. If you get a 201 OK
response, you’re golden!
Before making database queries, you need an Auth Token. This token is used in all future requests under the X-Cassandra-Token
header.
Run this cURL
command to authenticate with Stargate:
curl -L -X POST 'http://localhost:8081/v1/auth' \
-H 'Content-Type: application/json' \
--data-raw '{"username": "cassandra","password": "cassandra"}'
If successful, you’ll get a response like this:
{"authToken": "0e073bf6-ada6-4fdd-ab5b-98f9bad04ca7"}
Now that you have your Auth Token, let’s hook it up to n8n:
In n8n, add an HTTP Request node.
Set the Method to POST
.
Use this URL:
http://stargate:8081/v1/auth
Under Body, choose JSON
format and add:
{
"username": "{{auth_username}}",
"password": "{{auth_password}}"
}
Store the Auth Token from the response and use it in future requests by adding a header:
X-Cassandra-Token: {{AUTH_TOKEN}}
Boom! You’re connected to Cassandra via Stargate in n8n! Now you can start making queries, inserting data, and pulling insights like a database wizard.
Need more details? Check out:
Stargate Docs
Stargate Postman Collection
The initial HTTP request node will get the AUTH_TOKEN to be used in subsequent HTTP calls using the header: X-Cassandra-Token
This is how to setup db connector stargate.
Stargate is a very helpful db connector/adapter if you are not using postgres or mysql databases for example eg. Cassadra DB is not directly supported by n8n .
Please don’t delete this info - its a post I made myself as a reply that got blocked