ExecuteGremlinQuery - Neptune Data API


This commands executes a Gremlin query. Amazon Neptune is compatible with Apache TinkerPop3 and Gremlin, so you can use the Gremlin traversal language to query the graph, as described under The Graph in the Apache TinkerPop3 documentation. More details can also be found in Accessing a Neptune graph with Gremlin.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that enables one of the following IAM actions in that cluster, depending on the query:

Note that the neptune-db:QueryLanguage:Gremlin IAM condition key can be used in the policy document to restrict the use of Gremlin queries (see Condition keys available in Neptune IAM data-access policy statements).

Request Syntax

POST /gremlin HTTP/1.1 accept: serializer Content-type: application/json { "gremlin": "string" }

URI Request Parameters

The request uses the following URI parameters.


If non-null, the query results are returned in a serialized response message in the format specified by this parameter. See the GraphSON section in the TinkerPop documentation for a list of the formats that are currently supported.

Request Body

The request accepts the following data in JSON format.


Using this API, you can run Gremlin queries in string format much as you can using the HTTP endpoint. The interface is compatible with whatever Gremlin version your DB cluster is using (see the Tinkerpop client section to determine which Gremlin releases your engine version supports).

Type: String

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "meta": JSON value, "requestId": "string", "result": JSON value, "status": { "attributes": JSON value, "code": number, "message": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


Metadata about the Gremlin query.

Type: JSON value


The unique identifier of the Gremlin query.

Type: String


The Gremlin query output from the server.

Type: JSON value


The status of the Gremlin query.

Type: GremlinQueryStatusAttributes object


For information about the errors that are common to all actions, see Common Errors.


Raised when a request is submitted that cannot be processed.

HTTP Status Code: 400


Raised when a user cancelled a request.

HTTP Status Code: 500


Raised when a request timed out in the client.

HTTP Status Code: 408


Raised when a request attempts to modify data that is concurrently being modified by another process.

HTTP Status Code: 500


Raised when a value in a request field did not satisfy required constraints.

HTTP Status Code: 400


Raised when a request fails.

HTTP Status Code: 500


Raised when an argument in a request is not supported.

HTTP Status Code: 400


Raised when an argument in a request has an invalid value.

HTTP Status Code: 400


Raised when a parameter value is not valid.

HTTP Status Code: 400


Raised when a query is submitted that is syntactically incorrect or does not pass additional validation.

HTTP Status Code: 400


Raised when a request fails because of insufficient memory resources. The request can be retried.

HTTP Status Code: 500


Raised when a required parameter is missing.

HTTP Status Code: 400


Raised when a parsing issue is encountered.

HTTP Status Code: 400


Raised when a precondition for processing a request is not satisfied.

HTTP Status Code: 400


Raised when the number of active queries exceeds what the server can process. The query in question can be retried when the system is less busy.

HTTP Status Code: 500


Raised when the size of a query exceeds the system limit.

HTTP Status Code: 400


Raised when the body of a query is too large.

HTTP Status Code: 400


Raised when the an operation exceeds the time limit allowed for it.

HTTP Status Code: 500


Raised when the number of requests being processed exceeds the limit.

HTTP Status Code: 429


Raised when a request attempts to initiate an operation that is not supported.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: