Reference · Tools
Grok Collections
Manage Grok document collections — create, list, get, delete.
Grok Collections manages the document collections that back retrieval-augmented workflows on xAI: create a collection, list what exists, fetch one by ID, or delete it. It is the housekeeping half of RAG on Grok — pair it with Grok Collections Upload to populate a collection, then query it from a Grok model.
- Node type
- Action
- Parameters
- 7
- Outputs
- Output, Error
- Credentials
- xAI
Grok Collections
Manage Grok document collections — create, list, get, delete.
Overview
Grok Collections manages document collections on the xAI platform for retrieval-augmented generation. Supports four operations: create a new collection, list all collections, get a specific collection by ID, and delete a collection.
Category: AI
Tool Name: grok_collections
Version: 1
Appearance: Icon: brain | Color: #000000
Node Type
Action — processes input items and produces output
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires xAI credentials. See the Credentials Guide for setup instructions.
Operations
| Operation | Value | Description |
|---|---|---|
| Create | create | Create a new document collection. |
| List | list | List all document collections. |
| Get | get | Get a specific collection by ID. |
| Delete | delete | Delete a collection by ID. |
Parameters
List takes no parameters of its own — see All Operations.
Create (create)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Collection Name | string | No | — | Name for the new collection. Falls back to the input item’s “collectionName” field. Supports expressions. If neither is set, the collection is created as “New Collection”. |
| Field Definitions | json | No | [] | Optional metadata schema for documents in this collection — a JSON array of field definitions (e.g. [{“name”:“author”,“type”:“string”,“required”:false,“unique”:false}]). Leave as [] for no custom fields. xAI requires this array on create. |
Get (get)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Collection ID | string | No | — | The ID of the collection. Falls back to the input item’s “collectionId” field. Supports expressions. |
Delete (delete)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Collection ID | string | No | — | The ID of the collection. Falls back to the input item’s “collectionId” field. Supports expressions. |
All Operations
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Options | collection | No | {} | Optional output settings — add only the fields you want to override. |
| — Response Field Name | string | No | collection | The output field name where the API response will be stored. |
| Include Input | boolean | No | false | Whether to include the original input item fields in the output. |
| Max Concurrency | number | No | 10 | Maximum number of items to process concurrently. |
Output Data
One output item per input item. The xAI response is written unchanged to the field named by Response Field Name (collection by default). The rest of the input JSON is carried over only when Include Input is on; binary data from the input item is forwarded.
| Operation | What lands in the response field |
|---|---|
create | The newly created collection object, including its generated collection ID |
list | The listing xAI returns for the account’s collections |
get | The requested collection object |
delete | The deletion result xAI returns |
Reference the result downstream by expression, e.g. {{ $json.collection }}. Because list returns everything on a single item, follow it with a Split Out node to fan the collections out one per item.
Usage Examples
- Create a new Grok document collection for RAG
- List all existing collections in your xAI account
- Get details of a specific collection by ID
- Delete a collection that is no longer needed
- Manage collections as part of a RAG pipeline
Example Configuration
List every collection on the account:
{
"type": "grok_collections",
"parameters": {
"operation": "list"
}
}
Create a collection with no custom metadata fields:
{
"type": "grok_collections",
"parameters": {
"operation": "create",
"collectionName": "Product Documentation {{ $json.quarter }}",
"fieldDefinitions": []
}
}
Create a collection that records an author on every document:
{
"type": "grok_collections",
"parameters": {
"operation": "create",
"collectionName": "Support Articles",
"fieldDefinitions": [
{ "name": "author", "type": "string", "required": false, "unique": false }
],
"options": {
"responseFieldName": "createdCollection"
}
}
}
Delete collections named by upstream items, a few at a time:
{
"type": "grok_collections",
"parameters": {
"operation": "delete",
"collectionId": "{{ $json.collectionId }}",
"includeInput": true,
"maxConcurrency": 3
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Grok Collections manages document collections on the xAI platform, supporting create, list, get, and delete operations via the xAI Collections API. Use it when you need to organize or retrieve document sets for Retrieval-Augmented Generation workflows before querying Grok models with contextual knowledge. It outputs a collection object or list of collection objects with IDs and metadata on the main channel, or routes failures to the error output.
Frequently asked questions
How does this relate to Grok Collections Upload?
This node manages collections themselves — creating, listing, fetching and deleting them. Uploading documents into a collection is the separate Grok Collections Upload node, which needs a collection to exist first.
What does the output look like?
A collection object, or an array of them for a list operation, each carrying its ID and metadata. Capture the ID when creating a collection — the upload node needs it.
Is deleting a collection reversible?
No. Deletion removes the collection on the xAI side, so anything relying on it for retrieval stops finding results. Treat it as permanent.
Which credential does it need?
An xAI credential — the same one used by the other Grok nodes, so collections, uploads and queries all share one credential.
Build with the Grok Collections node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need xAI credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.