Skip to content

chelslava/autoflow-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

105 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

English | Русский

.NET 10 YAML DSL Playwright VS Code Extension MIT License Release v1.1.0

⚑ AutoFlow.NET

Automate anything. Write less code. Ship faster.

A modern, cross-platform automation framework with elegant YAML DSL.
Build workflows in minutes, not days.


🎯 Why AutoFlow.NET?

Stop writing boilerplate automation scripts. Define your workflows in clean YAML and let the engine handle the complexity.

schema_version: 1
name: fetch_and_process

tasks:
  main:
    steps:
      - parallel:
          max_concurrency: 5
          steps:
            - step: { id: users, uses: http.request, with: { url: "${api}/users" } }
            - step: { id: posts, uses: http.request, with: { url: "${api}/posts" } }
            - step: { id: comments, uses: http.request, with: { url: "${api}/comments" } }

That's it. 3 parallel HTTP requests with automatic error handling, logging, and reporting.


✨ Features that matter

Feature What it means for you
YAML DSL Describe workflows declaratively β€” no complex code
Parallel Execution Run independent steps concurrently β€” 5x faster workflows
Exponential Backoff Retry Auto-retry with smart delays β€” resilient by default
Secrets Management Inject secrets safely β€” auto-masked in logs & reports
Lifecycle Hooks Intercept any event β€” full observability
Browser Automation Playwright-powered β€” test any web app
SQLite Persistence Full execution history β€” audit everything

🧩 VS Code Extension

Install the AutoFlow.NET extension for the best development experience:

VS Code

Features:

Feature Description
🎨 Syntax Highlighting Keywords, variables, control flow
πŸ’‘ IntelliSense Keywords, arguments, outputs, variables
πŸ” Code Navigation Go to Definition, Find References, Workspace Symbols
✏️ Code Editing Quick Fixes, Signature Help, Code Folding
πŸ–₯️ UI Status Bar, Tree View, Document Links
πŸ“ Snippets 20+ workflow patterns
πŸš€ CLI Integration Run, validate, history, stats
# Download from releases and install
code --install-extension autoflow-1.1.0.vsix

See vscode-autoflow/README.md for full documentation.


πŸš€ Quick Start

# Clone and run in 30 seconds
git clone https://github.com/chelslava/autoflow-net.git
cd autoflow-net
dotnet run --project src/AutoFlow.Cli -- run examples/flow.yaml

Prerequisites: .NET 10 SDK

Browser Automation Setup

For browser automation workflows, install Playwright browsers:

# Build the CLI first
dotnet build src/AutoFlow.Cli

# Install browsers (Chromium, Firefox, WebKit)
pwsh src/AutoFlow.Cli/bin/Debug/net10.0/playwright.ps1 install

# Or install only Chromium (faster, ~150 MB)
pwsh src/AutoFlow.Cli/bin/Debug/net10.0/playwright.ps1 install chromium

Run browser example:

dotnet run --project src/AutoFlow.Cli -- run examples/browser_login.yaml

πŸ“– Examples

Ready-to-run workflows in examples/

File Shows
examples/flow.yaml Smallest possible workflow with log.info
examples/file_roundtrip.yaml Local file automation with files.write, files.exists, files.read, datetime.now, and if
examples/http_json_report.yaml HTTP request + JSON extraction + local report generation
examples/excel_summary.yaml Downloading an Excel file and reading rows with excel.read
examples/imports_report.yaml Focused imports example with shared variables and imported tasks
examples/parallel_fetch_report.yaml Focused parallel example that writes a summary report
examples/report_cli_demo.yaml Simple workflow intended for JSON/HTML report generation from the CLI
examples/advanced_flow.yaml if, foreach, call, and file reads
examples/advanced_features.yaml parallel, retry, on_error, and finally
examples/imports/main.yaml Workflow imports and reusable tasks
examples/browser_login.yaml Browser login flow
examples/browser_ecommerce.yaml Browser e-commerce scenario
examples/rpa_challenge.yaml Full 10-round RPA Challenge run until Congratulations!
examples/reframework/main.yaml REFramework-style structure for the RPA Challenge

Quick start for the new examples:

dotnet run --project src/AutoFlow.Cli -- run examples/file_roundtrip.yaml
dotnet run --project src/AutoFlow.Cli -- run examples/http_json_report.yaml
dotnet run --project src/AutoFlow.Cli -- run examples/excel_summary.yaml
dotnet run --project src/AutoFlow.Cli -- run examples/imports_report.yaml
dotnet run --project src/AutoFlow.Cli -- run examples/parallel_fetch_report.yaml

JSON/HTML report generation from the CLI

# JSON report
dotnet run --project src/AutoFlow.Cli -- run examples/report_cli_demo.yaml --output reports/report_cli_demo.json

# HTML report
dotnet run --project src/AutoFlow.Cli -- run examples/report_cli_demo.yaml --output reports/report_cli_demo.html

Real-world Example

Parallel API Fetch with Retry

schema_version: 1
name: data_pipeline

variables:
  api_base: https://api.example.com

tasks:
  main:
    on_error:
      - step: { id: alert, uses: log.info, with: { message: "❌ Pipeline failed!" } }
    
    finally:
      - step: { id: cleanup, uses: log.info, with: { message: "🧹 Cleanup done" } }
    
    steps:
      # Fetch in parallel β€” 3 concurrent requests
      - parallel:
          id: fetch_data
          max_concurrency: 3
          steps:
            - step:
                id: users
                uses: http.request
                with: { url: "${api_base}/users", method: GET }
                save_as: { body: users_data }
            
            - step:
                id: posts
                uses: http.request
                with: { url: "${api_base}/posts", method: GET }
                save_as: { body: posts_data }
      
      # Auto-retry with exponential backoff
      - step:
          id: unstable_endpoint
          uses: http.request
          with: { url: "${api_base}/flaky", method: GET }
          retry:
            attempts: 5
            type: exponential
            delay: "1s"
            max_delay: "30s"

