A tool for building structured process definitions through interactive interviews. Generates both CSV output and LLM prompts for process documentation.
- Interactive process building with AI-powered suggestions
- AI suggestions for:
- Step titles and descriptions
- Step decisions and outcomes
- Success and failure paths
- Validation rules and error codes
- Concise step notes (10-20 words)
- Process validation and flow checking
- Multiple output formats:
- CSV files for process steps and notes
- Mermaid diagrams for visual representation
- LLM prompts for documentation
- Executive summaries
- Interactive menu system for:
- Viewing all steps with flow connections
- Editing existing steps
- Adding new steps
- Managing process flow
- Debug and verbose mode:
- Toggle detailed logging for troubleshooting
- View OpenAI API responses and request details
- Monitor API key validation and warnings
Process Builder includes a verbose mode for detailed logging and debugging:
# Enable verbose mode at the class level
from processbuilder import ProcessBuilder
ProcessBuilder.set_verbose_mode(True)
# Enable verbose mode for a specific instance
builder = ProcessBuilder("My Process", verbose=True)When verbose mode is enabled:
- Debug-level logs are displayed, showing detailed process information
- OpenAI API request and response details are logged
- Warning messages are always displayed regardless of verbose mode
- API key validation is logged and visible in the console
Example debug output with verbose mode enabled:
DEBUG - ProcessBuilder initialized with verbose=True
WARNING - No OpenAI API key found. AI features will be disabled.
DEBUG - Warning about missing API key has been logged
DEBUG - Sending OpenAI prompt for first step suggestion
DEBUG - Received OpenAI first step suggestion: 'Collect Customer Information'
pip install processbuilder-
Run the process builder:
# Basic usage processbuilder # Run with verbose mode enabled processbuilder --verbose
-
Enter the process name when prompted.
-
For each step, you'll be guided through:
- Step title (with AI suggestion for first step)
- Step description (with AI suggestion)
- Decision point (with AI suggestion)
- Success outcome (with AI suggestion)
- Failure outcome (with AI suggestion)
- Next steps for both paths (with AI suggestions)
- Optional note (with AI suggestion)
- Optional validation rules (with AI suggestion)
- Optional error codes (with AI suggestion)
-
After completing the process, you'll enter the interactive menu where you can:
- View all steps with their flow connections
- Edit any step's properties
- Add new steps
- Exit the process builder
When viewing steps, you'll see:
- Step title and description
- Decision and outcomes
- Predecessor steps (steps that lead to this step)
- Successor steps (next steps for both success and failure paths)
- Concise notes (10-20 words), validation rules, and error codes
- Clear visual separation between steps
Example step view:
Step 1: Verify Customer Information
Description: Check customer details against database
Decision: Is the customer information valid?
Success Outcome: Customer information is verified
Failure Outcome: Customer information is invalid
Predecessors: None (Start of process)
Successors:
- Process Payment (Success)
- Request Additional Information (Failure)
Note: Verify email and phone format
Validation Rules: Email format, phone number format
Error Codes: INVALID_EMAIL, INVALID_PHONE
--------------------------------------------------------------------------------
You can edit any step's properties:
- Title
- Description
- Decision
- Success Outcome
- Failure Outcome
- Note
- Validation Rules
- Error Codes
- Next Step (Success)
- Next Step (Failure)
The process flow is validated after each edit to ensure consistency.
-
Prepare your CSV files:
- One file for process steps
- Optional file for process notes
-
Run the process builder with CSV files:
# Basic import processbuilder --steps-csv path/to/steps.csv --notes-csv path/to/notes.csv # Import with verbose mode enabled processbuilder --steps-csv path/to/steps.csv --notes-csv path/to/notes.csv --verbose
-
The process will be loaded and you'll enter the interactive menu where you can:
- View all steps
- Edit steps as needed
- Add new steps
- Generate outputs
The process builder generates several output files in a structured directory format:
output/
└── process_name/
└── YYYYMMDD_HHMMSS/
├── process_name_process.csv
├── process_name_notes.csv
├── process_name_diagram.mmd
├── process_name_prompt.txt
└── process_name_executive_summary.md
The process steps CSV includes:
- Step ID
- Description
- Decision
- Success Outcome
- Failure Outcome
- Linked Note ID
- Next Step (Success)
- Next Step (Failure)
- Validation Rules
- Error Codes
- Retry Logic
The process builder enforces several validation rules:
- Step names must be unique
- Next step references must be valid
- Process must have at least one path to 'End'
- No circular references allowed
- All referenced steps must exist
Common error codes include:
- INVALID_INPUT
- VALIDATION_FAILED
- PROCESS_ERROR
- TIMEOUT
- RETRY_EXCEEDED
- Python 3.8+
- OpenAI API (for AI suggestions)
- python-dotenv (for environment variables)
- pandas (for CSV handling)
- mermaid-cli (for diagram generation)
- logging (for verbose mode and debug output)
MIT License