Skip to content

A complete multi-tenant SaaS system for building and executing automated workflows with AI integration, similar to Zapier, Make, Kissflow, and Pipefy.

License

Notifications You must be signed in to change notification settings

ahmedsaadawi13/splash-ai-flow

Repository files navigation

SplashAIFlow

AI-Powered Workflow Automation SaaS Platform

A complete multi-tenant SaaS system for building and executing automated workflows with AI integration, similar to Zapier, Make, Kissflow, and Pipefy.

Features

Core Features

  • Multi-Tenant Architecture - Isolated data per tenant with subscription management
  • Workflow Builder - Visual workflow creation with multiple step types
  • AI Integration - OpenAI and local LLM support for intelligent automation
  • Webhook Triggers - Unique webhook endpoints per workflow
  • Schedule Triggers - Cron-like scheduling (hourly, daily, weekly, monthly)
  • Approval System - Manual approval steps in workflows
  • Integrations - Pre-built connectors (Slack, Gmail, WhatsApp, Google Sheets, REST API)
  • Public API - RESTful API with authentication
  • Real-time Execution - Background workflow processing
  • Usage Tracking - Monitor API calls, flow runs, AI tokens, storage
  • Subscription Plans - Free, Starter, Professional, Enterprise tiers

Workflow Step Types

  1. Database Write - Insert/update records
  2. Send Email - Email notifications
  3. HTTP Request - Call external APIs
  4. Webhook Call - Send data to external webhooks
  5. Condition (IF) - Conditional branching
  6. Branching - True/false path routing
  7. Delay - Wait for specified time
  8. Approval - Manual approval gates
  9. AI Steps - Summarize, classify, extract entities, generate text
  10. RPA Steps - Simulated browser automation
  11. Integration API - Use pre-configured integrations

Technology Stack

  • Backend: PHP 7.0+ (no frameworks, custom MVC)
  • Database: MySQL 5.7+ / MariaDB 10.2+
  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • AI: OpenAI API or Local LLM (Ollama compatible)
  • Security: Password hashing, CSRF protection, rate limiting, API keys

Requirements

  • PHP 7.0 or higher
  • MySQL 5.7+ or MariaDB 10.2+
  • Apache or Nginx web server
  • Composer (optional, not required)
  • OpenAI API key (optional, for AI features)

PHP Extensions

  • PDO and pdo_mysql
  • cURL
  • OpenSSL
  • JSON
  • mbstring

Installation

1. Clone Repository

git clone https://github.com/ahmedsaadawi13/SplashAIFlow.git cd SplashAIFlow

2. Configure Environment

cp .env.example .env

Edit .env and configure:

  • Database credentials
  • AI provider settings (OpenAI or local LLM)
  • App URL and timezone

3. Create Database

mysql -u root -p CREATE DATABASE splashaiflow CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; exit;

Import the schema:

mysql -u root -p splashaiflow < database.sql

4. Set Permissions

chmod -R 755 storage/ chmod -R 755 storage/logs/ chmod -R 755 storage/uploads/

5. Configure Web Server

Apache

Create a virtual host:

<VirtualHost *:80> ServerName splashaiflow.local DocumentRoot /path/to/SplashAIFlow/public <Directory /path/to/SplashAIFlow/public> AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/splashaiflow_error.log CustomLog ${APACHE_LOG_DIR}/splashaiflow_access.log combined </VirtualHost>

Enable mod_rewrite:

sudo a2enmod rewrite sudo systemctl restart apache2

Nginx

