Skip to main content

Create, edit, run deterministic workflows

Project description

Workflow-Use

Semantic browser automation with deterministic workflow generation and variables.

Quick Start

1. Test Deterministic Workflow Generation (NEW!)

python examples/scripts/deterministic/run_complete_test.py

Generate workflows without LLM for step creation - 10-100x faster, guaranteed semantic steps.

2. Create Your Own Workflow

from workflow_use.healing.service import HealingService
from browser_use.llm import ChatBrowserUse

llm = ChatBrowserUse(model_name="bu-latest")
service = HealingService(llm=llm, use_deterministic_conversion=True)

workflow = await service.generate_workflow_from_prompt(
    prompt="Go to GitHub, search for browser-use, get star count",
    agent_llm=llm,
    extraction_llm=llm
)

3. Run a Workflow

cd /path/to/workflow-use/workflows
python cli.py run-workflow-no-ai my_workflow.json

# If the workflow has variables, the CLI will prompt you interactively:
# Enter value for repo_name (required, type: string): browser-use

Key Features

๐Ÿš€ Deterministic Workflow Generation

  • Direct Action Mapping: input_text โ†’ input step (no LLM)
  • Guaranteed Semantic Steps: 0 agent steps (instant execution, $0/run)
  • 10-100x Faster: 5-10s vs 20-40s for LLM-based
  • 90% Cheaper: Minimal LLM usage

๐ŸŽฏ Semantic-Only Multi-Strategy Element Finding

  • No CSS/XPath: 100% semantic strategies (text, role, ARIA, placeholder, etc.)
  • 7 Fallback Strategies: text_exact โ†’ role_text โ†’ aria_label โ†’ placeholder โ†’ title โ†’ alt_text โ†’ text_fuzzy
  • Works WITH Browser-Use: Finds element index in DOM state, then uses browser-use's controller
  • Fast & Robust: Direct index lookup when strategies match, falls back to AI when needed
  • Human-Readable: Workflow YAML contains semantic strategies, not brittle selectors

๐Ÿ”„ Variables in Workflows

  • Reusable Workflows: Parameterize dynamic values
  • Semantic Targeting: Use {variable} in target_text
  • Auto-Extraction: LLM suggests variables automatically

Documentation


Project Structure

workflows/
โ”œโ”€โ”€ workflow_use/              # Main package
โ”‚   โ”œโ”€โ”€ healing/              # Workflow generation & healing
โ”‚   โ”‚   โ”œโ”€โ”€ deterministic_converter.py   # NEW: Deterministic conversion
โ”‚   โ”‚   โ”œโ”€โ”€ variable_extractor.py        # Auto variable detection
โ”‚   โ”‚   โ””โ”€โ”€ service.py                   # Main workflow generation
โ”‚   โ”œโ”€โ”€ workflow/             # Workflow execution
โ”‚   โ”‚   โ””โ”€โ”€ semantic_executor.py         # Semantic step execution
โ”‚   โ”œโ”€โ”€ controller/           # Workflow controller
โ”‚   โ”œโ”€โ”€ recorder/             # Workflow recording
โ”‚   โ”œโ”€โ”€ storage/              # Storage logic
โ”‚   โ”œโ”€โ”€ mcp/                  # MCP integration
โ”‚   โ”œโ”€โ”€ schema/               # Schema definitions
โ”‚   โ””โ”€โ”€ builder/              # Workflow builder
โ”‚
โ”œโ”€โ”€ backend/                  # FastAPI backend service
โ”‚   โ”œโ”€โ”€ api.py               # API entry point
โ”‚   โ”œโ”€โ”€ routers.py           # API routes
โ”‚   โ””โ”€โ”€ service.py           # Business logic
โ”‚
โ”œโ”€โ”€ examples/                 # Examples organized by feature
โ”‚   โ”œโ”€โ”€ scripts/
โ”‚   โ”‚   โ”œโ”€โ”€ deterministic/   # Deterministic workflow examples
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ run_complete_test.py        # โญ Test deterministic generation
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ create_deterministic_workflow.py
โ”‚   โ”‚   โ”œโ”€โ”€ variables/       # Variable feature examples
โ”‚   โ”‚   โ”œโ”€โ”€ demos/           # Advanced demos
โ”‚   โ”‚   โ””โ”€โ”€ runner.py        # Generic workflow runner
โ”‚   โ””โ”€โ”€ workflows/           # Example workflow JSON files
โ”‚       โ”œโ”€โ”€ basic/           # Basic workflow examples
โ”‚       โ”œโ”€โ”€ form_filling/    # Form filling examples
โ”‚       โ”œโ”€โ”€ parameterized/   # Parameterized workflows
โ”‚       โ””โ”€โ”€ advanced/        # Advanced workflows
โ”‚
โ”œโ”€โ”€ tests/                    # Test files
โ”‚   โ”œโ”€โ”€ test_button_click.py
โ”‚   โ””โ”€โ”€ test_recorded_workflow.py
โ”‚
โ”œโ”€โ”€ docs/                     # Documentation
โ”‚   โ”œโ”€โ”€ DETERMINISTIC.md     # Deterministic workflows
โ”‚   โ””โ”€โ”€ VARIABLES.md         # Variables guide
โ”‚
โ”œโ”€โ”€ data/                     # Runtime & test data
โ”‚   โ””โ”€โ”€ test_data/           # Test data (tracked in git)
โ”‚       โ”œโ”€โ”€ form-filling/
โ”‚       โ””โ”€โ”€ flight-test/
โ”‚
โ”œโ”€โ”€ cli.py                   # CLI entry point
โ”œโ”€โ”€ pyproject.toml          # Project configuration
โ””โ”€โ”€ README.md               # This file

