© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Apache TinkerPopAT
Apache TinkerPop•9mo ago•
7 replies
PhunkyPhil

Gremlin traversal exceeded maximum compilation depth. Max: 400

Hi all, I'm using gremlin through cosmos and the python library and I'm getting this error when I try to add a lot of vertices to my graph at the same time. (A lot as in only 583 vertices). I'm guessing this refers to the actual traversal part, but considering my query is structurally just chained addV's:

g.addV("..").property(...).addV("..")....

I can't imagine it's that complex. I tried chunking them into smaller batches and submitting them individually but I still get the same error after the last batch.

The exception type is "GraphCompileException" and it's a 597 from cosmos. The graph interopstatuscode is QuerySyntaxError which seems strange.

I'm very new to gremlin, but I haven't found a better way to batch upload a lot of vertices at once. I see in cosmos the graph is represented as JSON, could I construct a graph in JSON then upload that to my DB?
Solution
Hey, i've run into that one before - there's a maximum length of query Cosmos DB can handle and it looks like you're exceeding it. When writing a big big gremlin query that creates a bunch of vertices and their properties it can quickly exceed that limit.
I believe if I remember right from the CosmosDB docs that the solution here is to batch these smaller and run them in parallel (e.g. threading) to get the best performance
Jump to solution
Apache TinkerPop banner
Apache TinkerPopJoin
Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1,376Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Can't do explain() traversal step using Gremlin-Python ..
Apache TinkerPopATApache TinkerPop / questions
3y ago
Application of traversal strategies taking >6x longer than traversal execution
Apache TinkerPopATApache TinkerPop / questions
3y ago
op_traversal P98 Spikes
Apache TinkerPopATApache TinkerPop / questions
2y ago
Modify traversal from outside the function that builds the traversal (Java)
Apache TinkerPopATApache TinkerPop / questions
3y ago