Skip to content

Kshitiz1403/serverless-workflow-builder

Repository files navigation

Serverless Workflow Builder

A visual drag-and-drop editor for creating and managing Serverless Workflows with an intuitive React-based interface.

GitHub Pages React React Flow License

๐Ÿš€ Live Demo

Try the editor live at: https://kshitiz1403.github.io/serverless-workflow-builder

โœจ Features

๐ŸŽจ Visual Workflow Design

  • Drag & Drop Interface: Intuitive node-based workflow creation
  • Real-time Visual Feedback: See your workflow structure as you build
  • Smart Connection System: Easy linking between workflow states
  • Auto-layout: Intelligent node positioning for imported workflows

๐Ÿ”ง Comprehensive Node Support

  • Start Node: Workflow entry points
  • Operation Node: Function calls and actions
  • Switch Node: Conditional branching with data/event conditions
  • Event Node: Event-driven state transitions
  • End Node: Workflow termination points

๐Ÿ“Š Advanced Switch Conditions

  • Data Conditions: Expression-based branching (.data == true)
  • Event Conditions: Event-driven decision making
  • Visual Condition Labels: Clear condition identification on connections
  • Default Fallback: Support for default transition paths

๐Ÿ’พ Import/Export Capabilities

  • JSON Import: Load existing serverless workflow definitions
  • JSON Export: Generate compliant serverless workflow JSON
  • Example Workflows: Pre-built templates to get started
  • File Upload: Direct .json file import support

๐Ÿ”„ Workflow Management

  • Auto-save: Automatic local storage backup
  • New Workflow: Quick workflow reset with confirmation
  • Live Editing: Real-time property updates
  • Undo/Redo: Undo/Redo the last applied actions

๐ŸŽฏ Standards Compliance

  • Serverless Workflow Spec: Full compliance with v0.9.x specification
  • Action Support: Function references, expressions, and configurations
  • Event Integration: Complete event state and condition support
  • Metadata Preservation: Maintains workflow metadata on import/export

๐Ÿ› ๏ธ Technology Stack

  • Frontend: React 18.2.0
  • Flow Library: React Flow 11.x
  • Icons: Lucide React
  • Styling: Pure CSS with modern design
  • Build Tool: Create React App
  • Deployment: GitHub Pages

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js 16+ (recommended: Node.js 18)
  • npm or yarn package manager

Local Development

  1. Clone the repository

    git clone https://github.com/kshitiz1403/serverless-workflow-builder.git
    cd serverless-workflow-builder
  2. Install dependencies

    npm install
  3. Start development server

    npm start
  4. Open in browser Navigate to http://localhost:3000

Production Build

npm run build

The build artifacts will be stored in the build/ directory.

๐ŸŽฎ Usage Guide

Creating a New Workflow

  1. Add Nodes: Drag node types from the left palette onto the canvas
  2. Connect Nodes: Click and drag from output handles to input handles
  3. Configure Properties: Select nodes to edit their properties in the sidebar
  4. Set Conditions: For switch nodes, configure data or event conditions
  5. Export: Use the "Export JSON" button to generate workflow definition

Importing Existing Workflows

  1. Click "Import JSON" in the sidebar
  2. Choose Method:
    • Paste JSON directly into the text area
    • Upload a .json file
    • Load example workflows
  3. Click "Import Workflow" to visualize

Node Types & Configuration

Start Node

  • Entry point for workflow execution
  • Configure workflow metadata

Operation Node

  • Define function calls and actions
  • Set function references and parameters
  • Configure retry policies and timeouts

Switch Node

  • Data Conditions: Use expressions like .data == true
  • Event Conditions: Reference specific events
  • Default Path: Fallback transition option
  • Multiple output connections for each condition

Event Node

  • Configure event references and timeouts
  • Set up event-driven state transitions
  • Handle event correlation and data filtering

End Node

  • Terminate workflow execution
  • Define completion status and outputs

โš™๏ธ Configuration

API Settings

The application includes a configuration interface for connecting to external operations APIs:

  1. Access Settings: Click the Settings button in the sidebar footer
  2. Configure API URL: Set the base URL for your operations API (default: http://localhost:3001)
  3. Test Connection: Use the "Test Connection" button to verify API connectivity
  4. Advanced Options: Configure request timeout and retry attempts
  5. Auto-save: All settings are automatically saved to browser localStorage

Key Configuration Options:

  • Base URL: The operations API endpoint
  • Request Timeout: How long to wait for API responses (default: 30 seconds)
  • Retry Attempts: Number of retry attempts for failed requests (default: 3)
  • Connection Status: Real-time API connectivity indicator

The settings modal provides a health check feature that tests your API connection and displays the number of available operations.

๐Ÿ—๏ธ Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ nodes/              # Node type definitions
โ”‚   โ”‚   โ”œโ”€โ”€ StartNode.js
โ”‚   โ”‚   โ”œโ”€โ”€ OperationNode.js
โ”‚   โ”‚   โ”œโ”€โ”€ SwitchNode.js
โ”‚   โ”‚   โ”œโ”€โ”€ EventNode.js
โ”‚   โ”‚   โ””โ”€โ”€ EndNode.js
โ”‚   โ”œโ”€โ”€ WorkflowEditor.js   # Main canvas component
โ”‚   โ”œโ”€โ”€ Sidebar.js          # Node palette & properties
โ”‚   โ”œโ”€โ”€ NodePropertiesEditor.js
โ”‚   โ”œโ”€โ”€ JsonImporter.js     # Import functionality
โ”‚   โ””โ”€โ”€ JsonExporter.js     # Export functionality
โ”œโ”€โ”€ styles/                 # CSS files
โ””โ”€โ”€ example_workflows/      # Sample workflow definitions

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes and test thoroughly
  4. Commit: git commit -m "Add feature description"
  5. Push: git push origin feature-name
  6. Create a Pull Request

Areas for Contribution

  • New Node Types: Implement additional serverless workflow states
  • UI/UX Improvements: Enhance the visual design and user experience
  • Export Formats: Add support for other workflow formats
  • Validation: Implement workflow validation and error checking
  • Testing: Add unit and integration tests
  • Documentation: Improve guides and examples

๐Ÿ“‹ Roadmap

  • Workflow Validation: Real-time error checking and validation
  • Undo/Redo System: Full action history management
  • Collaborative Editing: Multi-user workflow editing
  • Cloud Storage: Save workflows to cloud providers
  • Template Library: Expanded collection of workflow templates
  • Advanced Debugging: Workflow execution simulation
  • Export Formats: Support for additional workflow standards
  • Duplicate a project

๐Ÿ› Known Issues

  • Large workflows may experience performance degradation
  • Mobile responsiveness needs improvement
  • Undo/redo functionality not yet implemented

๐Ÿ“„ License

This project is licensed under the ISC License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support


Built with โค๏ธ for the Serverless Community

About

A visual drag-and-drop editor for creating and managing Serverless Workflows with React and React Flow

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published