Web UI — Visual Pipeline Editor
The apps/webui/ directory contains a browser-based node editor for building and running foreblocks forecasting pipelines without writing code. Nodes represent pipeline stages; edges connect outputs to inputs. Execution happens on a local FastAPI backend that streams progress back to the browser via WebSocket.
This is a local, self-hosted tool (start it with foreblocks-studio or python server.py against your own Python environment) — it is not the interactive demo published at /studio/ on the docs site. That public playground is a separate, static, client-side-only app built from apps/studio/ (see its README).
Starting the server
cd apps/webui
npm install # first time only
npm run build # compile the React frontend into dist/
python server.py # starts on http://localhost:8000pip install fastapi uvicorn torch matplotlibBrowser (React + ReactFlow)
↓ POST /execute (generated Python code + workflow graph)
FastAPI server → ThreadPoolExecutor worker
↓ WebSocket /ws/{task_id} (live events)
Browser receives: logs, progress, node results, artifactssync=false(default): returns immediately with atask_id; poll or subscribe via WebSocket for resultssync=true: waits up totimeout_secand returns inline results if finished in time
Response:
{"success": true, "task_id": "uuid4", "results": null}States: queued → running → success | error
GET /logs/{task_id}
Retrieve timestamped execution logs.
{"task_id": "...", "logs": ["[10:42:01] ⏳ Starting execution", ...]}set_result(node_id, result_type, data) — node_id should match the node's ID in the workflow graph. result_type is one of the type strings from the table above.
Auto-detection fallback
If user code does not call report.set_result(), the backend attempts automatic result extraction by looking for these variables in the execution namespace:
| Variable | Action |
|---|---|
trainer, X_val, Y_val | Calls trainer.metrics(X_val, Y_val) and trainer.plot_prediction(...) |
metrics | Attaches as metrics result on the output node |
time_series, train_size | Passed to plot_prediction as full_series / offset |
Environment injected into user code
| Name | Value |
|---|---|
torch | import torch |
report | ReportBridge instance for the current task |
__name__ | "__main__" |
numpy, matplotlib.pyplot, and matplotlib (Agg backend) are imported inside the worker before exec() but are not injected into the namespace by default — import them explicitly in your code if needed.