Hooks and ETL workflows
Hooks let you integrate external scripts into the bino pipeline. This guide covers common patterns for data preparation, validation, and post-build automation. For CI/CD integration examples, see Recipe: CI/CD pipeline.
ETL before build
Section titled “ETL before build”Use pre-datasource to fetch or transform data before bino loads it:
The CSV is ready before bino’s DuckDB engine loads it.
Run once on preview start
Section titled “Run once on preview start”Use pre-preview to prepare data once when the preview server starts, rather than on every refresh:
This is useful for slow operations like database snapshots or large API calls that don’t need to re-run on every file change.
Conditional skip with exit 78
Section titled “Conditional skip with exit 78”Scripts can check conditions and skip with exit code 78:
Bino logs “skipped (exit 78)” and continues normally.
Post-build upload
Section titled “Post-build upload”Use post-build to upload generated PDFs after a successful build:
Post-render per artefact
Section titled “Post-render per artefact”Use post-render to process each PDF individually after it’s generated:
Validate data before rendering
Section titled “Validate data before rendering”Use pre-datasource to check data quality before bino processes it:
Environment introspection
Section titled “Environment introspection”Scripts can read BINO_* variables to adjust behaviour:
Validate environment before build
Section titled “Validate environment before build”Use pre-build to ensure required tools and credentials are available:
Sequential commands
Section titled “Sequential commands”Each checkpoint accepts an array of commands that run in order. If any command fails, subsequent commands are skipped:
Windows compatibility
Section titled “Windows compatibility”On Windows, hooks run via cmd /C. Write platform-appropriate scripts or use cross-platform tools like Python:
Python scripts work identically on all platforms. For platform-specific shell scripts, use conditional logic based on the OS.