Neo4j
App · 21 actions
Read and change your Neo4j graph: run Cypher queries, create, find, update and delete nodes and relationships, and manage indexes and constraints. Start a workflow when a node or relationship is added or a query's results change.
Actions
| Action | What it does |
|---|---|
| Change node labels | Add labels to, or take labels off, the nodes with a label whose properties have the values given. |
| Count nodes | Count the nodes with a label whose properties have the values given. |
| Create index | Index nodes with a label by one or more properties, so finding them by those values is fast. |
| Create node | Create a node with a label and properties. |
| Create or update node | Find the node with a label and key values, such as an email address, or create it if there is none, then set properties on it. |
| Create relationship | Connect a node to another with a relationship, such as a Person WORKS_AT a Company, finding each node by its property values. |
| Create uniqueness constraint | Require every node with a label to have a different value of a property (or combination of properties). |
| Delete constraint | Delete a constraint. |
| Delete index | Delete an index. |
| Delete nodes | Delete the nodes with a label whose properties have the values given, and by default their relationships. |
| Delete relationships | Delete relationships of a type between the nodes that match, leaving the nodes in place. |
| Find nodes | Find nodes with a label whose properties have the values given, optionally sorted by a property. |
| Find relationships | Find relationships of a type, with the nodes at each end, optionally only between nodes with given labels and values. |
| List constraints | List the database's constraints, such as properties that must be unique. |
| List databases | List the databases on the server with their status. |
| List indexes | List the database's indexes, what each covers and whether it is ready. |
| List labels | List every node label in the database. |
| List property names | List every property name used in the database. |
| List relationship types | List every relationship type in the database. |
| Run a Cypher query | Run any Cypher statement, with values passed as parameters, and get its rows and what it changed. |
| Update nodes | Set or clear properties on the nodes with a label whose properties have the values given. |
Change node labels
Add labels to, or take labels off, the nodes with a label whose properties have the values given.
Inputs
- Label
labeltextRequired - The label the nodes have now.
- Where these match
match_propertiesobjectRequired - The property values the nodes must have, such as email = alice@example.com. Every one must match.
- Add labels
add_labelslist - Labels to add, such as Customer.
- Remove labels
remove_labelslist - Labels to take off.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many nodes matched
labels_addednumber- How many labels were added
labels_removednumber- How many labels were taken off
nodeslist- The nodes, as they are now
Example output
{
"count": 1,
"labels_added": 1,
"labels_removed": 0,
"nodes": [
{
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person",
"Customer"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example"
}
}
]
}Count nodes
Count the nodes with a label whose properties have the values given.
Inputs
- Label
labeltext - Only nodes with this label. Leave blank for every node.
- Where these match
match_propertiesobject - Only nodes with these property values. Leave empty for every node with the label.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many nodes match
Example output
{
"count": 1250
}Create index
Index nodes with a label by one or more properties, so finding them by those values is fast. Nothing changes if the index is already there.
Inputs
- Label
labeltextRequired - The label of the nodes to index.
- Properties
index_propertieslistRequired - The properties to index.
- Index name
index_nametext - A name for the index. Leave blank for one made from the label and properties.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
createdtrue/false- False if an index of that name was already there
index_nametext- The index's name
Example output
{
"created": true,
"index_name": "Person_email_index"
}Create node
Create a node with a label and properties.
Inputs
- Label
labeltextRequired - The node's label, such as Person. Pick one, or type a new one.
- Properties
node_propertiesobject - The node's properties, such as name = Alice. Each value is text, a number, true or false, or a list of these.
- More labels
extra_labelslist - Further labels to give the node, such as Customer.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
nodeobject- The node
Example output
{
"node": {
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example"
}
}
}Create or update node
Find the node with a label and key values, such as an email address, or create it if there is none, then set properties on it.
Inputs
- Label
labeltextRequired - The node's label, such as Person.
- Find it by
key_propertiesobjectRequired - The values that identify the node, such as email = alice@example.com.
- Set when created
on_create_propertiesobject - Properties to set only when the node is new, such as created_at.
- Set when found
on_match_propertiesobject - Properties to set only when the node was already there.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
createdtrue/false- True if the node was created, false if it was found
nodeobject- The node
Example output
{
"created": true,
"node": {
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example"
}
}
}Create relationship
Connect a node to another with a relationship, such as a Person WORKS_AT a Company, finding each node by its property values.
Inputs
- From label
from_labeltextRequired - The label of the node the relationship starts from.
- From node where
from_propertiesobjectRequired - Property values that find the start node, such as email = alice@example.com.
- Relationship type
relationship_typetextRequired - The relationship's type, such as WORKS_AT. Pick one, or type a new one.
- To label
to_labeltextRequired - The label of the node the relationship points to.
- To node where
to_propertiesobjectRequired - Property values that find the end node, such as name = Acme.
- Relationship properties
relationship_propertiesobject - Properties for the relationship itself, such as since = 2021.
- Skip if already connected
skip_existingtrue/false - Don't add a second relationship of this type between the same two nodes. Off by default.Default:
false. - Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many relationships the step returned
creatednumber- How many were new (fewer when existing ones were skipped)
relationshipslist- The relationships, each with the nodes at its ends
Example output
{
"count": 1,
"created": 1,
"relationships": [
{
"from": {
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example"
}
},
"relationship": {
"element_id": "5:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
"end_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
"properties": {
"since": 2021
},
"start_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"type": "WORKS_AT"
},
"to": {
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
"labels": [
"Company"
],
"properties": {
"name": "Acme Corporation"
}
}
}
]
}Create uniqueness constraint
Require every node with a label to have a different value of a property (or combination of properties). Nothing changes if it is already there.
Inputs
- Label
labeltextRequired - The label of the nodes it applies to.
- Properties
constraint_propertieslistRequired - The property, or properties together, that must be unique.
- Constraint name
constraint_nametext - A name for the constraint. Leave blank for one made from the label and properties.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
constraint_nametext- The constraint's name
createdtrue/false- False if a constraint of that name was already there
Example output
{
"constraint_name": "Person_email_unique",
"created": true
}Delete constraint
Delete a constraint. The data stays.
Inputs
- Constraint
constraint_nametextRequired - The constraint to delete. Pick one, or type its name.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
constraint_nametext- The constraint's name
droppedtrue/false- False if there was no constraint of that name
Example output
{
"constraint_name": "Person_email_unique",
"dropped": true
}Delete index
Delete an index. The data it indexed stays.
Inputs
- Index
index_nametextRequired - The index to delete. Pick one, or type its name.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
droppedtrue/false- False if there was no index of that name
index_nametext- The index's name
Example output
{
"dropped": true,
"index_name": "Person_email_index"
}Delete nodes
Delete the nodes with a label whose properties have the values given, and by default their relationships.
Inputs
- Label
labeltextRequired - The label of the nodes to delete.
- Where these match
match_propertiesobjectRequired - The property values the nodes must have, such as email = alice@example.com. Every one must match.
- Delete their relationships too
detachtrue/false - On by default. Off refuses to delete a node that still has relationships.Default:
true. - Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
nodes_deletednumber- How many nodes were deleted
relationships_deletednumber- How many of their relationships went with them
Example output
{
"nodes_deleted": 1,
"relationships_deleted": 2
}Delete relationships
Delete relationships of a type between the nodes that match, leaving the nodes in place.
Inputs
- Relationship type
relationship_typetextRequired - The type of the relationships to delete.
- From label
from_labeltext - The label of the node the relationship starts from. Leave blank for any.
- From node where
from_propertiesobject - Property values that find the start node, such as email = alice@example.com. Leave empty for any.
- To label
to_labeltext - The label of the node the relationship points to. Leave blank for any.
- To node where
to_propertiesobject - Property values that find the end node, such as name = Acme. Leave empty for any.
- Relationship where
match_propertiesobject - Only relationships with these property values.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
relationships_deletednumber- How many relationships were deleted
Example output
{
"relationships_deleted": 1
}Find nodes
Find nodes with a label whose properties have the values given, optionally sorted by a property.
Inputs
- Label
labeltext - Only nodes with this label. Leave blank for any label.
- Where these match
match_propertiesobject - Only nodes with these property values. Leave empty for every node with the label.
- Sort by
order_bytext - The property to sort by. Leave blank for no order.
- Highest first
descendingtrue/false - Sort from the highest value down. Off sorts lowest first.Default:
false. - How many
limitnumber - The most nodes to return, up to 1000. Defaults to 100.From 1 to 1000.
- Skip
skipnumber - How many to skip first, to read the next page. Defaults to 0.At least 0.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many
nodeslist- The nodes
Example output
{
"count": 1,
"nodes": [
{
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example"
}
}
]
}Find relationships
Find relationships of a type, with the nodes at each end, optionally only between nodes with given labels and values.
Inputs
- Relationship type
relationship_typetext - Only relationships of this type. Leave blank for any type.
- From label
from_labeltext - The label of the node the relationship starts from. Leave blank for any.
- From node where
from_propertiesobject - Property values that find the start node, such as email = alice@example.com. Leave empty for any.
- To label
to_labeltext - The label of the node the relationship points to. Leave blank for any.
- To node where
to_propertiesobject - Property values that find the end node, such as name = Acme. Leave empty for any.
- Relationship where
match_propertiesobject - Only relationships with these property values.
- How many
limitnumber - The most to return, up to 1000. Defaults to 100.From 1 to 1000.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many
relationshipslist- The relationships, each with the nodes at its ends
Example output
{
"count": 1,
"relationships": [
{
"from": {
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example"
}
},
"relationship": {
"element_id": "5:ff04df25-ff2b-4b55-98f8-6888297b025e:2",
"end_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
"properties": {
"since": 2021
},
"start_element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"type": "WORKS_AT"
},
"to": {
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:1",
"labels": [
"Company"
],
"properties": {
"name": "Acme Corporation"
}
}
}
]
}List constraints
List the database's constraints, such as properties that must be unique.
Inputs
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
constraintslist- The constraints
countnumber- How many
Example output
{
"constraints": [
{
"entity_type": "NODE",
"labels_or_types": [
"Person"
],
"name": "Person_email_unique",
"owned_index": "Person_email_unique",
"properties": [
"email"
],
"type": "UNIQUENESS"
}
],
"count": 1
}List databases
List the databases on the server with their status.
Inputs
None.
Outputs
countnumber- How many
databaseslist- The databases
Example output
{
"count": 1,
"databases": [
{
"access": "read-write",
"default": true,
"home": true,
"name": "neo4j",
"status": "online",
"type": "standard"
}
]
}List indexes
List the database's indexes, what each covers and whether it is ready.
Inputs
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many
indexeslist- The indexes
Example output
{
"count": 1,
"indexes": [
{
"entity_type": "NODE",
"labels_or_types": [
"Person"
],
"name": "Person_email_index",
"owning_constraint": "",
"properties": [
"email"
],
"state": "ONLINE",
"type": "RANGE"
}
]
}List labels
List every node label in the database.
Inputs
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many
labelslist- The labels
Example output
{
"count": 2,
"labels": [
"Company",
"Person"
]
}List property names
List every property name used in the database.
Inputs
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many
property_keyslist- The property names
Example output
{
"count": 3,
"property_keys": [
"email",
"name",
"since"
]
}List relationship types
List every relationship type in the database.
Inputs
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many
relationship_typeslist- The relationship types
Example output
{
"count": 2,
"relationship_types": [
"KNOWS",
"WORKS_AT"
]
}Run a Cypher query
Run any Cypher statement, with values passed as parameters, and get its rows and what it changed.
Inputs
- Cypher query
querytextRequired - The Cypher statement. Refer to a value given in Parameters as $name rather than typing it in.
- Parameters
parametersobject - Values the query uses as $name, such as age = 30.
- Read only
read_onlytrue/false - Refuse to change anything, so a query meant only to read can never write. Off by default.Default:
false. - Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many rows
countersobject- What changed, such as nodesCreated, relationshipsDeleted and propertiesSet
fieldslist- The names of the columns
notificationslist- Warnings and hints Neo4j gave about the query
query_typetext- r (read), w (write), rw (read and write) or s (schema)
rowslist- One record per row, keyed by the names the query returns
truncatedtrue/false- True when more than 10000 rows came back and the rest were left out
Example output
{
"count": 1,
"counters": {
"containsUpdates": false,
"nodesCreated": 0
},
"fields": [
"p.name",
"p.email"
],
"notifications": [],
"query_type": "r",
"rows": [
{
"p.email": "alice@example.com",
"p.name": "Alice Example"
}
],
"truncated": false
}Update nodes
Set or clear properties on the nodes with a label whose properties have the values given. Other properties stay as they are.
Inputs
- Label
labeltextRequired - The label of the nodes to change.
- Where these match
match_propertiesobjectRequired - The property values the nodes must have, such as email = alice@example.com. Every one must match.
- Set
set_propertiesobject - The properties to set, such as status = active. An empty value clears that property.
- Clear
remove_propertieslist - Properties to take off the nodes altogether.
- Database
databasetext - The database to use. Leave blank for the connection's database.
Outputs
countnumber- How many nodes matched
nodeslist- The nodes, as they are now
properties_setnumber- How many property values were set or cleared
Example output
{
"count": 1,
"nodes": [
{
"element_id": "4:ff04df25-ff2b-4b55-98f8-6888297b025e:0",
"labels": [
"Person"
],
"properties": {
"age": 42,
"email": "alice@example.com",
"name": "Alice Example",
"status": "active"
}
}
],
"properties_set": 1
}