upsert document
This block is part of the storage group and was last modified in core v15.0.0.
Storage Selection Required
This block relies on a storage to perform its storage releated actions. You must manually select the storage you want to use in your flow using the storage selector modal. To access the modal, click the white button on the block.
upsert document v14.0.5 Updated v15.0.0Creates or updates a document with the given GUID. If the document does not exist, it will be created. If it already exists, the mutations will be applied to the existing document.
- flow
flow - guid required
valueThe GUID for this document. If a document with this GUID exists it will be updated, otherwise a new document will be created. • Hidden when other fields are filled
- GUID seed
v15.0.0valueOptional fallback when
guidis not connected: derives the document GUID from this seed exactly likecreate document'sguid_seed(the sha256 of the seed), so a create/update/remove/upsert set wired to the same raw seed always addresses the same document. Always wire the RAW seed : never the output of thegenerate guidblock, which is already a hash and would be hashed again. • Hidden when other fields are filled - mutations required
mutationsProvide the mutations for this document. e.g. use
set fieldsto set existing/new fields. - expiry
dateWhen a document is given an expiry date, the document will be unrecoverably deleted on the given date.
- options
objectOptions can be given e.g.
skip_revisionsto skip create revisions for high-update docs orskip_on_savedto skip the on-events for this document. - Storage required
storageThe storage this document will be created in or updated.
- flow
flow - success
condition - guid
value - object
object - timestamp
numbertimestamp in ms, can be used to wait for the document to be available in search.
- error
value - created
conditionReturns
trueif the document was created,falseif an existing document was updated. - has changes
v15.0.0conditionReturns
trueif the document was created or an existing document had any changes,falseif an existing document was updated without any effective changes.
A typical wiring for upsert document: generate guid feeds the guid pin; branch feeds the flow pin; set fields feeds the mutations pin; the flow out pin feeds return Exposed Data; the success out pin feeds branch.

Commonly used with
In production blueprints, this block is most often wired together with:
- branch: wired in both directions with this block.
- generate guid: feeds into this block. Generates a unique GUID. When a seed is provided, the GUID is deterministic (same seed always produces the same GUID) — the sha256 of the seed, the same derivation the document blocks apply to their guid_seed pin. Wire this output into verbatim guid pins (get / update / remove) to address seed-created documents. Never wire it into a guid_seed pin: that would hash the already-hashed value again and address a different document — give guid_seed pins the raw seed instead.
- return Exposed Data: this block feeds into it. Adds a custom array for each iteration in ForEach, allows you to expose values back to the original flow.
- set fields: feeds into this block. Generates an array of mutations based on the given filled fields.
- reply in JSON: this block feeds into it. Reply to any httpconnection as JSON body.
- multiple: feeds into this block. combine multiple mutations into one.
Version history
Introduced in v14.0.5.
Last modified in v15.0.0.
Back to
storage Return to the main group to view all sub-groups Back to storage Return to the group to view all blocks within this group
