---
title: "Data Fetching Mutations"
description: "Data Fetching Mutations let you retrieve data directly on the server, stream dynamic content seamlessly to users, and trigger secure data updates using Server Actions."
last_updated: "2026-09-23T10:57:21.229799+00:00"
canonical_url: "https://www.doc0.dev/docs/8f4009b0-65bd-4480-9b00-e201f0914bb3/guide/core-concepts/data-fetching-mutations"
---

## Overview

Data Fetching Mutations let you retrieve data directly on the server, stream dynamic content seamlessly to users, and trigger secure data updates using **Server Actions**. 

Server Actions are asynchronous functions executed on the server that can be called from client-side components to perform operations like saving data, updating databases, or handling form submissions. The framework handles the heavy lifting of securely encoding arguments, managing transport streams, and refreshing page data automatically once a mutation completes.

---

## Key Concepts

Before working with server actions and data fetching, it helps to understand a few core terms:

* **Server Action:** An asynchronous function defined on the server that can be invoked from the client. It handles backend operations securely without requiring you to manually build custom API endpoints.
* **Flight Data:** A specialized streaming format used by the application to send rendered React Server Component trees and updates between the server and the client router.
* **Revalidation:** The process of invalidating cached server data so that subsequent page requests or actions fetch the freshest available information.
* **Body Size Limit:** A configurable restriction on the maximum payload size (such as form data or uploaded files) that a Server Action can accept.

---

## How Server Actions Process Requests

When a user triggers a Server Action from the browser, the system follows a clear lifecycle to securely execute the code and update the user interface:

```mermaid
flowchart TD
  A[User triggers action] --> B[Client encodes arguments and router state]
  B --> C[POST request sent to server]
  C --> D[Server decodes payload and executes action]
  D --> E[Router refreshes data and updates UI]
```

1. **Trigger:** The user interacts with the app (e.g., clicks a button or submits a form).
2. **Encoding:** The client packages the action identifier and any arguments using a specialized reply encoder.
3. **Transmission:** A secure `POST` request is dispatched to the server containing necessary router state headers and deployment tracking IDs.
4. **Execution:** The server receives the request, validates security origins and content limits, decodes the action arguments, and runs the server-side function.
5. **Response & Refresh:** The server responds with updated component data (Flight data) or redirect instructions, allowing the client router to seamlessly refresh the interface.

---

## Configuration Options

When configuring server actions and request bodies in your project settings, keep the default limits and behaviors in mind:

| Feature / Setting | Default Behavior | Description |
| :--- | :--- | :--- |
| **Default Body Size Limit** | `1 MB` | The maximum allowable size for incoming Server Action request payloads. |
| **Supported Runtimes** | Node, Edge | Supported execution environments where server actions and manifests are registered. |
| **Content-Type Header** | `text/x-component` | The required content type for valid React Server Component responses. |

> [!NOTE]
> If a Server Action payload exceeds the configured body size limit, the server will reject the request with a `413 Payload Too Large` error.

---

## Tips and Best Practices

> [!TIP]
> Always ensure your server actions handle validation errors gracefully and return structured results so your client components can display helpful feedback to users.

> [!WARNING]
> Do not attempt to pass sensitive credentials or unencrypted secrets directly through client-exposed action arguments. Always access environment variables and secure databases entirely on the server side inside your action body.

## Related

- [Server Client Components](https://www.doc0.dev/docs/8f4009b0-65bd-4480-9b00-e201f0914bb3/guide/core-concepts/server-client-components)
- [Caching and Revalidation](https://www.doc0.dev/docs/8f4009b0-65bd-4480-9b00-e201f0914bb3/guide/core-concepts/caching-and-revalidation)
- [Forms and Mutations](https://www.doc0.dev/docs/8f4009b0-65bd-4480-9b00-e201f0914bb3/guide/how-to-guides/forms-and-mutations)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/8f4009b0-65bd-4480-9b00-e201f0914bb3/llms.txt) for all pages in this wiki.
