Tutorials
How to Connect Retool to Neo4j AuraDB (Workaround Guide)
If you've been searching for how to connect Retool to Neo4j AuraDB, you've probably already discovered the bad news: Retool doesn't have a native Neo4j Aura resource type. The feature has been requested in the Retool community since at least 2021, and as of now, it's tracked internally but not actively in development. The good news is there's a solid workaround — and one community member documented exactly how to do it using a Google Cloud Function as a REST translation layer.
Why Retool Doesn't Support Neo4j Aura Natively
Neo4j AuraDB uses the Bolt protocol (neo4j+s://) for connections, which isn't compatible with standard SQL or REST resource types in Retool. Retool's official guidance is to use a REST API query as a workaround. That's technically true, but it glosses over the fact that you can't just point a REST query directly at a Bolt-protocol database. You need a translation layer in between — which is exactly what this guide builds.
The Architecture: Cloud Function as a REST Bridge
The approach is straightforward: deploy a small serverless function (Google Cloud Functions, AWS Lambda, or Azure Functions all work) that accepts a plain Cypher query via HTTP POST, runs it against your Neo4j Aura instance using the official Neo4j JavaScript driver, and returns the results as JSON. Retool then talks to that function via a standard REST API resource.
Step 1: Create Your Google Cloud Function
In the Google Cloud Console, navigate to Serverless → Cloud Functions and create a new function with the following settings:
- Runtime:
Node.js 20 - Entry point:
neo4j_aura_query - Region: Match your Aura instance region (e.g.,
us-central1for GCP US Central)
Set the following Runtime Environment Variables in the Cloud Function console to store your credentials securely:
neo4j_uri— your Bolt URI, e.g.neo4j+s://foo.databases.neo4j.io:7687neo4j_user— your Aura usernameneo4j_password— your Aura password
Step 2: Configure package.json
In the Cloud Function's inline editor, update package.json to include the Neo4j driver alongside the required Functions Framework:
{ "name": "neo4j-cloud-function", "version": "1.0.0", "dependencies": { "@google-cloud/functions-framework": "^3.0.0", "neo4j-driver": "^4.3.7" } }
Step 3: Write the Function Code
Paste the following into your index.js file. This reads the Cypher query from the POST body, runs it against Aura, and returns the records as JSON:
var neo4j = require('neo4j-driver');
const URI = process.env.neo4j_uri;
const USER = process.env.neo4j_user;
const PASSWORD = process.env.neo4j_password;
exports.neo4j_aura_query = async (req, res) => {
if (req.method !== 'POST') { res.status(405).send('Method Not Allowed'); return; }
let driver;
try {
driver = neo4j.driver(URI, neo4j.auth.basic(USER, PASSWORD), {"disableLosslessIntegers": true});
const session = driver.session();
const result = await session.run(req.body);
res.status(200).send(result.records);
} catch (err) {
res.status(500).send(`Connection error\n${err}\nCause: ${err.cause}`);
} finally {
await driver.close();
}
};
Note the {"disableLosslessIntegers": true} option passed as the third argument to neo4j.driver(). By default, the Neo4j JavaScript driver returns numbers in a lossless format like {low: 1, high: 0} to handle values outside JavaScript's native range. If your data uses standard numbers (integers, decimals like 0.25, 1.5), enabling disableLosslessIntegers returns plain JavaScript numbers that Retool can consume without any special handling.
Step 4: Increase the Cloud Function Timeout
The default execution timeout for Google Cloud Functions is 60 seconds. If your Cypher queries are complex or your graph is large, you may hit this limit. Go to your function's configuration and increase the timeout to 300 seconds (5 minutes) to be safe. Memory and concurrency defaults are generally fine for most internal tool use cases.
Step 5: Connect Retool via REST API Resource
Once the function is deployed, you'll have an endpoint like https://us-central1-yourproject.cloudfunctions.net/neo4j-aura-query. In Retool:
- Go to Resources and create a new REST API resource
- Set the base URL to your Cloud Function endpoint
- Configure your authorization headers (Cloud Function auth is complex — use an API key or allow unauthenticated for internal tools with network-level security)
- In your Retool query, set the method to
POSTand pass your Cypher query as the raw body
Because the request body is just a plain Cypher string, this single endpoint handles reads, inserts, updates, and deletes — you just change the Cypher query text in each Retool query.
What the Response Looks Like
The Cloud Function returns data in Neo4j's native JSON record format. You'll want to use a Retool transformer on the query to flatten or reshape the records into something your Table or Chart components can consume directly. The structure varies based on what your Cypher query returns, so inspect the raw response first and build your transformer from there.
When Retool Adds Native Neo4j Support
Retool has confirmed this is on their radar as a tracked feature request. Until there's a native Neo4j AuraDB resource type, the Cloud Function bridge is the most production-ready path. It's worth upvoting the request in the Retool community thread to signal demand. In the meantime, this workaround is genuinely solid — it handles all query types, keeps credentials out of Retool, and adds only minimal latency for most internal tool use cases.
Ready to build?
We scope, design, and ship your Retool app — fast.