An open API service indexing awesome lists of open source software.

https://github.com/chelslava/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.
https://github.com/chelslava/autoflow-net

automation browser-automation cross-platform dotnet dsl playwright rpa task-automation workflow-engine yaml yaml-dsl

Last synced: 22 days ago
JSON representation

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

Awesome Lists containing this project

README

          


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.

```yaml
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](https://img.shields.io/badge/VS%20Code-Install-007ACC?style=for-the-badge&logo=visual-studio-code)](https://github.com/chelslava/autoflow-net/releases)

**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 |

```bash
# Download from releases and install
code --install-extension autoflow-1.1.0.vsix
```

See [vscode-autoflow/README.md](vscode-autoflow/README.md) for full documentation.

---

## 🚀 Quick Start

```bash
# 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](https://dotnet.microsoft.com/download)

### Browser Automation Setup

For browser automation workflows, install Playwright browsers:

```bash
# 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:**

```bash
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:**

```bash
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

```bash
# 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

```yaml
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

```yaml
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

```bash
# 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

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

Register and use:

```yaml
- 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](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

- **Issues**: [GitHub Issues](https://github.com/chelslava/autoflow-net/issues)
- **Discussions**: [GitHub Discussions](https://github.com/chelslava/autoflow-net/discussions)

---


Made with ❤️ for automation engineers


Get started in 30 seconds →