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

# Data Flow

> Understanding how data flows through ComfyDeploy

This document outlines the core data flow in ComfyDeploy, focusing on what matters most to you: your workflows, run history, and outputs.

## Data Components

| Component       | Type                      | Storage    | Access                                    |
| --------------- | ------------------------- | ---------- | ----------------------------------------- |
| **Workflows**   | `.json`                   | `postgres` | `Dashboard` / `API`                       |
| **Models**      | `.safetensors`            | `volume`   | `Dashboard` / `API`                       |
| **Run records** | `.json`                   | `postgres` | `Dashboard` / `API`                       |
| **Inputs**      | `.png` / `.jpg` / `.webp` | `s3`       | `Dashboard` / `API`                       |
| **Outputs**     | `.png` / `.jpg` / `.webp` | `s3`       | `Public unique URL` / `Dashboard` / `API` |

<Note>
  This is a high-level overview of ComfyDeploy's data flow. Some technical details and advanced features may be simplified for clarity.
</Note>

<Warning>
  Custom S3 Integration requires a Business Plan.
</Warning>

## Importing a workflow

<img src="https://mintcdn.com/comfydeploy/o5fOxSEVTG8z9WUO/images/data/importing-workflow-machine.png?fit=max&auto=format&n=o5fOxSEVTG8z9WUO&q=85&s=55b42a5bd22fd06d5834470e10045fc2" alt="Import workflow" width="1920" height="1080" data-path="images/data/importing-workflow-machine.png" />

| Step | Action          | Result                                 |
| ---- | --------------- | -------------------------------------- |
| 1    | Import workflow | Workflow\.json saved to postgres       |
| 2    | Machine config  | Machine config saved to postgres       |
| 3    | Create machine  | Machine image built and ready to serve |

## Using Session

<img src="https://mintcdn.com/comfydeploy/o5fOxSEVTG8z9WUO/images/data/sessions.png?fit=max&auto=format&n=o5fOxSEVTG8z9WUO&q=85&s=eb615a2eda922595e8dbae8c72e093f6" alt="Using Session" width="1920" height="1080" data-path="images/data/sessions.png" />

| Step | Action                  | Result                                         |
| ---- | ----------------------- | ---------------------------------------------- |
| 1    | Getting workflow        | Workflow\.json loaded from postgres            |
| 2    | Start ComfyUI session   | Queue job to start ComfyUI session             |
| 3    | ComfyUI session started | Session URL returned to user                   |
| 3    | Run workflow            | Workflow runs and outputs saved to ComfyDeploy |
| 4    | Output results          | Access via ComfyUI session                     |

## Workflow / API Run

<img src="https://mintcdn.com/comfydeploy/o5fOxSEVTG8z9WUO/images/data/data-flow-standard.png?fit=max&auto=format&n=o5fOxSEVTG8z9WUO&q=85&s=15eb9c9e6b63f699fa4f70ed44e6777f" alt="Import workflow" width="1920" height="1080" data-path="images/data/data-flow-standard.png" />

| Step | Action              | Result                         |
| ---- | ------------------- | ------------------------------ |
| 1    | Receive user inputs | Image upload to `s3`           |
| 2    | Execute workflow    | Creates `run` record           |
| 3    | Monitor progress    | Updates in `run history`       |
| 4    | Generate outputs    | Stored in ComfyDeploy          |
| 5    | Output results      | Access via `public unique URL` |

If you are interested in using your own media storage, you can use our [Custom S3 Integration](/v2/integration/custom-s3) to store your media in your own S3 bucket.
