Volnux Quick Start: 2 minutes - nshaibu/volnux GitHub Wiki
1. Define your "Verbs" (The Events)
Create your business logic in isolated classes. Volnux will automatically discover these when the pipeline starts.
from volnux import Event
class FetchUser(Event):
def process(self, user_id: int, **kwargs):
# user_id is automatically injected from the Pipeline field
return True, {"name": "Nafiu", "role": "Architect"}
class ProcessProfile(Event):
def process(self, *args, **kwargs):
# 'previous_result' comes from the Pipe (|->) operator
result = self.previous_result.first()
profile = result.content
profile['status'] = 'Active'
return True, profile
2. Define your "Sentence" (The Pipeline)
Create a class that inherits from Pipeline. This acts as the "Contract" and "Blueprint" for your workflow.
from volnux import Pipeline
from volnux.fields import InputDataField
class UserOnboarding(Pipeline):
# 1. Define validated input fields
user_id = InputDataField(data_type=int, required=True)
# 2. Define the flow logic (Pointy-Lang)
class Meta:
pointy = "FetchUser |-> ProcessProfile -> SaveToDB"
3. Launch with One Command
Instantiate your pipeline with the required data and call start(). Volnux handles the rest: it parses the Pointy string, discovers the Event classes, and executes them across the mesh.
# The 'user_id' is validated against the InputDataField definition
onboarding = UserOnboarding(user_id=50021)
# Start the distributed execution
onboarding.start()
Why this beats Temporal and Airflow:
- Auto-Discovery: You don't need to manually register every event or "activity." If the class exists in your project and the name matches your
.ptyfile, Volnux finds it. - Convention Over Configuration: By default, if you have a file named
UserOnboarding.ptyin the same directory, Volnux loads it automatically. No extra code required. - Zero-Boilerplate Data Flow: Notice how
user_idis passed intoFetchUser.processwithout you ever writing akwargs['user_id']extraction. The Context Spine maps pipeline fields to event arguments by name. - Type Safety at the Edge: If you try to start the pipeline with
user_id="abc", Volnux throws aTypeErrorimmediately, preventing invalid data from ever entering your distributed cluster.