Skip to content

Repository files navigation

FlowAutoGen

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.

Why not just point Selenium at your normal Chrome profile?

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:

  1. Copies just the session-carrying files (Local State, Cookies, Login Data, Preferences) from your real profile into a dedicated FlowAutoGenProfile directory — once, automatically, on first run.
  2. Launches Chrome pointed at that copy, with debugging enabled.
  3. 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.

Setup

  1. pip install -r requirements.txt
  2. Open config.json and check:
    • chrome.executable_path matches your Chrome install location.
    • chrome.source_user_data_dir matches your real Chrome's User Data folder (this is already filled in based on what you gave me).
    • Leave chrome.automation_user_data_dir as-is unless you want the seeded profile somewhere else.
  3. Fill in prompts.txt, one prompt per line.
  4. 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.json under selectors. 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.
  5. Run: python main.py

How a run works

  1. Click START Automation.
  2. 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.
  3. 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.
  4. Each prompt in prompts.txt is 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.
  5. STOP halts before the next prompt (or during a generation wait) without killing your Chrome window.

If you need to refresh the login session

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_start to true in config.json to re-copy session files from your main profile on the next run, then set it back to false.

Project layout

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

Known limitations / next steps

  • Selectors in config.json are 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_complete uses a generic "loading indicator gone + result element present" heuristic. If Flow shows a multi-stage progress UI, you may want to tighten generating_indicator to 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.

About

Professional Google Flow AI Automation Tool

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages