How do I do a "For Each" script in a workflow?

I have quite a towering workflow which runs and emails a report for each person in my team. This is hard coded i.e. each person is a branch on the workflow and if I need to make tweaks or add bits, I’ve got to update each branch.

Is it possible to do this as a “For Each” sort of arrangement? The workflow is a scheduled workflow and the first node is an Output giving a list of item IDs but I don’t know how to re-do the workflow for each ID or convert the ID into an item and use other attributes in that item.

Hi!

Traditional “For Each” loops aren’t available yet within Alloy, however, we are working on a way to allow use of manual trigger workflows to be triggered from other workflows. What this means is that after the output node, you would be able to call a manual triggered workflow and pass in the Item IDs. Manual trigger workflows have two nodes to work in, either trigger a workflow run for each individual item passed to it, or one workflow run working on the entire list.

This case sounds like a good use for the former and would allow you to define a single workflow that takes the item, creates the report, identifies who it needs to be emailed to and sends the email. The intended recipient would need to be stored somewhere as an attribute on a related item, allowing you to link the email address in the WF action to that attribute.

Sorry I probably couldn’t be more help in the short term, but this new functionality should be available within the next couple of releases and should make it easier to maintain these sort of workflows.

Thanks Jonathan, I think we’ll put this on ice for the time being and review in the new year.