QGIS Model Designer offers powerful functionality for automating workflows. Many workflows are based on conditional logic that can generate different outputs based on the inputs provided. This post shows how to setup a QGIS model that can skip certain steps if those optional inputs are not provided. This is achieved using the Conditional branch algorithm in the QGIS Model Designer.
Here’s the example workflow we want to implement
- Given a buildings layer and a boundary layer, create a layer with building polygons at least 50m away from the boundary. This will be the final output if no other inputs are provided.
- Optionally, if a roads layer has been provided, further process the data and create a layer with buildings polygons that are both 50m away from the boundary and within 25m of a road segment.
The key is to use an expression that checks if the roads input is NULL and selects the appropriate branch of the model to process. Below is the diagram showing the final model.

We will go through the step-by-step process of building this model. You will find a link to download a GeoPackage file containing the final model and the sample dataset at the end of the post.
Continue reading





