In the above workflow, the creation of the delimited items for the IN query uses a component that I wrote specifically for this type of scenario, but this can also be achieved using a combination of GroupBy and String manipulation nodes, or possibly other methods (see the posts below for more info). I find it convenient to just use a component for it though
You may find the following forum topics useful as they discuss the creation of an IN clause, and other comma-delimited clauses for use against a database, providing different ideas and approaches: