A simple readability oriented polling-based workflow engine with conditional triggers.
When an event gets triggered depending on the resources available it might take a while for the event to be processed.
cargo build --release
cd target/release
./workflow --help
./workflow start
./workflow add ./path/to/workflow.yaml
./workflow stop
Example workflow yaml file
name: check file exists
description: check if file exists
events:
- name: Event1
description: First event
trigger: ./ping.sh
tasks:
- name: foo
description: First task
path: ./tasks/create_foo.sh
on_failure: ./tasks/ls.sh
- path: ./tasks/create_bar.sh
on_failure: ./tasks/ls.sh
- path: ./tasks/free.shThe events will be polled regularly and the tasks will be added to redis queue when an event is successfully triggered.
std out and err logs will be created for task and event process, the logs will be stored in ./logs/ directory.
More examples can be found in tests/workflows/ directory.
.env file
echo "POSTGRES_PASSWORD=$(openssl rand -base64 32)" >> .env
echo DATABASE_URL=postgres://postgres:$POSTGRES_PASSWORD@172.17.0.3:5432/postgres >> .env
echo "REDIS_URL=redis://172.17.0.2/" >> .envStart the containers
chmod +x ./start_containers.sh
./start_containers.shStart the engine
cargo run -- --help
cargo run start
cargo run add tests/workflows/weather_checks/workflow.ymlecho "POSTGRES_PASSWORD=$(openssl rand -base64 32)" >> .envdocker
echo DATABASE_URL=postgres://postgres:$POSTGRES_PASSWORD@postgres:5432/postgres >> .envdocker
echo "REDIS_URL=redis://redis/" >> .envdocker
docker-compose up -dPostgres
docker exec -it workflow-postgres psql -U postgres -d postgres\dt # list tables
SELECT * FROM engines;Redis
docker exec -it workflow-redis redis-cliLRANGE tasks 0 -1
If you are looking for a powerful workflow platform, check out Windmill