server { listen 80; server_name splashaiflow.local; root /path/to/SplashAIFlow/public; index index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

6. Setup Cron for Scheduled Workflows

Add to crontab:

* * * * * cd /path/to/SplashAIFlow && php -r "require 'app/helpers/WorkflowScheduler.php'; WorkflowScheduler::run();" >> /dev/null 2>&1

Default Credentials

After installation, login with:

Important: Change this password immediately in production!

Usage

Creating a Workflow

  1. Login to the dashboard
  2. Navigate to Workflows
  3. Click Create Workflow
  4. Add steps using the workflow builder
  5. Configure triggers (webhook, schedule, or event)
  6. Activate the workflow

Using Webhooks

Each workflow with a webhook trigger gets a unique URL:

POST https://your-domain.com/webhook/{tenant_key}/{workflow_key}/{secret} 

Send JSON payload to trigger the workflow:

curl -X POST https://your-domain.com/webhook/acmecorp/process_order/abc123... \ -H "Content-Type: application/json" \ -d '{"order_id": 12345, "customer": "John Doe"}'

Using the API

1. Generate API Key

Login → Settings → API Keys → Generate New Key

2. Make API Requests

List workflows:

curl -X GET https://your-domain.com/api/workflows \ -H "X-API-KEY: your_api_key_here"

Run workflow:

curl -X POST https://your-domain.com/api/workflows/workflow_key/run \ -H "X-API-KEY: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{"payload": {"key": "value"}}'

Get flow run details:

curl -X GET https://your-domain.com/api/flow-runs/123 \ -H "X-API-KEY: your_api_key_here"

AI Features

Configure AI provider in .env:

OpenAI:

AI_PROVIDER=openai AI_API_KEY=sk-... AI_MODEL=gpt-3.5-turbo

Local LLM (Ollama):

AI_PROVIDER=local AI_LOCAL_ENDPOINT=http://localhost:11434/api/generate AI_LOCAL_MODEL=llama2

Use AI steps in workflows to:

  • Summarize text
  • Classify content
  • Extract entities
  • Generate responses
  • Interpret data

Integrations

Connect integrations:

  1. Navigate to Integrations
  2. Select integration (Slack, Gmail, etc.)
  3. Provide authentication details
  4. Use in workflow steps

API Endpoints

Public API

Method Endpoint Description
GET /api/workflows List all workflows
GET /api/workflows/{key}/schema Get workflow schema
POST /api/workflows/{key}/run Run workflow
GET /api/flow-runs List flow runs
GET /api/flow-runs/{id} Get flow run details

Webhook Endpoint

Method Endpoint Description
POST/GET /webhook/{tenant}/{workflow}/{secret} Trigger workflow

Security Features

  • Password hashing with bcrypt
  • CSRF token protection
  • SQL injection prevention (prepared statements)
  • XSS protection (output escaping)
  • Rate limiting (login, API, webhooks)
  • API key authentication
  • Webhook secret validation
  • File upload validation
  • Account lockout after failed attempts
  • Audit logging

Subscription Plans

Plan Price Workflows Tasks/Month AI Tokens Features
Free $0 3 100 10K Basic triggers
Starter $29 10 1K 100K Webhooks, AI
Professional $99 50 10K 500K RPA, Advanced
Enterprise $299 999 100K 2M Everything

Directory Structure

SplashAIFlow/ ├── app/ │ ├── controllers/ # Application controllers │ ├── models/ # Database models │ ├── views/ # HTML views │ ├── core/ # Core MVC classes │ └── helpers/ # Helper classes (AI, Security, etc.) ├── config/ # Configuration files ├── public/ # Public web root │ ├── assets/ # CSS, JS, images │ └── index.php # Application entry point ├── storage/ # Logs and uploads │ ├── logs/ │ └── uploads/ ├── tests/ # Unit tests ├── database.sql # Database schema ├── .env.example # Environment template └── README.md 

Development

Adding a New Step Type

  1. Add step type to WorkflowEngine::executeStepAction()
  2. Create execution method (e.g., executeCustomStep())
  3. Add UI option in workflow builder
  4. Update documentation

Adding an Integration

  1. Insert into integrations table
  2. Create integration handler in WorkflowEngine::executeIntegration()
  3. Add authentication UI
  4. Document API requirements

Troubleshooting

Workflows not executing

  • Check cron job is running
  • Verify database connection
  • Check workflow is active
  • Review error logs in storage/logs/

AI steps failing

  • Verify API key in .env
  • Check AI provider is accessible
  • Review token quotas
  • Check error logs

Webhooks not working

  • Verify secret is correct
  • Check rate limiting
  • Ensure workflow is active
  • Review webhook logs

Performance Optimization

  • Enable PHP OPcache
  • Use MySQL query caching
  • Implement Redis for sessions
  • Add CDN for static assets
  • Enable gzip compression
  • Optimize database indexes

Security Best Practices

  • Use HTTPS in production
  • Change default admin password
  • Rotate API keys regularly
  • Enable rate limiting
  • Keep PHP and MySQL updated
  • Use strong passwords
  • Regular security audits

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is open-source and available under the MIT License.

Support

For issues and questions:

Roadmap

  • Visual workflow builder UI
  • More integrations (Salesforce, HubSpot, etc.)
  • Workflow templates library
  • Real-time execution monitoring
  • Advanced analytics and reporting
  • Multi-language support
  • Mobile app
  • Workflow versioning
  • A/B testing for workflows
  • Custom code steps (JavaScript sandbox)

Acknowledgments

Built with inspiration from:

  • Zapier
  • Make (Integromat)
  • Kissflow
  • Pipefy
  • n8n

SplashAIFlow - Automate smarter, not harder.

About

A complete multi-tenant SaaS system for building and executing automated workflows with AI integration, similar to Zapier, Make, Kissflow, and Pipefy.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •