Create a New Model and add a Vector Layer Input. Restrict accepted geometries to Polygon.
Add an Expression Input. The parent layer must be the vector layer input because the expression will be evaluated against that layer.

Add an Extract by Expression algorithm. Select the vector layer and the expression from the model as inputs for the algorithm.

Add a Polygons to Lines algorithm. The input for this algorithm must be the matching features output of the Extract by Expression algorithm. Give a name for the output because this output will be a new layer in the project.
Give a name for the model and save it.
The model will be in the Processing Toolbox. Run it. Select the input layer to exctract and write the expression. If you want to return the features which name satisfy one or another equation, you must use the OR operand.
In my case, I will extract the polygons of the Zonificacion layer which "codigo" field value is 'Rme' OR 'Rmi'.
The output is a new LineString geometry type vector layer with the selected polygons converted to lines.
