Termiflow is a lightweight, graph-based CLI workflow orchestrator designed to automate complex tasks with a focus on visual clarity and dependency management. Inspired by enterprise tools like n8n, Termiflow brings a visual "canvas" experience directly to your terminal.
-
Dependency Mapping (DAGs): Unlike linear task runners, Termiflow uses a Directed Acyclic Graph (DAG) via NetworkX. This ensures that tasks only execute once their specific requirements are met (e.g., Node C waits for both Node A and Node B).
-
Rich Visuals: Leveraging the Rich library, Termiflow provides a beautiful, color-coded visualization of your workflow tree and a real-time execution status table.
-
Variable Injection: Support for dynamic data flow using Jinja2 templates. You can inject outputs from a previous HTTP request directly into a subsequent Shell command using {{ results.node_id.key }}.
-
Protocol Diversity: Native support for both local Shell commands and external HTTP requests (GET/POST).
-
State Persistence: Every run automatically exports its full execution state to workflow_output.json, allowing for post-execution analysis and debugging.
termiflow/
├── main.py # CLI Entry point
├── engine.py # Core Logic (NetworkX & Jinja2)
├── workflow.json # Sample workflow configuration
├── workflow_output.json # Generated state after execution
└── requirements.txt # Project dependencies
Clone the branch
git clone -b visualise https://github.com/BeeXD/Termiflow.git
cd sem-projInstall Dependencies
pip install -r requirements.txtRun a Workflow
python main.py run workflow.jsonInspect Node Data
python main.py inspect [Node_id]Build the Docker Image
docker build -t termiflow .Run a Workflow with Docker
# Using the included workflow.json
docker run --rm termiflow run workflow.json
# Using a custom workflow file
docker run --rm -v /path/to/your/workflow.json:/app/custom_workflow.json termiflow run custom_workflow.jsonView Help
docker run --rm termiflow --helpInspect Node Data
# Mount the output directory to persist workflow_output.json
docker run --rm -v $(pwd)/output:/app termiflow run workflow.json
docker run --rm -v $(pwd)/output:/app termiflow inspect [Node_id]{
"nodes": [
{
"id": "Get_Weather",
"type": "http",
"method": "GET",
"url": "https://api.open-meteo.com/v1/forecast?latitude=12.97&longitude=77.59¤t_weather=true"
},
{
"id": "Log_Weather",
"requires": ["Get_Weather"],
"type": "shell",
"command": "echo 'The temp in Bengaluru is {{ results.Get_Weather.current_weather.temperature }}°C'"
}
]
}
