Parameterization is a foundational capability in the Syntasa platform that transforms a static Jupyter Notebook into a dynamic, reusable, and production-ready process. By defining and injecting parameters at runtime, a single notebook can be executed across multiple dates, datasets, environments, or business scenarios—without modifying the underlying source code.
This article provides a comprehensive technical reference for implementing, configuring, and validating parameters in the Notebook Process, with a focus on correctness, maintainability, and production best practices.
The Foundation: The parameters Cell Tag
Syntasa uses the industry-standard Papermill approach for parameter injection. To enable parameterization, explicitly tag a cell (recommended first cell) as a parameters
How to Tag a Cell in JupyterLab
- Open the notebook in a Notebook Workspace.
- Select the cell that contains variable definitions, for example:
database= "xyz" process_date = "1970-01-01" is_production = false
- In the right-hand sidebar of JupyterLab, open the Property Inspector.
- Expand the Cell Tags section.
- Enter
parameters(all lowercase) and click Add. - Save the notebook.
Technical Notes
- The Notebook Process scans for the first cell tagged as
parameters. - Value can be defined to the variables in this cell.
- These values may be overridden at runtime by values configured in App workflow.
Important: The tag must be exactly
parameters(case-sensitive). Any variation will prevent detection.
Synchronizing Parameters with App workflow
After tagging and saving the notebook, App workflow must be updated to recognize the new or modified parameters.
Synchronization Steps
- Open App workflow and select the Notebook Process node.
- Verify that the correct Workspace and Notebook Name are selected.
- Click Refresh in the configuration sidebar.
What Happens During Refresh
- The system re-scans the
.ipynbfile. - The tagged
parameterscell is identified. - Variable names and default values are extracted.
The detected variables are displayed in the Parameters Preview section of the UI.
Mapping Notebook Parameters to App Variables
The true power of parameterization lies in mapping notebook variables to Syntasa App Variables or System Macros.
Common Mapping Patterns
Date-Driven Processing
process_date → {{process_date}}
Ensures that each execution receives the correct processing date based on the App’s schedule.
Batch Tracking and Lineage
batch_id → {{batch_id}}
Maintains traceability across pipeline executions.
Environment Flags
is_production → true / false
Allows conditional logic within the notebook to differentiate between development and production behavior.
Supported Data Types
The Notebook Process supports standard JSON-compatible types:
- Strings:
"2024-10-27" - Integers / Floats:
100,0.05 - Booleans:
true,false
Best Practice: Ensure the injected value type matches the default value type defined in the notebook.
Execution Model: How Parameter Injection Works
When a Notebook Process is triggered—either manually or by a schedule—the platform follows a deterministic injection sequence:
- Runtime Initialization
The configured runtime environment (Python or Spark) is launched. - Injected Parameters Cell Creation
App workflow generates a new cell immediately after the taggedparameterscell. - Variable Override
The injected cell assigns the runtime values, for example:
process_date = "2024-10-27" batch_id = "b_12345"
- Notebook Execution
All subsequent cells execute using the overridden values.
Because the injected cell runs after the defaults, runtime values always take precedence.
Verifying Runtime Values (Executed Notebook)
Every Notebook Process execution produces an Executed Notebook artifact.
How to Verify Parameters
- Navigate to App Monitor after the run completes.
- Select the Notebook Process node.
- Open the Executed Notebook from the Outputs section.
Within the notebook, an Injected Parameters cell is visible, clearly showing the exact values used for that execution.
This provides a transparent audit trail for validation, debugging, and compliance.
Best Practices and Troubleshooting
Best Practices
- Limit Scope: Include only variables that need to change at runtime.
- Type Consistency: Keep default and injected value types consistent.
- Top-Level Placement: Place the
parameterscell near the top of the notebook (typically after imports) for clarity and maintainability.
Troubleshooting Guide
Parameters Do Not Appear in App workflow
- Was the notebook saved in JupyterLab?
- Is the cell tag exactly
parameters(lowercase, no spaces)? - Was the Refresh button clicked in App workflow?
Values Are Not Overriding Defaults
- Check whether the variable is redefined later in the notebook.
- Ensure logic does not overwrite the injected value.
System Macro Errors
- Verify the App has a defined schedule or execution context.
- Ensure system macros (for example,
{{process_date}}) are supported by the trigger type.
Summary Checklist
Before running a parameterized Notebook Process, confirm the following:
- A notebook cell is tagged with
parameters. - The notebook is saved in JupyterLab.
- Refresh has been clicked in App workflow.
- Parameters are mapped to system macros or static values.
- Runtime values are verified in the Executed Notebook snapshot.
Conclusion
Parameterization is a critical enabler for scalable and maintainable notebook-based pipelines. By following a consistent tagging strategy, synchronizing changes with App workflow, and validating execution artifacts, teams can confidently reuse notebooks across workflows while maintaining transparency and production reliability.