Does the parent and child records have same number of fields? If so, a generic dict/schema will convert this data to an IS document, and using the flow logic, u can determine each group that can be published to broker.
You are getting flatfile as your input right? Why do you parse it to IS doc, and then again convert it to string/string list?
The records seems to have record identifier. convertToValues service displays records in IS doc format after parsing. In this doc, you can see a string called ‘record-id’ which will hold the value of identifier. You can loop over IS doc (ffvalues) directly and perform some logic i believe.