Skip to main content

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

FieldTypeRequiredExampleDescription
OpenAI API KeystringYessk-...Your OpenAI API key for this Module. Stored securely. Find it in OpenAI Console → API keys → Create new secret key.
OpenAI OrganizationstringNoorg-abc123Your 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.

PropertyTypeRequiredExampleDescription
SourcestringYes{pdfUrl}URL, data URL, or {variable} containing one of those.
File NamestringYesknowledge.pdfe.g. knowledge.pdf.
PurposestringYesassistantsassistants, batch, fine-tune, vision, user_data.
Output VariablestringYesfileIdVariable 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.

PropertyTypeRequiredExampleDescription
File IDstringYes{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.

PropertyTypeRequiredExampleDescription
Purpose FilterstringNoassistantsOptional. One of assistants, batch, fine-tune, vision, user_data. Empty = all files.
Output VariableobjectYesfilesVariable 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.

PropertyTypeRequiredExampleDescription
File IDstringYes{fileId}file_… ID. Supports {variable} placeholders.
Output VariableobjectYesfileInfoVariable 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.

PropertyTypeRequiredExampleDescription
File IDstringYes{outputFileId}file_… ID. Supports {variable} placeholders.
MIME TypestringNoapplication/jsonMIME type for the produced data URL. Default application/octet-stream.
Output VariablestringYesfileDataVariable 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.

PropertyTypeRequiredExampleDescription
NamestringYesknowledge-base-{execution.id}Display name. Supports {variable} placeholders.
Expire After DaysstringNo7Optional. Auto-delete the vector store after N days of inactivity. Empty → never expire.
Output VariablestringYesvsIdVariable 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.

PropertyTypeRequiredExampleDescription
Vector Store IDstringYes{vectorStoreId}Supports {variable} placeholders.
File IDstringYes{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.

PropertyTypeRequiredExampleDescription
Vector Store IDstringYes{vectorStoreId}Supports {variable} placeholders.
File IDs (CSV)stringYes{fileIds}Comma-separated list of OpenAI file IDs.
Output VariablestringNoingestionIdOptional. 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.

PropertyTypeRequiredExampleDescription
Vector Store IDstringYes{vectorStoreId}Supports {variable} placeholders.
File IDstringYes{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.

PropertyTypeRequiredExampleDescription
Vector Store IDstringYes{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.

  1. OpenAIUploadFileTask — Source = {pdfUrl}, File Name = knowledge.pdf, Purpose = assistants, Output Variable = fileId.
  2. OpenAICreateVectorStoreTask — Name = kb-{execution.id}, Output Variable = vsId.
  3. OpenAIAddFileToVectorStoreTask — Vector Store ID = {vsId}, File ID = {fileId}.
  4. OpenAICreateAssistantTask (OpenAI Assistants) — Model = gpt-4o-mini, Instructions = Answer only from the attached documents., Vector Store IDs = {vsId}, Output Variable = assistantId.
  5. OpenAICreateThreadTask — Assistant ID = {assistantId}, Input = {userMessage}, Output Variable = reply.
  6. OutputTask (Standard Module) — Message = {reply}.

Best practices

  1. Clean up transient artifacts — end workflows that upload temporary files with OpenAIDeleteFileTask (and OpenAIDeleteVectorStoreTask or Expire After Days) so the account doesn't accumulate orphans.
  2. 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

CodeNameDescription
3005TaskInvalidDataA required property is missing or an output field is not a valid variable name — details
4001ModuleExceptionOpenAI rejected the request or the upload/download failed — details
4008ModuleMissingConfigurationThe OpenAI API key is not set in the OpenAI Module's Environment configuration — details
4009ModuleInputEmptyA required input (such as the file source) resolved to an empty value — details
4012ModuleInvalidDataThe Session data could not be read or OpenAI's response could not be processed — details

See the Error Code Reference for the full list.

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