-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Yoni Amir edited this page Jun 3, 2025
·
4 revisions

Flow is a business logic framework that encourages the separation of business logic into Operations and Flows. Operations are responsible for performing individual tasks while Flows orchestrate operations together.
- Getting Started - Installation and basic setup instructions
- Flows - Orchestrate operations and manage business logic flow
- Operations - Individual business logic components with accessors
- States - Manage input, output, and derivative data with validations
- Errors - Exception handling, failures, and callback events
- Transactions - Wrap flows and operations in database transactions
- Statuses - Track and manage operation status codes
- Inheritance - Extend and customize flows and operations
- Testing - Comprehensive testing setup for flows, operations, and states
- Utilities - Callbacks, memoization, and logging utilities
- Contributing - Development guidelines and contribution process
🏗️ Structure - Separates business logic from controllers and models 🔄 Reusability - Operations can be shared across multiple flows 🧪 Testability - Each operation and flow can be tested in isolation 📊 Transparency - Clear visibility into business process execution ⚡ Performance - Built-in memoization and optimization features
# Define an operation
class CreateUser < FlowBase
state :name, :email
def execute
User.create!(name: name, email: email)
end
end
# Use in a flow
class UserRegistrationFlow < FlowBase
state :user_params
def execute
run CreateUser, user_params
run SendWelcomeEmail, email: state.user.email
end
end- Install - Add to your Gemfile and configure
- Learn Flows - Understand how to orchestrate business logic
- Create Operations - Build reusable business logic components
- Manage State - Handle data flow and validation
- Add Testing - Set up comprehensive test coverage
Ready to build better business logic? Start with the Getting Started guide!