Skip to main content

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.

RecipeConcepts
Hello WorldInputs, module calls, outputs
Record TypesType definitions, field access
Type AlgebraRecord merge (+), projection ([])
Candidates BatchCandidates<T>, batch merge and projection
Simple TransformSingle module transformation

Language Patterns

Recipes that demonstrate constellation-lang features.

RecipeConcepts
Text AnalysisMulti-step pipelines, multiple outputs
String Interpolation${expression} syntax, escape sequences
Namespacesuse imports, aliasing, fully qualified calls
Lambdas and HOFfilter, map, all, any with lambda syntax
Branch ExpressionsMulti-way conditionals with branch {}
Guard and Coalescewhen guards, ?? operator, fallback chains
Optional TypesOptional<T> inputs, coalesce patterns
Union TypesA | B type declarations

Data Processing

Real-world data transformation and analysis patterns.

RecipeConcepts
Data PipelineFilter, transform, aggregate, format
Lead ScoringRecord types, arithmetic, conditionals, guards
Fan-Out / Fan-InParallel service calls, merge, project
Conditional BranchingRoute 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.

RecipeConcepts
Retry and Fallbackretry, delay, backoff, fallback
Cachingcache TTL, cache_backend
Error Handlingon_error: skip | log | fail
Rate Limitingthrottle, concurrency
Priority and Lazypriority levels, lazy evaluation
Resilient PipelineAll options combined in a realistic scenario
Caching StrategiesShort TTL, long TTL, distributed backends

Debugging

Tools and techniques for troubleshooting pipelines.

RecipeConcepts
DebuggingDashboard, step-through, tracing, error messages, performance