WorkflowForge 🔨
📊 Project Status

A robust and flexible library for creating GitHub Actions workflows, Azure DevOps pipelines, Jenkins pipelines, and AWS CodeBuild BuildSpecs programmatically in Python.
✨ Features
- Intuitive API: Fluent and easy-to-use syntax
- Type Validation: Built on Pydantic for automatic validation
- IDE Support: Full autocompletion with type hints
- Type Safety: Complete mypy compliance with strict type checking
- Multi-Platform: GitHub Actions, Azure DevOps, Jenkins, AWS CodeBuild
- Pipeline Visualization: Automatic diagram generation with Graphviz
- Secrets Support: Secure credential handling across all platforms
- Templates: Pre-built workflows for common use cases
- Validation: Schema validation and best practices checking
- Optional Security Scan: On-demand Checkov scan for generated workflows (GitHub Actions and Azure)
- Optional AI Documentation: AI-powered README generation with OllamaPipelines)
🚀 Installation
pip install workflowforge
📚 Examples
Check out the examples/ directory for complete working examples:
python examples/github_actions/basic_ci.py
python examples/jenkins/maven_build.py
python examples/codebuild/node_app.py
python examples/azure_devops/hello_world.py
python examples/azure_devops/python_ci.py
This will generate actual pipeline files and diagrams using the new import structure.
🤖 AI Documentation (Optional)
WorkflowForge can automatically generate comprehensive README documentation for your workflows using Ollama (free local AI):
curl -fsSL https://ollama.com/install.sh | sh
ollama serve
ollama pull llama3.2
workflow.save(".github/workflows/ci.yml", generate_readme=True, use_ai=True, generate_diagram=True)
readme = workflow.generate_readme(use_ai=True, ai_model="llama3.2")
print(readme)
Features:
- ✅ Completely free - no API keys or cloud services
- ✅ Works offline - local AI processing
- ✅ Optional - gracefully falls back to templates if Ollama not available
- ✅ Comprehensive - explains purpose, triggers, jobs, secrets, setup instructions
- ✅ All platforms - GitHub Actions, Azure DevOps, Jenkins, AWS CodeBuild
📊 Pipeline Visualization (Automatic)
WorkflowForge automatically generates visual diagrams of your pipelines using Graphviz:
brew install graphviz
sudo apt-get install graphviz
choco install graphviz
workflow.save(".github/workflows/ci.yml", generate_diagram=True)
diagram_path = workflow.generate_diagram("png")
print(f"📊 Diagram saved: {diagram_path}")
workflow.generate_diagram("svg")
workflow.generate_diagram("pdf")
Features:
- ✅ Automatic generation - every pipeline gets a visual diagram
- ✅ Multiple formats - PNG, SVG, PDF, DOT
- ✅ Smart fallback - DOT files if Graphviz not installed
- ✅ Platform-specific styling - Azure DevOps (blue), GitHub (purple), Jenkins (orange), CodeBuild (toasted AWS yellow)
- ✅ Comprehensive view - shows triggers, jobs, dependencies, step counts
📖 Basic Usage
GitHub Actions Usage
from workflowforge import github_actions
workflow = github_actions.workflow(
name="My Workflow",
on=github_actions.on_push(branches=["main"])
)
job = github_actions.job(runs_on="ubuntu-latest")
job.add_step(github_actions.action("actions/checkout@v4", name="Checkout"))
job.add_step(github_actions.run("echo 'Hello World!'", name="Say Hello"))
workflow.add_job("hello", job)
print(workflow.to_yaml())
workflow.save(".github/workflows/hello.yml", generate_readme=True, generate_diagram=True)
Jenkins Pipeline Usage
from workflowforge import jenkins_platform
pipeline = jenkins_platform.pipeline()
pipeline.set_agent(jenkins_platform.agent_docker("maven:3.9.3-eclipse-temurin-17"))
build_stage = jenkins_platform.stage("Build")
build_stage.add_step("mvn clean compile")
pipeline.add_stage(build_stage)
pipeline.save("Jenkinsfile", generate_diagram=True)
AWS CodeBuild BuildSpec Usage
from workflowforge import aws_codebuild
spec = aws_codebuild.buildspec()
env = aws_codebuild.environment()
env.add_variable("JAVA_HOME", "/usr/lib/jvm/java-17-openjdk")
spec.set_env(env)
build_phase = aws_codebuild.phase()
build_phase.add_command("mvn clean package")
spec.set_build_phase(build_phase)
artifacts_obj = aws_codebuild.artifacts(["target/*.jar"])
spec.set_artifacts(artifacts_obj)
spec.save("buildspec.yml", generate_readme=True, use_ai=True, generate_diagram=True)
Azure DevOps Usage
Generate a simple “hello” pipeline:
from workflowforge import azure_devops as ado
pipeline = ado.hello_world_template_azure(
name="Hello ADO",
message="Hello Azure DevOps from WorkflowForge!",
)
pipeline.save("azure-pipelines.yml")
Or generate a Python matrix CI with caching across Ubuntu/Windows/macOS:
from workflowforge import azure_devops as ado
pipeline = ado.python_ci_template_azure(
python_versions=["3.11", "3.12", "3.13"],
os_list=["ubuntu-latest", "windows-latest", "macOS-latest"],
use_cache=True,
)
pipeline.save("azure-pipelines.yml")
Optionally, scan the emitted YAML with Checkov (if installed):
from workflowforge import azure_devops as ado
pipeline = ado.python_ci_template_azure()
pipeline.save("azure-pipelines.yml", scan_with_checkov=True)
See also: examples/azure_devops/python_ci_scan.py.
AI Documentation Examples
workflow = Workflow(name="CI Pipeline", on=on_push())
job = Job(runs_on="ubuntu-latest")
job.add_step(action("actions/checkout@v4"))
workflow.add_job("test", job)
workflow.save("ci.yml", generate_readme=True, use_ai=True, generate_diagram=True)
pipeline = pipeline()
stage_build = stage("Build")
stage_build.add_step("mvn clean package")
pipeline.add_stage(stage_build)
pipeline.save("Jenkinsfile", generate_readme=True, use_ai=True, generate_diagram=True)
from workflowforge import OllamaClient
client = OllamaClient()
if client.is_available():
print("AI documentation available!")
else:
print("Using template documentation (Ollama not running)")
Modular Import Structure
WorkflowForge supports platform-specific imports with snake_case naming following Python conventions:
Platform Modules
from workflowforge import github_actions, jenkins_platform, aws_codebuild, azure_devops
from workflowforge import github_actions as gh
from workflowforge import jenkins_platform as jenkins
from workflowforge import aws_codebuild as cb
from workflowforge import azure_devops as ado
Benefits
✅ Platform separation - Clear namespace for each platform
✅ Snake case naming - Follows Python PEP 8 conventions
✅ IDE autocompletion - Better IntelliSense support
✅ Shorter code - gh.action() vs github_actions.action()
🔧 Advanced Examples
Build Matrix Workflow
from workflowforge import github_actions as gh
job = gh.job(
runs_on="ubuntu-latest",
strategy=gh.strategy(
matrix=gh.matrix(
python_version=["3.11", "3.12", "3.13"],
os=["ubuntu-latest", "windows-latest"]
)
)
)
Multiple Triggers
from workflowforge import github_actions as gh
workflow = gh.workflow(
name="CI/CD",
on=[
gh.on_push(branches=["main"]),
gh.on_pull_request(branches=["main"]),
gh.on_schedule("0 2 * * *")
]
)
Jobs with Dependencies
from workflowforge import github_actions as gh
test_job = gh.job(runs_on="ubuntu-latest")
deploy_job = gh.job(runs_on="ubuntu-latest")
deploy_job.needs = "test"
workflow = gh.workflow(name="CI/CD")
workflow.add_job("test", test_job)
workflow.add_job("deploy", deploy_job)
📚 Complete Documentation
Platform Support
GitHub Actions:
on_push(), on_pull_request(), on_schedule(), on_workflow_dispatch()
action(), run() steps
secret(), variable(), github_context() for credentials
- Build matrices, strategies, environments
- Optional Checkov scan:
workflow.save(path, scan_with_checkov=True)
Jenkins:
pipeline(), stage(), agent_docker(), agent_any()
jenkins_credential(), jenkins_env(), jenkins_param()
- Shared libraries, parameters, post actions
AWS CodeBuild:
buildspec(), phase(), environment(), artifacts()
codebuild_secret(), codebuild_parameter(), codebuild_env()
- Runtime versions, caching, reports
Azure DevOps:
pipeline(), job(), strategy(matrix=...), task(), script()
- Build matrices, multi-OS matrix, and pip caching
- Hello world template
- Optional Checkov scan:
pipeline.save(path, scan_with_checkov=True)
AI Documentation
- Ollama Integration: Local AI models (llama3.2, codellama, qwen2.5-coder)
- Automatic README: Explains workflow purpose, triggers, jobs, setup
- Fallback Support: Template-based documentation if AI unavailable
- All Platforms: Works with GitHub Actions, Azure DevOps, Jenkins, CodeBuild
Pipeline Visualization
- Graphviz Integration: Native diagram generation using DOT language
- Multiple Formats: PNG, SVG, PDF, DOT files
- Platform Styling: Color-coded diagrams (Azure DevOps: blue, GitHub: purple, Jenkins: orange, CodeBuild: toasted AWS yellow)
- Smart Fallback: DOT files if Graphviz not installed, images if available
- Comprehensive View: Shows triggers, jobs, dependencies, step counts, execution flow
🤝 Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests
- Submit a pull request
👨💻 Author & Maintainer
Brainy Nimbus, LLC - We love opensource! 💖
Website: brainynimbus.io
Email: info@brainynimbus.io
GitHub: @brainynimbus
📄 License
MIT License - see LICENSE for details.
🔗 Links
GitHub Actions:
Jenkins:
AWS CodeBuild:
Azure DevOps Pipelines: