Reference · Tools
Grok Collections Upload
Upload documents to Grok collections for RAG.
Grok Collections Upload puts documents into an xAI collection so Grok can retrieve from them later, sending binary file data such as PDFs or text files as a multipart upload and returning the document metadata including its assigned ID. A typical build is watching a folder or inbox and uploading each new document straight into the collection that powers an internal assistant.
- Node type
- Action (binary)
- Parameters
- 5
- Outputs
- Output, Error
- Credentials
- xAI
Grok Collections Upload
Upload documents to Grok collections for RAG.
Overview
Grok Collections Upload sends binary file data to an xAI Grok collection for retrieval-augmented generation. Takes binary input (PDF, text, and so on) from an upstream node and uploads it as a document to the specified collection. Returns the document metadata including the document ID.
Category: AI
Tool Name: grok_collections_upload
Version: 1
Appearance: Icon: brain | Color: #000000
Node Type
Action (Binary) — handles file/binary data operations
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires xAI credentials. See the Credentials Guide for setup instructions.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Collection ID | string | Yes | — | The ID of the collection to upload to. Falls back to the input item’s “collectionId” field. Supports expressions. |
| Binary Property Name | string | No | data | Name of the binary property containing the file to upload. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. |
| Options | collection | No | {} | Optional output settings — add only the fields you want to override. |
| — Response Field Name | string | No | document | The output field name where the upload response will be stored. |
| Include Input | boolean | No | false | Whether to include the original input item fields in the output. |
| Max Concurrency | number | No | 5 | Maximum number of items to process concurrently. Lower default to avoid overwhelming the upload endpoint. |
Output Data
One output item per input item. The xAI response is written unchanged to the field named by Response Field Name (document by default), with two convenience fields alongside it. The rest of the input JSON is carried over only when Include Input is on; the input item’s binary data is forwarded untouched.
document— the upload response from xAI, under whatever name Response Field Name is set to.collectionId— the collection the file was uploaded to, as resolved for this item.documentId— the ID xAI assigned to the uploaded document.
The file itself is read from the named binary property. If that property is missing on an item, the item fails.
Reference the result downstream by expression, e.g. {{ $json.documentId }}.
Usage Examples
- Upload a PDF to a Grok collection for RAG
- Add text files to a knowledge base collection
- Upload documents from upstream binary data
- Batch upload multiple files to a collection
- Import documents for Grok retrieval-augmented generation
Example Configuration
Upload a downloaded file to a fixed collection:
{
"type": "grok_collections_upload",
"parameters": {
"collectionId": "{{ $json.collectionId }}",
"binaryPropertyName": "data"
}
}
Upload from a named binary property and keep the source metadata:
{
"type": "grok_collections_upload",
"parameters": {
"collectionId": "{{ $json.collectionId }}",
"binaryPropertyName": "pdfFile",
"includeInput": true,
"maxConcurrency": 3,
"options": {
"responseFieldName": "uploadResult"
}
}
}
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 Upload sends binary file data such as PDFs or text files to an xAI Grok collection via a multipart POST request for Retrieval-Augmented Generation. Use this tool when you need to populate a Grok RAG knowledge base with documents so that future queries can retrieve and reference their content. It returns document metadata on the main output including the assigned document ID, or routes failures to the error output.
Frequently asked questions
Does the collection need to exist first?
Yes. Create it with the Grok Collections node and pass its ID here. Uploading to a collection that does not exist fails rather than creating one implicitly.
Where does the file come from?
From binary data on the incoming item, so any upstream node that produces a file — a download, a read-file step, an email attachment — can feed it directly without writing to disk yourself.
What comes back after an upload?
Document metadata including the assigned document ID. Keep that ID if you later need to reference or remove the specific document.
What file types can I upload?
Document formats such as PDF and plain text. The node performs a multipart POST of whatever binary you supply, so the limits are xAI's rather than the node's.
Build with the Grok Collections Upload 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.