Neo4j Query

Neo4j Query

Certified

Execute a Neo4j Cypher query

Runs a rendered Cypher statement on a Neo4j database and handles results as fetch, fetch-one, store to internal storage, or no-op (default NONE).

yaml
type: io.kestra.plugin.neo4j.Query
yaml
id: neo4j_query
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.neo4j.Query
    url: "{{ url }}"
    username: "{{ username }}"
    password: "{{ password }}"
    query: |
        MATCH (p:Person)
        RETURN p
    storeType: FETCH

Bind Cypher parameters

yaml
id: neo4j_query_params
namespace: company.team

inputs:
  - id: name
    type: STRING
    defaults: aDeveloper

tasks:
  - id: query
    type: io.kestra.plugin.neo4j.Query
    url: "{{ secret('NEO4J_URL') }}"
    username: "{{ secret('NEO4J_USERNAME') }}"
    password: "{{ secret('NEO4J_PASSWORD') }}"
    query: |
        MATCH (p:Person {name: $name})
        RETURN p
    parameters:
      name: "{{ inputs.name }}"
    storeType: FETCH

Connect with a private CA certificate

yaml
id: neo4j_query_private_ca
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.neo4j.Query
    url: "bolt://localhost:7687"
    username: "{{ secret('NEO4J_USERNAME') }}"
    password: "{{ secret('NEO4J_PASSWORD') }}"
    encryption: true
    trustStrategy: CUSTOM
    trustedCertificate: "{{ secret('NEO4J_CA_PEM') }}"
    query: |
        MATCH (p:Person)
        RETURN p
    storeType: FETCH

Target a specific database

yaml
id: neo4j_query_database
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.neo4j.Query
    url: "{{ secret('NEO4J_URL') }}"
    username: "{{ secret('NEO4J_USERNAME') }}"
    password: "{{ secret('NEO4J_PASSWORD') }}"
    database: neo4j
    query: "MATCH (n) RETURN n"
    storeType: FETCHONE

Route to read servers

yaml
id: neo4j_query_read
namespace: company.team

tasks:
  - id: query
    type: io.kestra.plugin.neo4j.Query
    url: "{{ url }}"
    username: "{{ secret('NEO4J_USERNAME') }}"
    password: "{{ secret('NEO4J_PASSWORD') }}"
    accessMode: READ
    query: |
        MATCH (p:Person)
        RETURN p
    storeType: FETCHONE
Properties
DefaultWRITE
Possible Values
READWRITE

Session access mode

Routes units of work to read or write servers in a cluster. Ignored against a single server (default WRITE).

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Bearer token

Base64-encoded bearer token. Cannot be combined with any other authentication mode.

DefaultPT30S

Connection timeout

Maximum time to establish a socket connection (default 30 seconds).

Custom authentication credentials

Credentials for custom authentication. Must be set together with customAuthScheme and customAuthPrincipal.

Custom authentication principal

Principal for custom authentication. Must be set together with customAuthScheme and customAuthCredentials.

Custom authentication scheme

Scheme name for custom authentication. Must be set together with customAuthPrincipal and customAuthCredentials, and cannot be combined with any other authentication mode.

Neo4j database name

Target database for the session (e.g. neo4j). When empty, the server default database is used.

Enable TLS encryption

When true, encrypted traffic is forced with withEncryption(); when false, unencrypted traffic is forced with withoutEncryption(). When unset, the driver default applies so the connection URI scheme keeps working (bolt+s, bolt+ssc, neo4j+s, neo4j+ssc stay encrypted, plain bolt/neo4j stay unencrypted), except that supplying trustStrategy or trustedCertificate with a plain bolt:// or neo4j:// URL enables encryption automatically since trust settings are meaningless over plaintext.

Kerberos ticket

Base64-encoded Kerberos service ticket. Cannot be combined with any other authentication mode.

Default100

Maximum connection pool size

Maximum number of pooled connections towards a single database, or per cluster member with routing (default 100).

Query parameters

Map of parameter names to values bound as $name in the Cypher query. Nested maps and lists are rendered recursively. Values produced by a Pebble expression are bound as strings; cast in Cypher when another type is required, e.g. toInteger($age).

Password for basic auth

Must be used together with username.

Cypher query to run

Rendered with Flow variables before execution; must be valid for the chosen result mode.

DefaultNONE
Possible Values
STOREFETCHFETCHONENONE

Result handling mode

FETCHONE returns the first row; FETCH returns all rows; STORE writes all rows to internal storage; NONE skips result handling (default).

Possible Values
SYSTEMCUSTOMALL

TLS trust strategy

SYSTEM trusts system CA certificates (default), CUSTOM trusts the CA given in trustedCertificate, ALL trusts every certificate blindly and must only be used for development or tests. When unset and trustedCertificate is supplied, CUSTOM is inferred; otherwise SYSTEM applies.

Trusted CA certificate

PEM-encoded CA certificate used with the CUSTOM trust strategy. Accepts either the PEM content itself (e.g. "{{ secret('NEO4J_CA_PEM') }}") or a Kestra internal storage URI (e.g. kestra://.../ca.crt).

Neo4j endpoint URL

Bolt or HTTP(S) URI used to open the driver connection.

Username for basic auth

Must be used together with password.

First fetched row

Populated when storeType is FETCHONE. A map keyed by the column names of the RETURN clause (e.g. RETURN count(n) AS total gives row.total).

SubTypeobject

Fetched rows

Populated when storeType is FETCH. One map per record, keyed by the column names of the RETURN clause (e.g. RETURN p gives rows[0].p.name); nodes and relationships are exposed as their properties.

Row count

Number of rows fetched or stored.

Formaturi

Stored result URI

Populated when storeType is STORE; points to internal storage.

The number of records fetched in FETCH or FETCHONE mode.

The number of records stored in STORE mode.