I did introduce a whole video series that uses this exact elements of the docs. May be this will help you out more. The videos start with file based plugins and the core plugin library. In the middle of the series it starts to use a node based system.
The series doesn’t explain the solution of the problem you posted, but the examples should be close enough to give you the info to solve the problem.