Search all guides

Reference · Tools

Grok Collections Upload

Send binary file data, such as PDFs or text, to a Grok collection to enhance Retrieval-Augmented Generation.

Action (binary) AI v1 Binary data

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.

Works as
Action (binary)
Tool name
grok_collections_upload
Parameters
5
Outputs
Output, Error
Credentials
xAI
Official docs
xAI docs docs.x.ai

What you can build with Grok Collections Upload

  • 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.

Each of these runs as a step in a BusyBot workflow or inside an agent, so the result can be routed, filtered and sent on with the core nodes and any of the communication integrations.

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.

Node Type

Action (Binary) — handles file/binary data operations

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires xAI credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
Collection IDstringYes—The ID of the collection to upload to. Falls back to the input item’s “collectionId” field. Supports expressions.
Binary Property NamestringNodataName 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.
OptionscollectionNo{}Optional output settings — add only the fields you want to override.
— Response Field NamestringNodocumentThe output field name where the upload response will be stored.
Include InputbooleanNofalseWhether to include the original input item fields in the output.
Max ConcurrencynumberNo5Maximum 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 }}.

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

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes 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 BusyBot

Last reviewed . Spotted something wrong? Tell us.