Linking Neo4j as a source

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Learn more
PostHog Wizard hedgehog

Alpha release

This source is currently in alpha. The interface and available tables may change.

The Neo4j connector syncs nodes and relationships from your Neo4j graph database into PostHog, so you can query graph data alongside your product data using SQL.

PostHog discovers every node label and relationship type in your database and creates a table for each one. Node tables are prefixed node_ and relationship tables are prefixed rel_.

Prerequisites

  • A Neo4j Aura instance, or a self-managed Neo4j 5.19+ deployment with a public HTTPS endpoint. Self-managed versions before 5.25 require the Query API to be enabled explicitly.

  • A database user with read access. PostHog only reads data.

  • The database credentials (username and password) you received when you created the Aura instance, or equivalent credentials from your database administrator.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. Select the tables you want to sync, choose a sync method and frequency, then click Import.

Once the syncs are complete, you can start querying this data in PostHog.

When linking Neo4j, you need:

  • HTTPS host – the public URL of your Neo4j instance, for example https://your-instance.databases.neo4j.io. Must be HTTPS with no path, query string, or embedded credentials.

  • Database – the name of the database to connect to, for example neo4j.

  • Username – your Neo4j username, typically neo4j on Aura instances.

  • Password – the password for the database user.

PostHog validates the host, authenticates with Basic auth, and discovers available tables automatically.

Configuration

OptionTypeRequired
HTTPS hosttextYes
DatabasetextYes
UsernametextYes
PasswordpasswordYes

Supported tables

The tables available from this source are discovered from your account when you connect it, so the exact list depends on your data. Once connected, you can pick which tables to sync from the sources tab.

How tables are discovered

PostHog calls db.labels() and db.relationshipTypes() to discover every node label and relationship type in the connected database. Each label becomes a node_<label> table and each relationship type becomes a rel_<type> table.

Node tables (node_<label>)

ColumnDescription
element_idThe node identifier assigned by Neo4j.
labelsThe labels attached to the node.
property columnsOne column for each property found on the nodes.

Relationship tables (rel_<type>)

ColumnDescription
element_idThe relationship identifier assigned by Neo4j.
start_element_idThe identifier of the start node.
end_element_idThe identifier of the end node.
property columnsOne column for each property found on the relationships.

Sync behavior

  • Full refresh only – every sync re-downloads all rows. Incremental and append syncs aren't supported.

  • Row limit – each table is limited to 1,000,000 rows. If a table exceeds this limit, the import fails rather than silently truncating data.

  • Unlabeled nodes are excluded. Nodes with multiple labels appear in each corresponding node_ table.

  • Reserved column names – if a node or relationship has a property named element_id, labels, start_element_id, or end_element_id, the import for that table fails. Rename the conflicting property in Neo4j before syncing.

  • No durable resume – if a sync is interrupted, it restarts from the beginning. Neo4j doesn't guarantee elementId identity across transactions, so there's no reliable checkpoint.

  • Concurrent changes – because paging uses SKIP/LIMIT ordering, concurrent writes to the graph can shift rows between pages during a sync.

Troubleshooting

Authentication failed

Check your database username and password. On Aura, use the credentials from when you created the instance. If the password has expired, reset it in the Neo4j console before reconnecting.

Query API not found

Verify that:

  1. The HTTPS host is correct and publicly reachable.
  2. The database name matches an existing database.
  3. The Query API is enabled. Aura enables it by default. Self-managed deployments on versions before 5.25 may need to enable it manually.

Row limit exceeded

The table contains more than 1,000,000 rows. Filter your graph data by using a more specific label or relationship type, or reduce the dataset before syncing.

Property conflicts with a reserved column name

A property on your nodes or relationships uses one of the reserved column names (element_id, labels, start_element_id, or end_element_id). Rename the conflicting property in Neo4j and re-sync.

If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.

Still have questions?

Was this page useful?