Comparison: Deterministic vs LLM-Based

Feature Deterministic LLM-Based
Generation Speed โšก 5-10s ๐ŸŒ 20-40s
Generation Cost ๐Ÿ’ฐ $0.01-0.05 ๐Ÿ’ธ $0.10-0.30
Agent Steps โœ… 0 guaranteed โŒ Variable
Deterministic โœ… Yes โŒ No
Execution Speed โšก Instant ๐ŸŒ 5-45s
Execution Cost ๐Ÿ’ฐ $0/run ๐Ÿ’ธ $0.03-0.30/run

Recommendation: Use deterministic for most workflows (search, click, input, navigate).


Testing

# Test deterministic generation
python examples/scripts/deterministic/run_complete_test.py

# Test variables
python examples/scripts/variables/create_workflow_with_variables.py

# Compare approaches
python examples/scripts/deterministic/test_deterministic_workflow.py

Next Steps

  1. โœ… Run examples/run_complete_test.py
  2. โœ… Review the generated workflow JSON
  3. โœ… Try creating your own workflow
  4. โœ… Add variables to make it reusable

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

workflow_use-0.2.5.tar.gz (123.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

workflow_use-0.2.5-py3-none-any.whl (144.4 kB view details)

Uploaded Python 3

File details

Details for the file workflow_use-0.2.5.tar.gz.

File metadata

  • Download URL: workflow_use-0.2.5.tar.gz
  • Upload date:
  • Size: 123.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for workflow_use-0.2.5.tar.gz
Algorithm Hash digest
SHA256 d42c869fccbfed66f575df8eafd7a4472fb6f1a2e1a6e8e500bd4c5397194338
MD5 07c2db1d966d13221adc0a4526884a78
BLAKE2b-256 c3157f8e8ab72f1470a2c35527ac370e39ed9d0e9e0cb10cd4e1b83c6287a72c

See more details on using hashes here.

File details

Details for the file workflow_use-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for workflow_use-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c71a8f47f6bbe271c2a2b0b6715e9953401520e2b44bae21016a7b1bb6960f09
MD5 b9be944f6e78e166c617c21011f9c072
BLAKE2b-256 bdc82bd0cd8835533f2bbc40021e76b03dd044c1714794c757ef55ab85cb1c42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page