Desktop automation for Google Labs Flow, using Selenium attached to a real Chrome session (so your Google login carries over) via Chrome's remote debugging protocol.
Since Chrome 136, Chrome refuses --remote-debugging-port if
--user-data-dir points at the profile it considers "the live default
one." This is an intentional anti-hijacking restriction from Google,
not something you can flag your way past. FlowAutoGen instead:
- Copies just the session-carrying files (
Local State,Cookies,Login Data,Preferences) from your real profile into a dedicatedFlowAutoGenProfiledirectory — once, automatically, on first run. - Launches Chrome pointed at that copy, with debugging enabled.
- Attaches Selenium to that already-running Chrome via
debugger_address, instead of spawning a fresh throwaway browser.
Your everyday Chrome windows are never touched or launched with debugging enabled.
pip install -r requirements.txt- Open
config.jsonand check:chrome.executable_pathmatches your Chrome install location.chrome.source_user_data_dirmatches your real Chrome'sUser Datafolder (this is already filled in based on what you gave me).- Leave
chrome.automation_user_data_diras-is unless you want the seeded profile somewhere else.
- Fill in
prompts.txt, one prompt per line. - Required before Phase 2 works: open Flow in a normal browser,
right-click the prompt box / Generate button / result / download
button, choose "Inspect", and copy real CSS selectors into
config.jsonunderselectors. I could not inspect Flow's DOM myself since it's behind your Google login — the selectors shipped here are best-guess placeholders and will very likely need adjusting. Each field accepts a comma-separated list of fallback selectors. - Run:
python main.py
- Click START Automation.
- FlowAutoGen checks for an already-running debug Chrome on port 9222; if none exists, it seeds the automation profile (first run only) and launches one.
- Selenium attaches, opens Flow, and redirects downloads for this session into your chosen output folder via a CDP command — this does not change your global Chrome download settings.
- Each prompt in
prompts.txtis typed in, submitted, waited on, and its result downloaded, in order. Progress and errors stream into the status console. A failed prompt is logged and skipped rather than aborting the whole batch. - STOP halts before the next prompt (or during a generation wait) without killing your Chrome window.
If your Google session in the automation profile expires, either:
- Log into Flow manually inside the FlowAutoGen-launched Chrome window (it's a real Chrome window, you can use it normally), or
- Set
chrome.reseed_profile_on_starttotrueinconfig.jsonto re-copy session files from your main profile on the next run, then set it back tofalse.
FlowAutoGen/
├── main.py entry point
├── gui.py CustomTkinter UI + background thread orchestration
├── browser.py Chrome launch/attach, profile seeding, CDP download redirect
├── automation.py Flow-specific steps: prompt, generate, wait, download
├── config_manager.py typed loader for config.json
├── logger.py thread-safe logging (file + GUI console)
├── config.json all tunables: paths, timeouts, selectors
├── prompts.txt
├── downloads/
└── requirements.txt
- Selectors in
config.jsonare unverified placeholders — this is the one thing I genuinely cannot do for you without access to Flow's logged-in DOM. Everything else is wired up and ready to run once those are filled in. wait_for_generation_completeuses a generic "loading indicator gone + result element present" heuristic. If Flow shows a multi-stage progress UI, you may want to tightengenerating_indicatorto the specific final-state class.- Currently handles one generation at a time, sequentially. If Flow
supports queuing multiple generations in parallel, that's a
straightforward extension to
FlowAutomation.run()but changes the wait/download bookkeeping, so it's left out until you confirm you want it.