Hello everybody. I am trying to construct a scenario that does the following:
- Watches gmail for messages with a specific subject
- Uses ChatGPT to parse the body of such emails and output a comma separated list of the unique items in the email
- Send those unique items, NO MORE THAN 10 at a time, via email
Currently, steps 1 and 2 work flawlessly. Step 3, however, is stumping me. With an iterator, I have been able to send the unique items, 1 at a time, via email. How would I go about sending them 10 at a time? It would also need to account for lists that are not exactly divisible by 10.
For example, if the ChatGPT output was the following CSV of 21 items:
ā1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21ā
Then the eventual result should be 3 separate emails are sent:
Email 1: ā1, 2, 3, 4, 5, 6, 7, 8, 9, 10ā
Email 2: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20"
Email 3: ā21ā
Here is what I am working with, which currently involves a simple standard iterator to split by comma separation.
I presume to do this correctly, I would have to use a combination of iterators and aggregators perhaps with some modulo filtering?
I have been playing around with different concepts and have not made much progress. Any help would be greatly appreciated.
Thanks!