> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibeflow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Mutation Node

> Create, update, and delete data in your database collections

## Overview

The **Mutation Node** modifies data in your database collections. Use it to create new records, update existing ones, or delete data.

<img src="https://mintcdn.com/vibeflow/Vp9iYgMK68mQ5fXV/images/mutation-node.png?fit=max&auto=format&n=Vp9iYgMK68mQ5fXV&q=85&s=024a603dda023e2cc687ab03356be1f4" alt="Mutation Node configuration showing Insert mutation type with field mappings" style={{ width: "100%", borderRadius: "8px", marginTop: "1rem", marginBottom: "2rem" }} width="1294" height="1644" data-path="images/mutation-node.png" />

## Required Configuration

### Collection Name

The name of the collection/table to modify (e.g., `users`, `products`)

### Mutation Type

Select one of:

* **Insert:** Create new records
* **Patch:** Update specific fields on an existing record
* **Delete:** Remove records

### Type-Specific Data

Each mutation type requires specific configuration:

* **Insert**: At least one field mapping (field name + value + mode)
* **Patch**: A **Document ID** to identify which record to update, plus at least one patch field (field name + value + mode). The Document ID supports Fixed, From args, and Expression value modes.
* **Delete**: A **Delete Scope** to choose between deleting a single document or an entire table

## Optional Configuration

* **Requires Auth:** Whether this node needs user authentication (default: false)

## Connections

Mutation nodes **produce data** (mutation results) and can connect to:

* Business logic nodes (Query, Agent)
* Frontend Element nodes (output results)

## Common Use Cases

**User Management.** Create new accounts, update profiles, or delete users.

**Content Management.** Add, edit, or remove posts, products, or other content.

**Data Processing.** Save form submissions, update preferences, or process transactions.

**Bulk Operations.** Create or update multiple records from imported data.

### Example Workflows

* **User Registration**: Frontend Element → If-Else (validation) → Mutation (Insert User) → Return Results
* **Profile Update**: Frontend Element → Mutation (Patch User) → Return Results
* **Data Import**: Frontend Element → For Loop → Mutation (Insert Records) → Return Results

## Related Nodes

<CardGroup cols={2}>
  <Card title="Collection Node" icon="database" href="/nodes/collection-node">
    Define the database schema that mutations modify
  </Card>

  <Card title="Query Node" icon="search" href="/nodes/query-node">
    Read data from collections
  </Card>
</CardGroup>
