tigergraph__add_nodes
Add multiple vertices of the same type to a TigerGraph graph in a single batch, specifying vertex type and a list of vertex objects with primary keys and attributes.
Instructions
Add multiple nodes (vertices) to a TigerGraph graph in a single batch operation. This is significantly more efficient than calling 'add_node' multiple times.
Use When: • Loading multiple vertices of the same type • Importing data from CSV, JSON, or database • Initial data population • Bulk updates to existing vertices
Quick Start:
{
"vertex_type": "Person",
"vertices": [
{"id": "user1", "name": "Alice", "age": 30},
{"id": "user2", "name": "Bob", "age": 25}
]
}Common Workflow:
Call 'show_graph_details' to understand the schema
Prepare your data with primary keys and attributes
Use 'add_nodes' to load vertices in batches
Call 'get_vertex_count' to verify loading
Use 'add_edges' to create relationships
Tips: • Set 'vertex_id' to match your schema's primary key name (default: 'id') • For SARGraph: vertex_id='ACCOUNT_ID' for Account vertices • All vertices must be the same type • For very large datasets (>10K vertices), consider using loading jobs • Batch size: 1000-5000 vertices per call is optimal
Warning: Common Mistakes: • Missing primary key in one or more vertices • Using wrong vertex_id name (check schema with show_graph_details) • Mixing different vertex types in one call • Attribute name typos (must match schema exactly) • Wrong data types (e.g., string instead of int)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Connection profile name. Omit to use the active default profile. Use 'list_connections' to see available profiles. | |
| vertices | Yes | List of vertices to add. Each vertex must contain the primary key field (specified by 'vertex_id' parameter) and other attributes matching the schema. Example with default vertex_id='id': ```json [ {"id": "user1", "name": "Alice", "age": 30}, {"id": "user2", "name": "Bob", "age": 25} ] ``` Example with vertex_id='ACCOUNT_ID': ```json [ {"ACCOUNT_ID": 1001, "COUNTRY": "US", "ACCOUNT_TYPE": "savings"}, {"ACCOUNT_ID": 1002, "COUNTRY": "UK", "ACCOUNT_TYPE": "checking"} ] ``` Note: All vertices will be processed in a single batch operation for efficiency. | |
| vertex_id | No | Name of the primary key field in the vertex dictionaries. This tells the tool which field contains the vertex ID. Default: 'id'. Set to match your schema's primary key name. Examples: 'id', 'ACCOUNT_ID', 'TX_ID' | id |
| graph_name | No | Name of the graph. If not provided, uses default connection. | |
| vertex_type | Yes | Type of the vertices (all vertices must be the same type). Example: 'Person', 'Product' Tip: Use 'show_graph_details' to see available types. |