| Crates.io | jorm |
| lib.rs | jorm |
| version | 0.1.1 |
| created_at | 2025-10-19 00:39:34.065383+00 |
| updated_at | 2025-11-05 14:45:15.141542+00 |
| description | A lightweight DAG execution engine with natural language processing |
| homepage | https://github.com/jorm-project/jorm |
| repository | https://github.com/jorm-project/jorm |
| max_upload_size | |
| id | 1889796 |
| size | 216,833 |
JORM is a lightweight, simple DAG (Directed Acyclic Graph) execution engine built in Rust. It focuses on core functionality with minimal dependencies, making it easy to use for workflow automation with powerful meta-capabilities.
cargo install jorm
Create a simple DAG file (workflow.txt):
# Simple workflow example
task hello_world {
type: shell
command: "echo 'Hello, World!'"
}
task copy_file {
type: file_copy
source: "input.txt"
destination: "output.txt"
depends_on: [hello_world]
}
task notify {
type: http
method: "POST"
url: "https://api.example.com/webhook"
body: '{"status": "completed"}'
depends_on: [copy_file]
}
Execute the DAG:
jorm execute --file workflow.txt
jorm generate --description "Copy file1.txt to backup folder, then run tests and send notification"
use jorm::core::JormEngine;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let engine = JormEngine::new();
// Execute from file
let result = engine.execute_from_file("workflow.txt").await?;
println!("Execution completed: {:?}", result);
// Generate from natural language
let dag_content = engine.generate_dag_from_nl("Build project and run tests").await?;
println!("Generated DAG:\n{}", dag_content);
Ok(())
}
JORM supports 7 different task types for comprehensive workflow automation:
task build {
type: shell
command: "cargo build --release"
working_dir: "./my-project"
}
task analyze {
type: python
script: "analyze_data.py"
args: ["--input", "data.csv"]
working_dir: "./scripts"
}
task test {
type: rust
command: "cargo test"
working_dir: "./my-project"
}
task api_call {
type: http
method: "POST"
url: "https://api.example.com/webhook"
headers: {
"Content-Type": "application/json"
}
body: '{"status": "completed"}'
}
task copy_backup {
type: file_copy
source: "./important-data"
destination: "./backup/important-data"
}
task move_file {
type: file_move
source: "./temp/file.txt"
destination: "./processed/file.txt"
}
task cleanup {
type: file_delete
path: "./temp/old-file.txt"
}
task create_workflow {
type: jorm
command: "generate"
args: ["--description", "copy files and run tests"]
}
task run_existing_dag {
type: jorm
command: "execute"
args: ["--file", "other_workflow.txt"]
depends_on: [create_workflow]
}
task validate_dag {
type: jorm
command: "validate"
args: ["--file", "workflow.txt"]
}
task start_server {
type: jorm
command: "server"
args: ["--port", "8080"]
}
Generate DAGs from natural language descriptions:
# Generate a DAG from description
jorm generate --description "Copy config files, build the project, run tests, and deploy to staging"
# Preview generated DAG before execution
jorm generate --preview --description "Download data, process with Python script, and send results via email"
# Execute directly from natural language
jorm generate --description "Clean up old logs and restart the service"
JORM can recursively call itself using the jorm task type, enabling powerful meta-workflows:
# Meta-workflow that creates and executes other workflows
task generate_build_workflow {
type: jorm
command: "generate"
args: ["--description", "build project and run tests"]
}
task execute_generated_workflow {
type: jorm
command: "execute"
args: ["--file", "generated_workflow.txt"]
depends_on: [generate_build_workflow]
}
task validate_all_workflows {
type: jorm
command: "validate"
args: ["--file", "*.txt"]
depends_on: [execute_generated_workflow]
}
This enables workflows that can:
# Automated workflow management system
task generate_daily_reports {
type: jorm
command: "generate"
args: ["--description", "download sales data, process with Python, generate PDF report"]
}
task execute_daily_reports {
type: jorm
command: "execute"
args: ["--file", "daily_reports.txt"]
depends_on: [generate_daily_reports]
}
task validate_all_workflows {
type: jorm
command: "validate"
args: ["--file", "*.txt"]
depends_on: [execute_daily_reports]
}
task start_monitoring_server {
type: jorm
command: "server"
args: ["--port", "9090"]
depends_on: [validate_all_workflows]
}
Start the HTTP server for webhook triggers:
# Start server on default port (8080)
jorm server
# Start server on custom port
jorm server --port 3000
API endpoints:
# Execute DAG from file
curl -X POST http://localhost:8080/execute \
-H "Content-Type: application/json" \
-d '{"dag_file": "workflow.txt"}'
# Execute from natural language
curl -X POST http://localhost:8080/execute/nl \
-H "Content-Type: application/json" \
-d '{"description": "Build project and run tests"}'
# Check execution status
curl http://localhost:8080/status/execution_id
Schedule DAGs to run automatically using cron expressions:
# Schedule a DAG to run every day at 2 AM
jorm schedule workflow.txt "0 2 * * *"
# Start the scheduler daemon
jorm daemon start
# Stop the scheduler daemon
jorm daemon stop
# Check daemon status
jorm daemon status
JORM uses a simple text-based format for defining workflows:
# Comments start with #
task task_name {
type: shell
command: "echo hello"
working_dir: "/tmp" # optional
}
task http_request {
type: http
method: "POST"
url: "https://api.example.com/webhook"
headers: {
"Content-Type": "application/json"
}
body: '{"status": "completed"}'
depends_on: [task_name]
}
task python_script {
type: python
script: "process_data.py"
args: ["--input", "data.csv"]
working_dir: "./scripts"
depends_on: [http_request]
}
Tasks can depend on other tasks using the depends_on field:
task final_task {
type: shell
command: "echo 'All done!'"
depends_on: [task1, task2, task3]
}
jorm execute --file <dag_file> - Execute a DAG from filejorm generate --description <description> - Generate and execute DAG from natural languagejorm generate --preview --description <description> - Preview generated DAG without executionjorm validate --file <dag_file> - Validate DAG syntaxjorm server [--port <port>] - Start HTTP server for webhooksjorm schedule <dag_file> <cron_expr> - Schedule DAG executionjorm daemon <start|stop|status> - Manage scheduler daemontask build {
type: rust
command: "cargo build --release"
working_dir: "./my-project"
}
task test {
type: rust
command: "cargo test"
working_dir: "./my-project"
depends_on: [build]
}
task notify_success {
type: http
method: "POST"
url: "https://hooks.slack.com/webhook"
body: '{"text": "Build and tests completed successfully!"}'
depends_on: [test]
}
task download_data {
type: shell
command: "wget https://example.com/data.csv -O data.csv"
}
task process_data {
type: python
script: "process.py"
args: ["data.csv", "processed_data.json"]
depends_on: [download_data]
}
task backup_results {
type: file_copy
source: "processed_data.json"
destination: "./backup/processed_data.json"
depends_on: [process_data]
}
task cleanup {
type: file_delete
path: "data.csv"
depends_on: [backup_results]
}
# Workflow that creates and manages other workflows
task create_test_suite {
type: jorm
command: "generate"
args: ["--description", "run unit tests, integration tests, and generate coverage report"]
}
task execute_test_suite {
type: jorm
command: "execute"
args: ["--file", "test_suite.txt"]
depends_on: [create_test_suite]
}
task create_deployment_pipeline {
type: jorm
command: "generate"
args: ["--description", "build Docker image, push to registry, deploy to staging"]
depends_on: [execute_test_suite]
}
task execute_deployment {
type: jorm
command: "execute"
args: ["--file", "deployment_pipeline.txt"]
depends_on: [create_deployment_pipeline]
}
task validate_all_pipelines {
type: jorm
command: "validate"
args: ["--file", "*.txt"]
depends_on: [execute_deployment]
}
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
| Type | Purpose | Example Use Case |
|---|---|---|
shell |
Execute shell commands | Build scripts, system commands |
python |
Run Python scripts | Data processing, ML workflows |
rust |
Execute Rust/Cargo commands | Build, test, run Rust projects |
http |
Make HTTP requests | API calls, webhooks, notifications |
file_copy |
Copy files/directories | Backup, deployment preparation |
file_move |
Move files/directories | File organization, cleanup |
file_delete |
Delete files/directories | Cleanup, temporary file removal |
jorm |
Execute JORM commands | Meta-workflows, recursive execution |
"copy config files and run tests" → File copy + Rust test tasks"10 bash tasks that print numbers" → 10 sequential shell tasks"build project, run tests, deploy" → Multi-step CI/CD pipeline"create new dag and execute it" → Meta-workflow with jorm tasks