# mehmetbisen17/role-based-email-drafter architecture

> Architecture diagram of the GitHub repository mehmetbisen17/role-based-email-drafter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mehmetbisen17/role-based-email-drafter
- Repository: https://github.com/mehmetbisen17/role-based-email-drafter

## Overview

This n8n workflow turns incoming Notion contacts into role-specific Outlook drafts and writes status back to Notion; it creates drafts, not sent emails. The README documents six role routes, HTML templates, sender signatures, and both integrations. The graph captures those documented stages; workflow.json is the only implementation file listed, so its internal node-level connections cannot be independently verified here.

Main entry points: [`workflow.json`](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json) (Role switch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Contact intake"]
  node_webhook["Webhook trigger<br/>[workflow.json]"]
  node_role_switch["Role switch<br/>[workflow.json]"]
end

subgraph group_drafting["Role-based drafting"]
  node_gc_template["GC template<br/>[workflow.json]"]
  node_enr_template["ENR GC template<br/>[workflow.json]"]
  node_engineer_template["Engineer template<br/>[workflow.json]"]
  node_estimator_template["Estimator template<br/>[workflow.json]"]
  node_fabricator_template["Fabricator template<br/>[workflow.json]"]
  node_researcher_template["Researcher template<br/>[workflow.json]"]
  node_outlook(("Outlook draft"))
end

subgraph group_tracking["Draft tracking"]
  node_status_update["Status update<br/>[workflow.json]"]
end

node_notion(("Notion"))

node_notion -->|"sends contacts"| node_webhook
node_webhook -->|"routes contacts"| node_role_switch
node_role_switch -->|"routes GC"| node_gc_template
node_role_switch -->|"routes ENR GC"| node_enr_template
node_role_switch -->|"routes engineer"| node_engineer_template
node_role_switch -->|"routes estimator"| node_estimator_template
node_role_switch -->|"routes fabricator"| node_fabricator_template
node_role_switch -->|"routes researcher"| node_researcher_template
node_gc_template -->|"creates draft"| node_outlook
node_enr_template -->|"creates draft"| node_outlook
node_engineer_template -->|"creates draft"| node_outlook
node_estimator_template -->|"creates draft"| node_outlook
node_fabricator_template -->|"creates draft"| node_outlook
node_researcher_template -->|"creates draft"| node_outlook
node_outlook -->|"records status"| node_status_update
node_status_update -->|"writes status"| node_notion

click node_webhook "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_role_switch "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_gc_template "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_enr_template "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_engineer_template "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_estimator_template "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_fabricator_template "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_researcher_template "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"
click node_status_update "https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webhook,node_role_switch toneBlue
class node_gc_template,node_enr_template,node_engineer_template,node_estimator_template,node_fabricator_template,node_researcher_template,node_outlook toneAmber
class node_status_update toneMint
class node_notion toneIndigo
```

## Components

### Contact intake

- [Webhook trigger](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- [Role switch](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`

### Role-based drafting

- [GC template](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- [ENR GC template](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- [Engineer template](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- [Estimator template](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- [Fabricator template](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- [Researcher template](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`
- **Outlook draft**

### Draft tracking

- [Status update](https://github.com/mehmetbisen17/role-based-email-drafter/blob/main/workflow.json): `workflow.json`

### Other components

- **Notion**

## Connections

- Notion → Webhook trigger: sends contacts (evidence: `README.md`)
- Webhook trigger → Role switch: routes contacts (evidence: `README.md`)
- Role switch → GC template: routes GC (evidence: `README.md`)
- Role switch → ENR GC template: routes ENR GC (evidence: `README.md`)
- Role switch → Engineer template: routes engineer (evidence: `README.md`)
- Role switch → Estimator template: routes estimator (evidence: `README.md`)
- Role switch → Fabricator template: routes fabricator (evidence: `README.md`)
- Role switch → Researcher template: routes researcher (evidence: `README.md`)
- GC template → Outlook draft: creates draft (evidence: `README.md`)
- ENR GC template → Outlook draft: creates draft (evidence: `README.md`)
- Engineer template → Outlook draft: creates draft (evidence: `README.md`)
- Estimator template → Outlook draft: creates draft (evidence: `README.md`)
- Fabricator template → Outlook draft: creates draft (evidence: `README.md`)
- Researcher template → Outlook draft: creates draft (evidence: `README.md`)
- Outlook draft → Status update: records status (evidence: `README.md`)
- Status update → Notion: writes status (evidence: `README.md`)
