# servicesliqueserve-svg/flowforge-whatsapp-agent architecture

> Architecture diagram of the GitHub repository servicesliqueserve-svg/flowforge-whatsapp-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/servicesliqueserve-svg/flowforge-whatsapp-agent
- Repository: https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent

## Overview

FlowForge is a WhatsApp AI-agent backend, with a parallel website-chat API and Meta agent onboarding. The main messaging flow is incoming WhatsApp webhook, signature validation, message handling, Forge reply generation, and WhatsApp response. The website endpoint shares the reply engine; onboarding is a separate administrative capability. The graph follows documented routes and excerpted calls; unsampled infrastructure and persistence integrations are omitted.

Main entry points: [`index.js`](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/index.js) (Express server and routes), [`webhook.js`](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/webhook.js) (Webhook verification and routing), [`whatsapp.js`](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/whatsapp.js) (WhatsApp send and read status), [`agent.js`](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/agent.js) (Forge reply and session memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["Server and APIs"]
  node_server["Express server and routes<br/>[index.js]"]
end

subgraph group_messaging["WhatsApp Messaging"]
  node_signature["Webhook signature validation"]
  node_webhook["Webhook verification and routing<br/>[webhook.js]"]
  node_whatsapp["WhatsApp send and read status<br/>[whatsapp.js]"]
end

subgraph group_ai["Forge AI"]
  node_forge["Forge reply and session memory<br/>[agent.js]"]
end

subgraph group_onboarding["Meta Onboarding"]
  node_onboarding["Agent onboarding request<br/>[onboarding.js]"]
end

node_customer(("WhatsApp customer"))
node_meta_cloud["WhatsApp Cloud API"]
node_website_user(("Website visitor"))
node_meta_model["Meta Model API"]
node_meta_onboarding["Meta Onboarding API"]

node_customer -->|"sends message"| node_meta_cloud
node_meta_cloud -->|"posts events"| node_webhook
node_server -->|"configures validation"| node_signature
node_server -->|"routes webhook"| node_webhook
node_webhook -->|"requests reply"| node_forge
node_webhook -->|"marks read"| node_whatsapp
node_webhook -->|"sends reply"| node_whatsapp
node_forge -->|"requests completion"| node_meta_model
node_whatsapp -->|"sends message status"| node_meta_cloud
node_meta_cloud -->|"delivers reply"| node_customer
node_website_user -->|"posts chat"| node_server
node_server -->|"requests reply"| node_forge
node_server -->|"returns reply"| node_website_user
node_server -->|"triggers registration"| node_onboarding
node_onboarding -->|"registers agent"| node_meta_onboarding

click node_server "https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/index.js"
click node_signature "https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/webhook-signature.js"
click node_webhook "https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/webhook.js"
click node_whatsapp "https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/whatsapp.js"
click node_forge "https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/agent.js"
click node_onboarding "https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/onboarding.js"

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_server toneBlue
class node_signature,node_webhook,node_whatsapp toneAmber
class node_forge,node_meta_cloud,node_meta_model,node_meta_onboarding toneMint
class node_onboarding toneRose
class node_customer,node_website_user toneIndigo
```

## Components

### Server and APIs

- [Express server and routes](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/index.js): `index.js`

### WhatsApp Messaging

- [Webhook signature validation](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/webhook-signature.js): `webhook-signature.js`
- [Webhook verification and routing](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/webhook.js): `webhook.js`
- [WhatsApp send and read status](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/whatsapp.js): `whatsapp.js`

### Forge AI

- [Forge reply and session memory](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/agent.js): `agent.js`

### Meta Onboarding

- [Agent onboarding request](https://github.com/servicesliqueserve-svg/flowforge-whatsapp-agent/blob/main/onboarding.js): `onboarding.js`

### Other components

- **WhatsApp customer**
- **WhatsApp Cloud API**
- **Website visitor**
- **Meta Model API**
- **Meta Onboarding API**

## Connections

- WhatsApp customer → WhatsApp Cloud API: sends message (evidence: `README.md`)
- WhatsApp Cloud API → Webhook verification and routing: posts events (evidence: `README.md`)
- Express server and routes → Webhook signature validation: configures validation (evidence: `index.js`)
- Express server and routes → Webhook verification and routing: routes webhook (evidence: `index.js`)
- Webhook verification and routing → Forge reply and session memory: requests reply (evidence: `webhook.js`)
- Webhook verification and routing → WhatsApp send and read status: marks read (evidence: `webhook.js`)
- Webhook verification and routing → WhatsApp send and read status: sends reply (evidence: `webhook.js`)
- Forge reply and session memory → Meta Model API: requests completion (evidence: `agent.js`)
- WhatsApp send and read status → WhatsApp Cloud API: sends message status (evidence: `whatsapp.js`)
- WhatsApp Cloud API → WhatsApp customer: delivers reply (evidence: `README.md`)
- Website visitor → Express server and routes: posts chat (evidence: `index.js`)
- Express server and routes → Forge reply and session memory: requests reply (evidence: `index.js`)
- Express server and routes → Website visitor: returns reply (evidence: `index.js`)
- Express server and routes → Agent onboarding request: triggers registration (evidence: `index.js`)
- Agent onboarding request → Meta Onboarding API: registers agent (evidence: `onboarding.js`)
