# dheeraj932/webflow-agent architecture

> Architecture diagram of the GitHub repository dheeraj932/webflow-agent, 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/dheeraj932/webflow-agent
- Repository: https://github.com/dheeraj932/webflow-agent

## Overview

Agent B turns a natural-language request into a browser workflow, executes it against a live application, and captures UI states. The sampled code shows the CLI invoking AgentB, AgentB coordinating Navigator and ScreenshotCapture, and Navigator controlling a persistent Playwright browser. README documentation describes AI planning, error recovery, semantic element matching, login handling, and task-organized datasets; some of those internals are not visible in the excerpts, so their connections are documented rather than inferred from module names.

Main entry points: [`src/agent.py`](https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py) (Agent B coordinator), [`src/navigator.py`](https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py) (Browser session), [`main.py`](https://github.com/dheeraj932/webflow-agent/blob/main/main.py) (CLI entry), [`src/screenshot.py`](https://github.com/dheeraj932/webflow-agent/blob/main/src/screenshot.py) (Screenshot capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Task workflow"]
  node_cli["CLI entry<br/>[main.py]"]
  node_agent["Agent B coordinator<br/>[agent.py]"]
  node_planner["AI task planner<br/>[agent.py]"]
  node_planexec["Plan execution and recovery<br/>[agent.py]"]
end

subgraph group_browser["Browser interaction"]
  node_navigator["Browser session<br/>[navigator.py]"]
  node_discovery["Element discovery<br/>[navigator.py]"]
  node_interaction["UI interaction<br/>[navigator.py]"]
end

subgraph group_capture["State capture"]
  node_capture["Screenshot capture<br/>[screenshot.py]"]
  node_dataset[("Task-organized states<br/>[agent.py]")]
end

subgraph group_services["External services"]
  node_groq{{"Groq LLM"}}
  node_webapp["Live web application"]
  node_playwright["Playwright browser"]
end

node_user(("Task requester"))

node_user -->|"submits task"| node_cli
node_cli -->|"invokes"| node_agent
node_agent -->|"understands task"| node_planner
node_planner -->|"requests plan"| node_groq
node_agent -->|"executes plan"| node_planexec
node_planexec -->|"drives workflow"| node_navigator
node_navigator -->|"controls browser"| node_playwright
node_playwright -->|"interacts with"| node_webapp
node_navigator -->|"discovers elements"| node_discovery
node_navigator -->|"performs actions"| node_interaction
node_agent -->|"captures UI states"| node_capture
node_capture -->|"organizes by task"| node_dataset

click node_cli "https://github.com/dheeraj932/webflow-agent/blob/main/main.py"
click node_agent "https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py"
click node_planner "https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py"
click node_planexec "https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py"
click node_navigator "https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py"
click node_discovery "https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py"
click node_interaction "https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py"
click node_capture "https://github.com/dheeraj932/webflow-agent/blob/main/src/screenshot.py"
click node_dataset "https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py"

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_cli,node_agent,node_planner,node_planexec toneBlue
class node_navigator,node_discovery,node_interaction toneAmber
class node_capture,node_dataset toneMint
class node_groq,node_webapp,node_playwright,node_user toneRose
```

## Components

### Task workflow

- [CLI entry](https://github.com/dheeraj932/webflow-agent/blob/main/main.py): `main.py`
- [Agent B coordinator](https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py): `src/agent.py`
- [AI task planner](https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py): `src/agent.py`
- [Plan execution and recovery](https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py): `src/agent.py`

### Browser interaction

- [Browser session](https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py): `src/navigator.py`
- [Element discovery](https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py): `src/navigator.py`
- [UI interaction](https://github.com/dheeraj932/webflow-agent/blob/main/src/navigator.py): `src/navigator.py`

### State capture

- [Screenshot capture](https://github.com/dheeraj932/webflow-agent/blob/main/src/screenshot.py): `src/screenshot.py`
- [Task-organized states](https://github.com/dheeraj932/webflow-agent/blob/main/src/agent.py): `src/agent.py`

### External services

- **Groq LLM**
- **Live web application**
- **Playwright browser**

### Other components

- **Task requester**

## Connections

- Task requester → CLI entry: submits task (evidence: `README.md`)
- CLI entry → Agent B coordinator: invokes (evidence: `main.py`)
- Agent B coordinator → AI task planner: understands task (evidence: `README.md`)
- AI task planner → Groq LLM: requests plan (evidence: `README.md`)
- Agent B coordinator → Plan execution and recovery: executes plan (evidence: `src/agent.py`)
- Plan execution and recovery → Browser session: drives workflow (evidence: `src/agent.py`)
- Browser session → Playwright browser: controls browser (evidence: `src/navigator.py`)
- Playwright browser → Live web application: interacts with (evidence: `README.md`)
- Browser session → Element discovery: discovers elements (evidence: `src/navigator.py`)
- Browser session → UI interaction: performs actions (evidence: `src/navigator.py`)
- Agent B coordinator → Screenshot capture: captures UI states (evidence: `src/agent.py`)
- Screenshot capture → Task-organized states: organizes by task (evidence: `README.md`)
