The Electron Shell
The Electron GUI (gui.exe) is the visual interface of Flowork OS. Built with Electron 28, it provides a Chromium-based desktop window that loads the Flowork website and adds native OS capabilities.
Key Features
WebSocket Server (Port 5001)
The most critical feature. A WebSocket server runs on Port 5001 to enable the AI assistant to control browser tabs:open_ai_tab— Create a new browser windowcapture_browser— Screenshot any tab as Base64execute_browser_script— Inject JavaScript into any tablist_browsers— Get all open tabs with URLsget_console_logs— Read console output from any tab
Browser Farm
Multiple BrowserView/BrowserWindow instances are managed in abrowserViews{} dictionary. Each tab can be independently controlled, screenshotted, and scripted — enabling automated browsing and scraping.
Preload Bridge
preload.js uses Electron contextBridge to safely expose IPC methods as window.floworkDesktop. This gives the Vue SPA access to native features like file dialogs, app tab management, and AI browser control.
Dynamic Component Discovery
Modules placed inflowork_modules/ are automatically scanned and loaded at startup. Each module exports an init() function that receives ipcMain, FloworkState, and node.js modules.