Cookbook
Practical recipes for common pipeline patterns. Each page includes a runnable .cst pipeline, an explanation of how it works, sample input/output, and variations.
Start Here
New to Constellation? Work through the recipes in order. Each builds on concepts from the previous ones.
Getting Started
Simple pipelines that introduce core concepts.
| Recipe | Concepts |
|---|---|
| Hello World | Inputs, module calls, outputs |
| Record Types | Type definitions, field access |
| Type Algebra | Record merge (+), projection ([]) |
| Candidates Batch | Candidates<T>, batch merge and projection |
| Simple Transform | Single module transformation |
Language Patterns
Recipes that demonstrate constellation-lang features.
| Recipe | Concepts |
|---|---|
| Text Analysis | Multi-step pipelines, multiple outputs |
| String Interpolation | ${expression} syntax, escape sequences |
| Namespaces | use imports, aliasing, fully qualified calls |
| Lambdas and HOF | filter, map, all, any with lambda syntax |
| Branch Expressions | Multi-way conditionals with branch {} |
| Guard and Coalesce | when guards, ?? operator, fallback chains |
| Optional Types | Optional<T> inputs, coalesce patterns |
| Union Types | A | B type declarations |
Data Processing
Real-world data transformation and analysis patterns.
| Recipe | Concepts |
|---|---|
| Data Pipeline | Filter, transform, aggregate, format |
| Lead Scoring | Record types, arithmetic, conditionals, guards |
| Fan-Out / Fan-In | Parallel service calls, merge, project |
| Conditional Branching | Route execution with when, ??, branch |
Running the Examples
All recipes include sample input and expected output. Start the server with make server, then use the dashboard at http://localhost:8080/dashboard to run them interactively.
Resilience
Patterns for building reliable pipelines that handle failures.
| Recipe | Concepts |
|---|---|
| Retry and Fallback | retry, delay, backoff, fallback |
| Caching | cache TTL, cache_backend |
| Error Handling | on_error: skip | log | fail |
| Rate Limiting | throttle, concurrency |
| Priority and Lazy | priority levels, lazy evaluation |
| Resilient Pipeline | All options combined in a realistic scenario |
| Caching Strategies | Short TTL, long TTL, distributed backends |
Debugging
Tools and techniques for troubleshooting pipelines.
| Recipe | Concepts |
|---|---|
| Debugging | Dashboard, step-through, tracing, error messages, performance |