---
title: "create document · RUAL Documentation"
description: "Creates a document in the given storage."
canonical: https://docs.rual.nl/block-types/storage/function_create_document_from_mutations
language: en
---

# create document

This block is part of the [`storage`](https://docs.rual.nl/block-types/storage) group and was last modified in core [`v14.0.3`](https://docs.rual.nl/core-versions/140003).

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

Creates a document in the given storage.

- flow `flow`

- mutations required `mutations` Provide the mutations for this document. e.g. use `set fields` to set existing/new fields.

- expiry `date` When a document is given an expiry date, the document will be unrecoverably deleted on the given date.

- options `object` Options can be given e.g. `skip_revisions` to skip create revisions for high-update docs or `skip_on_saved` to skip the on-events for this document create.

- Storage required `storage` The storage this document will be created.

- GUID seed `v14.0.3` `value` Optional base value used to generate a deterministic GUID (the sha256 of the seed). The same seed always produces the same GUID. Use this to create documents addressable by a known key (e.g. product_guid + user_guid). Always wire the RAW seed : never the output of the `generate guid` block, which is already a hash and would land the document at a different GUID than your lookups compute. `update document`, `remove document` and `upsert document` accept the same raw seed on their own `guid_seed` pins.

- flow `flow`

- success `condition`

- guid `v10.6.1` `value`

- object `object`

- timestamp `v12.0.0` `number` timestamp in ms, can be used to wait for the document to be available in search.

- error `value`

[create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations) builds a new document from the mutations on its pin, prepared with [set fields](https://docs.rual.nl/block-types/mutations/mutations_set_bp_field_multiple). The storage pin takes a [storage selector](https://docs.rual.nl/block-types/globals/storage) and the flow continues once the document is stored, here into a [debug](https://docs.rual.nl/block-types/state ui/state_debug) block.

![Studio canvas example for the create document block: creating a document from mutations.](https://docs.rual.nl/canvas-examples/function_create_document_from_mutations.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [set fields](https://docs.rual.nl/block-types/mutations/mutations_set_bp_field_multiple): wired in both directions with this block. Generates an array of mutations based on the given filled fields.

- [branch](https://docs.rual.nl/block-types/flow/branch): wired in both directions with this block.

- [reply in JSON](https://docs.rual.nl/block-types/json/httpconnection_set_json): this block feeds into it. Reply to any httpconnection as JSON body.

- [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple): this block feeds into it. Gets the selected fields from the given object.

- [execute](https://docs.rual.nl/block-types/function%20execution/function_custom_execute): this block feeds into it. Executes the given funcion and waits for it to be executed.

- [concatenate values](https://docs.rual.nl/block-types/value/value_concatenate): feeds into this block.

### Used in these guides

These documentation pages use or explain this block:

- [Creating a REST API](https://docs.rual.nl/tutorials/rest-api)

- [Common Blueprint Patterns](https://docs.rual.nl/blueprints/common-patterns)

- [Storage Examples](https://docs.rual.nl/blueprints/storage-examples)

- [Storages](https://docs.rual.nl/blueprints/storage)

- [Block Templates, Combinations That Work](https://docs.rual.nl/block-types/block-templates)

- [Example: Simple Blog](https://docs.rual.nl/examples/simple-blog)

- [Build Your First CRUD App](https://docs.rual.nl/getting-started/first-crud-app)

- [Block Quick Reference](https://docs.rual.nl/reference/block-quick-reference)

### Version history

Introduced in [`v14.0.3`](https://docs.rual.nl/core-versions/140003).
