OpenAI Files & Vector Stores
Manage OpenAI files and vector stores from your workflow — the building blocks for retrieval over user documents.
This Module uploads, lists, fetches, downloads, and deletes files in OpenAI's file store, and manages vector stores: create them, add single files or file batches, remove files, and delete stores. Use it to feed Assistant attachments, file search, batch jobs, and fine-tuning runs.
How it works
A file is any document you push to OpenAI's file store; each upload gets an ID (file_…) and a purpose that controls where it can be used. A vector store (vs_…) is a searchable index of files — attach it to an Assistant or a Responses call as the file search tool and the model can quote your documents. Upload first, then add the file ID to a vector store; ingestion finishes asynchronously on OpenAI's side.
Configuration
Each OpenAI Module is configured separately, per Environment — this Module has its own API key, so you can reuse the key you set on the core OpenAI Module or use a dedicated one (for example to track this capability's spend on its own).
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| OpenAI API Key | string | Yes | sk-... | Your OpenAI API key for this Module. Stored securely. Find it in OpenAI Console → API keys → Create new secret key. |
| OpenAI Organization | string | No | org-abc123 | Your OpenAI organization ID, if your account belongs to one. |
Tasks
All Tasks in this Module are Generic (all Channels) — they run the same regardless of how the Session was started.
Output fields: type a variable name without braces (for example fileId) and pick its type (string, number, true/false, object, date). The Task saves its result there, and any later Task can use it by writing {fileId}.
OpenAIUploadFileTask
Uploads a file (loaded from a URL or base64 data URL) to OpenAI's file store. Used by Assistants attachments and vector stores.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Source | string | Yes | {pdfUrl} | URL, data URL, or {variable} containing one of those. |
| File Name | string | Yes | knowledge.pdf | e.g. knowledge.pdf. |
| Purpose | string | Yes | assistants | assistants, batch, fine-tune, vision, user_data. |
| Output Variable | string | Yes | fileId | Variable name (no braces). Receives the OpenAI file ID (file_…). |
Example: Set Source = {pdfUrl}, File Name = knowledge.pdf, Purpose = assistants, Output Variable = fileId. The Task uploads the PDF and saves its new ID (e.g. file_abc123) to fileId for later Tasks to use as {fileId}.
OpenAIDeleteFileTask
Deletes a file by ID. Best paired at the end of a workflow that uploaded transient artifacts.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| File ID | string | Yes | {fileId} | file_… ID. Supports {variable} placeholders. |
Example: Set File ID = {fileId} as the last step of a Process that uploaded a temporary document — the file is removed from the OpenAI account when the Token reaches the Task.
OpenAIListFilesTask
Lists files stored in OpenAI's file store, optionally filtered by purpose.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Purpose Filter | string | No | assistants | Optional. One of assistants, batch, fine-tune, vision, user_data. Empty = all files. |
| Output Variable | object | Yes | files | Variable name (no braces). Receives a list of file metadata entries. |
Example: Set Purpose Filter = assistants, Output Variable = files. The Task saves a list of metadata entries (ID, name, size, purpose) for every assistants-purpose file to files.
OpenAIGetFileTask
Reads metadata for a single file by ID.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| File ID | string | Yes | {fileId} | file_… ID. Supports {variable} placeholders. |
| Output Variable | object | Yes | fileInfo | Variable name (no braces). Receives the file metadata. |
Example: Set File ID = {fileId}, Output Variable = fileInfo. The Task saves the file's metadata (name, size, purpose, creation time) to fileInfo.
OpenAIDownloadFileTask
Downloads a file from OpenAI's file store and saves the bytes as a base64 data URL. Use this to read batch output files or assistant-generated artifacts.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| File ID | string | Yes | {outputFileId} | file_… ID. Supports {variable} placeholders. |
| MIME Type | string | No | application/json | MIME type for the produced data URL. Default application/octet-stream. |
| Output Variable | string | Yes | fileData | Variable name (no braces). Receives the file content as a base64 data URL. |
Example: Set File ID = {outputFileId}, MIME Type = application/json, Output Variable = fileData. The Task saves the file's content as data:application/json;base64,… to fileData, ready for parsing or storage.
OpenAICreateVectorStoreTask
Creates a new vector store and writes its ID to a context variable.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Name | string | Yes | knowledge-base-{execution.id} | Display name. Supports {variable} placeholders. |
| Expire After Days | string | No | 7 | Optional. Auto-delete the vector store after N days of inactivity. Empty → never expire. |
| Output Variable | string | Yes | vsId | Variable name (no braces). Receives the vector store ID (vs_…). |
Example: Set Name = knowledge-base-{execution.id}, Expire After Days = 7, Output Variable = vsId. The Task saves the new store's ID (e.g. vs_abc123) to vsId; the store self-deletes after a week of inactivity.
OpenAIAddFileToVectorStoreTask
Associates an uploaded file with a vector store. Begins ingestion; ingestion completes asynchronously on OpenAI's side.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Vector Store ID | string | Yes | {vectorStoreId} | Supports {variable} placeholders. |
| File ID | string | Yes | {fileId} | Supports {variable} placeholders. |
Example: Set Vector Store ID = {vsId} and File ID = {fileId} right after an upload — ingestion starts immediately and finishes on OpenAI's side a short while later.
OpenAIAddFileBatchToVectorStoreTask
Adds a batch of files (comma-separated IDs) to a vector store in one call. Returns the batch operation ID so you can check ingestion progress in the OpenAI Console.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Vector Store ID | string | Yes | {vectorStoreId} | Supports {variable} placeholders. |
| File IDs (CSV) | string | Yes | {fileIds} | Comma-separated list of OpenAI file IDs. |
| Output Variable | string | No | ingestionId | Optional. Variable name (no braces). Receives the batch ingestion ID. |
Example: Set Vector Store ID = {vsId}, File IDs (CSV) = file_abc123,file_def456, Output Variable = ingestionId. Both files start ingesting in one call and the batch operation ID is saved to ingestionId.
OpenAIRemoveFileFromVectorStoreTask
Removes a single file from a vector store. Does not delete the file itself — use OpenAIDeleteFileTask for that.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Vector Store ID | string | Yes | {vectorStoreId} | Supports {variable} placeholders. |
| File ID | string | Yes | {fileId} | Supports {variable} placeholders. |
Example: Set Vector Store ID = {vsId} and File ID = {fileId} to take an outdated document out of file search while keeping the file itself on the account.
OpenAIDeleteVectorStoreTask
Deletes a vector store by ID.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Vector Store ID | string | Yes | {vectorStoreId} | Supports {variable} placeholders. |
Example: Set Vector Store ID = {vsId} at the end of a Process that built a temporary store, so the index doesn't linger on the account.
Common recipes
Make an Assistant answer from your documents
Upload a document, index it in a vector store, and attach the store to an Assistant so its file search can quote the document.
- OpenAIUploadFileTask — Source =
{pdfUrl}, File Name =knowledge.pdf, Purpose =assistants, Output Variable =fileId. - OpenAICreateVectorStoreTask — Name =
kb-{execution.id}, Output Variable =vsId. - OpenAIAddFileToVectorStoreTask — Vector Store ID =
{vsId}, File ID ={fileId}. - OpenAICreateAssistantTask (OpenAI Assistants) — Model =
gpt-4o-mini, Instructions =Answer only from the attached documents., Vector Store IDs ={vsId}, Output Variable =assistantId. - OpenAICreateThreadTask — Assistant ID =
{assistantId}, Input ={userMessage}, Output Variable =reply. - OutputTask (Standard Module) — Message =
{reply}.
Best practices
- Clean up transient artifacts — end workflows that upload temporary files with
OpenAIDeleteFileTask(andOpenAIDeleteVectorStoreTaskor Expire After Days) so the account doesn't accumulate orphans. - Ingestion is asynchronous — a file added to a vector store is not instantly searchable; for large documents, allow time (or check in the OpenAI Console) before the first file-search query.
Error codes
| Code | Name | Description |
|---|---|---|
| 3005 | TaskInvalidData | A required property is missing or an output field is not a valid variable name — details |
| 4001 | ModuleException | OpenAI rejected the request or the upload/download failed — details |
| 4008 | ModuleMissingConfiguration | The OpenAI API key is not set in the OpenAI Module's Environment configuration — details |
| 4009 | ModuleInputEmpty | A required input (such as the file source) resolved to an empty value — details |
| 4012 | ModuleInvalidData | The Session data could not be read or OpenAI's response could not be processed — details |
See the Error Code Reference for the full list.
Related pages
- OpenAI Module — the family core; the API key is configured there.
- OpenAI Assistants — point an Assistant's file search at the vector stores you build here.
- OpenAI Batch & Fine-tuning — upload JSONL files here (
purpose=batch/fine-tune) before submitting jobs, and download result files withOpenAIDownloadFileTask.