How do I correctly connect Microsoft 365 Email (Outlook) → Search Messages to an Iterator Module?

:red_question_mark: How do I correctly connect Microsoft 365 Email (Outlook) → Search Messages to an Iterator Module?

I have built a scenario where I find an email in a folder, summarize it and email the summary to myself. Now I want to expand that scenario to handle multiple emails in one summary email. I thought that I should do that by:

  1. Use Microsoft 365 Email (Outlook) → Search Messages to pull emails from my `specified folder.
  2. Iterate over each message.
  3. Pass each message to an OpenAI module to summarize the content.
  4. Aggregate all summaries into a single digest email.

If that is a workable solution, I’m currently stuck on the Iterator setup.

:puzzle_piece: The problem:

I can’t figure out how to connect the output of the Search Messages module to the Iterator module. In the Array field of the Iterator, I don’t see a way to pass the bundle of emails from the previous module:


:light_bulb: What I want to do:

  • Feed the Iterator the array of full email objects (each containing subject, sender, body, etc.)
  • Loop over each of those messages and summarize them
  • Aggregate and email them together

:magnifying_glass_tilted_left: My question:

How do I properly configure the Iterator to consume the full array of messages returned by Search Messages?

OR

Is there a different/better way to accomplish what I am trying to do?

A screenshot of my current setup is attached for reference. Any help is appreciated!

Most search modules already return a separate bundle per item found. There is no point using an Iterator afterwards.

1 Like