<!-- BusyBot node reference — https://busybot.net/tools/grok-collections-upload/ -->

> Node: Grok Collections Upload (`grok_collections_upload`) · Action (binary) · v1
> Category: AI · Credentials: xAI (`xai`)
> Updated: 2026-08-16

# 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](https://busybot.net/credentials/xai/) 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:

```json
{
  "type": "grok_collections_upload",
  "parameters": {
    "collectionId": "{{ $json.collectionId }}",
    "binaryPropertyName": "data"
  }
}
```

Upload from a named binary property and keep the source metadata:

```json
{
  "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.