# What happens in your body when you sleep

> A process map exported from forks.world (https://forks.world). Author: Brian. Source: https://forks.world/p/cmv21nmlt000cl206lsp3u9ka
> It describes who does what, in what order, and with which technology. Read the plain-language sections first; the JSON at the end is the exact, complete data.

## Summary

- 14 steps across 2 layers
- Persona: Your brain, Your body, Body clock

## Pain points

Where this process hurts, worst first:

- **Too little deep sleep: tired, hungry and foggy** (What happens in your body when you sleep; painful): Screens and caffeine late in the day cut deep sleep

## How to read this file

- A process is made of **layers**. The main layer is the top level; any step of kind `subprocess` opens a detail layer with its own lanes and steps.
- **Lanes** are either persona (people/roles) or technology (systems). Each step belongs to one lane; `using` lists tools a person uses for that step.
- Step kinds: `start`, `task`, `decision` (its arrows carry the answer as a label), `subprocess`, `end`.

## What happens in your body when you sleep

Lanes:
- Your brain: person / role (id `brain`)
- Your body: person / role (id `body`)
- Body clock: person / role (id `clock`)

Steps, in the order they run:

1. **Evening light fades and the body clock releases melatonin** [start; Body clock; id `z1`]
   - then Body temperature and heart rate drop
2. **Body temperature and heart rate drop** [task; Your body; id `z2`]
   - then Light sleep: breathing slows, muscles relax
3. **Light sleep: breathing slows, muscles relax** [task; Your brain; id `z3`]
   - then Deep sleep: growth hormone is released and the body repairs itself
4. **Deep sleep: growth hormone is released and the body repairs itself** [subprocess; Your brain; id `z4`], opens the detail layer "Deep sleep: the overnight repair shift"
   - then REM sleep: dreams, and the brain sorts the day's memories
5. **REM sleep: dreams, and the brain sorts the day's memories** [task; Your brain; id `z5`]
   - then Cycle repeats about every 90 minutes
6. **Cycle repeats about every 90 minutes** [task; Your brain; id `z6`]
   - then Morning light cuts melatonin and raises cortisol
7. **Morning light cuts melatonin and raises cortisol** [task; Body clock; id `z7`]
   - then Do you wake up rested?
8. **Do you wake up rested?** [decision; Your brain; id `z8`]
   - if "Yes" go to Ready for the day; if "No" go to Too little deep sleep: tired, hungry and foggy
9. **Ready for the day** [end; Your body; id `z9`]
10. **Too little deep sleep: tired, hungry and foggy** [task; Your body; id `z10`] ⚠ PAIN POINT (painful): Screens and caffeine late in the day cut deep sleep
   - then Cycle repeats about every 90 minutes

```mermaid
flowchart LR
  subgraph l_brain["Your brain"]
    n_z3["Light sleep: breathing slows, muscles relax"]
    n_z4[["Deep sleep: growth hormone is released and the body repairs itself"]]
    n_z5["REM sleep: dreams, and the brain sorts the day's memories"]
    n_z6["Cycle repeats about every 90 minutes"]
    n_z8{"Do you wake up rested?"}
  end
  subgraph l_body["Your body"]
    n_z2["Body temperature and heart rate drop"]
    n_z9(["Ready for the day"])
    n_z10["Too little deep sleep: tired, hungry and foggy"]
  end
  subgraph l_clock["Body clock"]
    n_z1(["Evening light fades and the body clock releases melatonin"])
    n_z7["Morning light cuts melatonin and raises cortisol"]
  end
  n_z1 --> n_z2
  n_z2 --> n_z3
  n_z3 --> n_z4
  n_z4 --> n_z5
  n_z5 --> n_z6
  n_z6 --> n_z7
  n_z7 --> n_z8
  n_z8 -->|"Yes"| n_z9
  n_z8 -->|"No"| n_z10
  n_z10 --> n_z6
```

### Deep sleep: the overnight repair shift (detail of step "Deep sleep: growth hormone is released and the body repairs itself")

Lanes:
- Your brain: person / role (id `brain`)
- Your body: person / role (id `body`)

Steps, in the order they run:

1. **Slow brain waves take over** [start; Your brain; id `p1`]
   - then Growth hormone rises
2. **Growth hormone rises** [task; Your body; id `p2`]
   - then Muscles and tissue repair
3. **Muscles and tissue repair** [task; Your body; id `p3`]
   - then Waste proteins are flushed out of the brain
4. **Waste proteins are flushed out of the brain** [end; Your brain; id `p4`]

```mermaid
flowchart LR
  subgraph l_brain["Your brain"]
    n_p1(["Slow brain waves take over"])
    n_p4(["Waste proteins are flushed out of the brain"])
  end
  subgraph l_body["Your body"]
    n_p2["Growth hormone rises"]
    n_p3["Muscles and tissue repair"]
  end
  n_p1 --> n_p2
  n_p2 --> n_p3
  n_p3 --> n_p4
```

## Full data (JSON)

```json
{
  "title": "What happens in your body when you sleep",
  "maps": {
    "m_deep": {
      "id": "m_deep",
      "lanes": [
        {
          "id": "brain",
          "name": "Your brain",
          "type": "person"
        },
        {
          "id": "body",
          "name": "Your body",
          "type": "person"
        }
      ],
      "steps": [
        {
          "id": "p1",
          "kind": "start",
          "lane": "brain",
          "next": [
            {
              "to": "p2"
            }
          ],
          "uses": [],
          "label": "Slow brain waves take over"
        },
        {
          "id": "p2",
          "kind": "task",
          "lane": "body",
          "next": [
            {
              "to": "p3"
            }
          ],
          "uses": [],
          "label": "Growth hormone rises"
        },
        {
          "id": "p3",
          "kind": "task",
          "lane": "body",
          "next": [
            {
              "to": "p4"
            }
          ],
          "uses": [],
          "label": "Muscles and tissue repair"
        },
        {
          "id": "p4",
          "kind": "end",
          "lane": "brain",
          "next": [],
          "uses": [],
          "label": "Waste proteins are flushed out of the brain"
        }
      ],
      "title": "Deep sleep: the overnight repair shift",
      "parent": {
        "map": "m_root",
        "step": "z4"
      }
    },
    "m_root": {
      "id": "m_root",
      "lanes": [
        {
          "id": "brain",
          "name": "Your brain",
          "type": "person"
        },
        {
          "id": "body",
          "name": "Your body",
          "type": "person"
        },
        {
          "id": "clock",
          "name": "Body clock",
          "type": "person"
        }
      ],
      "steps": [
        {
          "id": "z1",
          "kind": "start",
          "lane": "clock",
          "next": [
            {
              "to": "z2"
            }
          ],
          "uses": [],
          "label": "Evening light fades and the body clock releases melatonin"
        },
        {
          "id": "z2",
          "kind": "task",
          "lane": "body",
          "next": [
            {
              "to": "z3"
            }
          ],
          "uses": [],
          "label": "Body temperature and heart rate drop"
        },
        {
          "id": "z3",
          "kind": "task",
          "lane": "brain",
          "next": [
            {
              "to": "z4"
            }
          ],
          "uses": [],
          "label": "Light sleep: breathing slows, muscles relax"
        },
        {
          "id": "z4",
          "kind": "subprocess",
          "lane": "brain",
          "next": [
            {
              "to": "z5"
            }
          ],
          "uses": [],
          "child": "m_deep",
          "label": "Deep sleep: growth hormone is released and the body repairs itself"
        },
        {
          "id": "z5",
          "kind": "task",
          "lane": "brain",
          "next": [
            {
              "to": "z6"
            }
          ],
          "uses": [],
          "label": "REM sleep: dreams, and the brain sorts the day's memories"
        },
        {
          "id": "z6",
          "kind": "task",
          "lane": "brain",
          "next": [
            {
              "to": "z7"
            }
          ],
          "uses": [],
          "label": "Cycle repeats about every 90 minutes"
        },
        {
          "id": "z7",
          "kind": "task",
          "lane": "clock",
          "next": [
            {
              "to": "z8"
            }
          ],
          "uses": [],
          "label": "Morning light cuts melatonin and raises cortisol"
        },
        {
          "id": "z8",
          "kind": "decision",
          "lane": "brain",
          "next": [
            {
              "to": "z9",
              "label": "Yes"
            },
            {
              "to": "z10",
              "label": "No"
            }
          ],
          "uses": [],
          "label": "Do you wake up rested?"
        },
        {
          "id": "z9",
          "kind": "end",
          "lane": "body",
          "next": [],
          "uses": [],
          "label": "Ready for the day"
        },
        {
          "id": "z10",
          "kind": "task",
          "lane": "body",
          "next": [
            {
              "to": "z6"
            }
          ],
          "pain": {
            "note": "Screens and caffeine late in the day cut deep sleep",
            "level": 2
          },
          "uses": [],
          "label": "Too little deep sleep: tired, hungry and foggy"
        }
      ],
      "title": "What happens in your body when you sleep",
      "parent": null
    }
  }
}
```
