Repository navigation
Home
BlockFlow is a browser extension (Chrome, Firefox, Safari) for building automations out of connectable blocks, n8n style, written with WXT + React + TypeScript + React Flow. This wiki is the internals reference: what every module does, how the pieces talk to each other, and how to change them safely.
Source: this wiki lives in the repo at docs/wiki and is published to the Forgejo and GitHub wikis
with npm run wiki:publish. Edit the files in the repo, never the web wiki pages (the next publish
overwrites them).
| You want to… | Read |
|---|---|
| Use BlockFlow or have an AI build workflows | Usage guide and the generated block reference |
| Understand the design and why it is shaped this way | Architecture |
| Learn to write extensions by hand, starting from plain JS | Learning course |
| Find out what a module does, or change it | This wiki |
| Send a change | Contributing |
Editor (React, src/entrypoints/editor) Background worker (src/entrypoints/background.ts) Web pages
───────────────────────────────────── ────────────────────────────────────────────────── ─────────
edit workflows ───────▶ storage ──────────▶ diff workflows, start/stop triggers
Run / Stop / Pick ────▶ messages ─────────▶ WorkflowRunner (src/core) ──▶ Host (src/browser) ──▶ page agent (src/dom)
run log, reports ◀───── storage ◀────────── runs, logs, datasets alarms, tabs, CDP, offscreen
-
src/core: the engine and all blocks. No browser APIs; everything external goes through theHostinterface, so it runs in plain Node tests. -
src/browser: the realHost: tabs, scripting, alarms, storage, CDP, popups, downloads. -
src/dom: code injected into web pages: the page agent, locators, picker and recorder. -
src/entrypoints: the extension's entry points: background worker, editor page, content scripts, offscreen document. -
src/shared: message types and storage keys shared by the worker and the editor.
Engine (src/core)
-
Core Engine: runner, runs, ports, sessions, the
Hostinterface and the block contract - Core Modules: expressions, templates, conditions, CSV, reports, schedules, URL patterns, Playwright export…
- Page Protocol: every page request a block can send to a tab
- Block Internals: how blocks are built, with a table of all of them
- Adding a Block: step by step, with a checklist
Browser side (src/browser, src/shared)
- Background Worker: start-up, listeners, the offscreen document
-
Browser Host: every
src/browsermodule and browser differences - Scheduling and Timers: alarms, the hybrid scheduler, the 30-second rule
- Message Protocol: every runtime message
- Storage Keys: everything kept in extension storage
In the page (src/dom)
- Page Agent: how page ops are carried out inside tabs and frames
- Locators: locator syntax, resolution and generated locators
- Picker and Recorder: element picking and recording actions as blocks
Editor (src/entrypoints/editor)
- Editor: structure, state, storage and the workflow ↔ canvas conversion
- Editor Components: one section per component
Project
- Testing: unit, DOM and end-to-end tests, and the fake host
- Build and Release: npm scripts, manifest, permissions, per-browser builds
- Tooling and Scripts: generated docs, example sync, wiki publishing, CI
These come from CLAUDE.md, which has the full list:
-
src/corenever imports browser APIs or DOM types. It reaches the outside only throughHost. - Blocks never use
setTimeoutfor workflow timing, because the MV3 worker sleeps. Usectx.timersandctx.state. - Payloads stay JSON-serialisable.
- Use relative imports only, and
import typefor types. - After changing blocks, run
npm run guide:sync. After changing a lesson, runnpm run learn:sync.npm run checkmust pass.
Generated from docs/wiki in the repo by npm run wiki:publish. Edit the repo files, not this wiki.
Using BlockFlow
- What is BlockFlow
- Installing
- Getting Started
- Concepts
- Using the Editor
- Workflows as Scripts
- Recipes
- Capabilities and Limitations
- Troubleshooting
- Roadmap
Reference
Internals: engine
Internals: browser
Outside access (M4)
Internals: page and editor
Project