Document → Replace Upload
AI-generatedSummary
Replace an existing document in a Gemini File Search store with a new file, optionally deleting prior matching documents and preserving metadata.
Inputs
- storeName (required) — File Search store identifier (list or by name). Required.
- binaryPropertyName (required) — Name of the binary property that holds the file to upload. Required.
- displayName (required) — Display name for the new document; also used to locate an existing document when Delete Old Document By is set to Display Name.
- matchBy — Strategy to locate old documents for deletion (None, Display Name, Custom Filename, Metadata).
- oldDocumentFilename (required) — Filename of the existing document to delete (case‑insensitive). Required when matchBy is Custom Filename.
- matchMetadataKey (required) — Metadata key to match when Delete Old Document By is set to Metadata.
- matchMetadataValue (required) — Metadata value to match (exact, case‑sensitive).
- deleteAllMatches — If true, delete all documents matching the metadata criteria; otherwise only the first match.
- preserveMetadata — If true, copy metadata from the deleted document to the new document.
- metadataMergeStrategy — Strategy for merging metadata when preserveMetadata is enabled (preferNew, preferOld, mergeAll, replaceEntirely).
- customMetadata — Custom metadata key‑value pairs (up to 20) to attach to the new document.
- chunkingOptions — Chunking settings for large files (maxTokensPerChunk, maxOverlapTokens).
- waitForCompletion — If true, the workflow waits for the upload to finish before proceeding.
- forceDelete — If true, forcibly delete the old document even if it contains chunks.
Output shape
a single document record (the uploaded file)
Returns the updated document details; may include error information if the operation fails; pagination not applicable.
Examples
Example 1: Replace a PDF in a store by displaying name
Select store from list; set Input Binary Field to data; set Display Name to my-document.pdf; Delete Old Document By to Display Name; provide Old Document Filename my-document.pdf; set Metadata Key to documentId; Metadata Value to doc-12345; deleteAllMatches false; preserveMetadata true; Metadata Merge Strategy preferNew; add custom metadata; enable Wait for Completion; enable Force Delete.
Example 2: Upload a new image without deleting anything
Select store; set Input Binary Field to data; set Display Name to image.png; Delete Old Document By to None (Upload Only); enable Wait for Completion; leave Force Delete disabled.
Example 3: Replace documents matching a metadata key/value
Select store; set Input Binary Field to data; set Display Name to report.pdf; Delete Old Document By to Metadata; set Metadata Key to project; Metadata Value to alpha; deleteAllMatches true; preserveMetadata false; Metadata Merge Strategy preferNew; enable Wait for Completion; enable Force Delete.