n8n Workflow to AuraDB via HTTP Request - Handling Dynamic Relationship Types without APOC
closed
Scott Schaefer
Hello Neo4j Community,
I'm working on a project where I'm using n8n (hosted on AWS EC2) to populate a Neo4j Aura database. I'm encountering a timeout issue when trying to connect to my Aura instance from an n8n workflow using the "HTTP Request" node.
Problem:
My n8n workflow is unable to send Cypher queries to my Aura instance via the HTTP API. The "HTTP Request" node consistently times out.
Setup:
Neo4j Aura: Professional Tier, using a new instance for testing.
n8n: Hosted on AWS EC2 (details below).
Workflow: The n8n workflow fetches data from Airtable, transforms it using a "Code" node, and then attempts to create nodes and relationships in Neo4j using an "HTTP Request" node.
Authentication: I'm using Basic Auth with the correct username (
neo4j
) and the password generated in the Aura console.APOC: It doesn't seem that APOC is enabled on the Aura instance because it's not an available feature.
HTTP Request Node Configuration:
URL:
https://<instance-id>.databases.neo4j.io:7473/db/data/transaction/commit
(placeholder <instance-id>
used for privacy)Method:
POST
Authentication:
Basic Auth
(with correct neo4j
username and password)Body Content Type:
JSON
Body Parameters:
```json
{
"statements": [
{
"statement": "UNWIND $concepts AS concept MERGE (c:Concept {conceptId: concept.conceptId}) ON CREATE SET c.name = concept.name, c.type = concept.type, c.definition = concept.definition, c.key_elements = concept.key_elements, c.source = concept.source, c.usage_frequency = concept.usage_frequency, c.created_at = datetime(concept.created_at), c.last_updated = datetime(concept.last_updated) ON MATCH SET c.name = concept.name, c.type = concept.type, c.definition = concept.definition, c.key_elements = concept.key_elements, c.source = concept.source, c.usage_frequency = concept.usage_frequency, c.last_updated = datetime(concept.last_updated) WITH c, concept UNWIND concept.domain AS domainName MATCH (d:Domain {name: domainName}) MERGE (c)-[:BELONGS_TO]->(d)",
"parameters": {
"concepts": "={{ $json.concepts }}"
}
}
]
}
```
Troubleshooting Steps Taken:
- Verified the URL, port, and endpoint in the "HTTP Request" node.
- Confirmed that the username and password are correct.
- Tested with a simple Cypher query (RETURN 1) to rule out issues with the main query.
- Checked the n8n logs for more detailed error messages.
Likely Cause:
I suspect the issue is related to network connectivity between my n8n instance (on AWS) and the Aura instance. It's likely that outbound traffic on port 7473 is being blocked by a firewall or security group setting on the AWS side.
Request:
- Could you please confirm if there are any specific network configuration requirements or recommendations for connecting to Aura instances from applications hosted on AWS EC2 (specifically regarding outbound traffic on port 7473)?
- Are there any known issues or limitations with using the HTTP API to connect to Aura from n8n?
- Are there any Aura-specific settings I should check or adjust to ensure connectivity?
I appreciate any insights or assistance you can provide in resolving this connection issue. Thank you for your time and support!
jon.giffard@neo4j.com
closed
jon.giffard@neo4j.com
Hi there,
This looks like you are trying to use the legacy HTTP connection that is not available for Aura. There is a new version, known as the Query API, that allows for connections using HTTP.
The documentation for that is here:- https://neo4j.com/docs/query-api/current/
Note that port 7474 is only used by self-managed Neo4j installations. Please use standard HTTPS for Query API with Aura.
I would also recommend you look at the community forum, https://community.neo4j.com/, as it is a great place for asking questions and getting answers.
Regards
Jonathan