Browser Automation

schema_version: 1
name: login_test

tasks:
  main:
    steps:
      - step:
          id: open_browser
          uses: browser.open
          with: { browser: chromium, headless: true }
          save_as: { browserId: browser_id }
      
      - step:
          id: navigate
          uses: browser.goto
          with: { browserId: "${browser_id}", url: "https://app.example.com/login" }
      
      - step:
          id: fill_credentials
          uses: browser.fill
          with:
            browserId: "${browser_id}"
            selector: "#email"
            value: "${secret:TEST_USER_EMAIL}"
      
      - step:
          id: submit
          uses: browser.click
          with: { browserId: "${browser_id}", selector: "button[type=submit]" }
      
      - step:
          id: verify
          uses: browser.assert_text
          with: { browserId: "${browser_id}", selector: ".welcome", expected: "Welcome" }

πŸ”§ CLI Commands

# Run a workflow
dotnet run --project src/AutoFlow.Cli -- run workflow.yaml

# Generate HTML report
dotnet run --project src/AutoFlow.Cli -- run workflow.yaml --output report.html

# Validate before running
dotnet run --project src/AutoFlow.Cli -- validate workflow.yaml

# View execution history
dotnet run --project src/AutoFlow.Cli -- history --status Failed

# Get statistics
dotnet run --project src/AutoFlow.Cli -- stats --days 7

# List available keywords
dotnet run --project src/AutoFlow.Cli -- list-keywords

🧩 Available Keywords

HTTP & Data

Keyword Description
http.request HTTP/HTTPS requests with full control
json.parse Extract values from JSON

Files

Keyword Description
files.read Read file contents
files.write Write to files
files.exists Check file existence
files.delete Delete files

Browser (Playwright)

Keyword Description
browser.open Launch Chromium/Firefox/WebKit
browser.goto Navigate to URL
browser.click Click elements
browser.fill Fill form fields
browser.wait Wait for elements
browser.screenshot Capture screenshots
browser.assert_text Verify page content
browser.evaluate Execute JavaScript

Control Flow

Keyword Description
if Conditional execution
for_each Loop over items
parallel Concurrent execution
call Reusable tasks
group Logical grouping

πŸ” Security First

Path Traversal Protection

File operations automatically reject ../ and absolute paths outside allowed directories.

SSRF Protection

HTTP requests to localhost, 192.168.x.x, 10.x.x.x blocked by default. Enable explicitly with allowPrivateNetworks: true.

Secret Masking

Secrets are automatically masked in logs and reports:

[INFO] Calling API with token: ***

πŸ”Œ Extend with Custom Keywords

[Keyword("slack.notify", Category = "Notifications", Description = "Send Slack message")]
public class SlackNotifyKeyword : IKeywordHandler<SlackNotifyArgs>
{
    public async Task<KeywordResult> ExecuteAsync(
        KeywordContext context,
        SlackNotifyArgs args,
        CancellationToken ct = default)
    {
        // Your logic here
        return KeywordResult.Success(new { messageId = "msg_123" });
    }
}

Register and use:

- step:
    id: notify_team
    uses: slack.notify
    with:
      channel: "#deployments"
      message: "Deploy complete! πŸš€"

πŸ“Š Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     YAML Workflow                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Parser (AST)                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Validation                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Runtime Engine                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚   Secrets   β”‚  β”‚   Hooks     β”‚  β”‚  Variables  β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Keyword Executors                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚  β”‚  HTTP  β”‚ β”‚ Files  β”‚ β”‚Browser β”‚ β”‚ Custom β”‚           β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Project Structure

AutoFlow.NET/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ AutoFlow.Abstractions/    # Core contracts
β”‚   β”œβ”€β”€ AutoFlow.Runtime/         # Execution engine
β”‚   β”œβ”€β”€ AutoFlow.Parser/          # YAML β†’ AST
β”‚   β”œβ”€β”€ AutoFlow.Validation/      # Schema validation
β”‚   β”œβ”€β”€ AutoFlow.Reporting/       # JSON/HTML reports
β”‚   β”œβ”€β”€ AutoFlow.Database/        # SQLite persistence
β”‚   └── AutoFlow.Cli/             # Command-line tool
β”œβ”€β”€ libraries/
β”‚   β”œβ”€β”€ AutoFlow.Library.Http/    # HTTP keywords
β”‚   β”œβ”€β”€ AutoFlow.Library.Files/   # File keywords
β”‚   └── AutoFlow.Library.Browser/ # Browser keywords
└── tests/                        # Test projects

πŸ—ΊοΈ Roadmap

Feature Status
YAML Parser βœ…
Control Flow (if/foreach/call) βœ…
Parallel Execution βœ…
Lifecycle Hooks βœ…
Secrets Management βœ…
Browser Automation βœ…
SQLite Persistence βœ…
Expression Language 🚧
Visual Workflow Editor πŸ“‹ Planned
Cloud Execution πŸ“‹ Planned

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License β€” use it for anything, commercial or personal.


πŸ’¬ Community


Made with ❀️ for automation engineers

Get started in 30 seconds β†’

About

Automate anything. Write less code. Ship faster. A modern, cross-platform automation framework with elegant YAML DSL. Build workflows in minutes, not days.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages