How to use subgraph block

How do I use the subgraph block in the graph editor. When I place one on my graph, select a graph for it, and connect its input and output, I get a message that the mandatory source product is not set.

Is it not possible to have a subgraph be used as a sort of reusable “function” with inputs and outputs?