Pipeline Examples
This directory contains real-world examples demonstrating constellation-lang patterns and best practices.
Examples by Category
Text Processing
- Text Cleaning Pipeline - Normalize and clean user input
- Content Analysis Pipeline - Analyze text for metrics and keywords
Data Processing
- Data Statistics Pipeline - Calculate summary statistics on numeric data
- List Processing Pipeline - Filter and transform lists with lambdas
ML Pipelines
- Batch Data Enrichment - Enrich Candidates with context data
- Scoring Pipeline - Multi-factor scoring with conditional logic
Running Examples
Quick Start
The easiest way to run these examples is with the VSCode extension. Copy the code, paste into a .cst file, and press Ctrl+Shift+R.
In VSCode
- Copy the code block to a
.cstfile - Press
Ctrl+Shift+Rto run - Enter inputs when prompted
Via HTTP API
curl -X POST http://localhost:8080/run \
-H "Content-Type: application/json" \
-d '{
"source": "<paste source code here>",
"inputs": { ... }
}'
Prerequisites
Server Required
Both the VSCode extension and HTTP API methods require a running Constellation server.
Make sure the server is running:
make server
Example Complexity Guide
| Example | Difficulty | Concepts Covered |
|---|---|---|
| Text Cleaning | Beginner | Basic functions, chaining |
| Data Statistics | Beginner | List functions, multiple outputs |
| Content Analysis | Intermediate | Record types, field access |
| List Processing | Intermediate | Higher-order functions, lambdas |
| Batch Enrichment | Intermediate | Candidates, merge, projection |
| Scoring Pipeline | Advanced | Conditionals, type algebra, custom types |
Learning Path
Start with the Beginner examples (Text Cleaning, Data Statistics) to understand the basics, then progress to Intermediate patterns (List Processing, Batch Enrichment) before tackling the Advanced Scoring Pipeline.
Next Steps
After working through these examples:
- Check the Standard Library Reference for all available functions
- Read the constellation-lang Reference for complete syntax
- Build your own custom modules following the Getting Started Guide