Related document sync

Hi. Does anyone know if it is possible to sync related documents based on the inclusion of the parent? I’m thinking say client documents related to many task documents. If I sync a client can I sync only its related task documents.

yes, I think you should follow Data routing with “channels”

I don’t think channels help. The sync function says it can’t access external state. How when I get a task document would I know the client was a valid sync document?

I think that depend on your document design.
You should at least have one document to include the relationship of related documents and parent. Then you can assign your related documents by there’s parent’id(as part of the channel name).