Hi everyone,
I'm wondering what would be the best approach for the following use case.
There may be between 300 and 500 active claim workflow instances. The costs for these claims are tracked in the ERP system. The total of the costs needs to be in the claim, so that it can be used in reports.
Challenges:
1. I can only use REST for retrieving the costs
2. The ERP system supports webhooks, which doesn't help us.
3. The total changes only rarely, I don't want to create a new version for an instance on a daily basis if nothing changes.
What are your ideas for solving this?
My ideas up to this point:
1. Update workflow with item list
I wanted to:
- Create an item list with all active workflow instance
- Fetch the data from the ERP system for each row
- Compare the old against the new data
- Trigger an update if something changed
Problem: Executing xxxx REST Requests in a "for each" loop in an item list will probably exceed the timeout of path transition.
There's no option to filter the item list in the "for each" loop. Using a "any collection" source for the for each would work, but than I can't update the item list row.
I could use some if condition in the item list to execute only a part of the item list. This would work technically but I would still get a log entry in the history for each item in the item list. This will bloat the database as I would have to repeat this path until instance was handled.
2. Update workflow with item list and sub workflows
Instead of updating the data in the item list, I will use the item list to spawn sub workflows for each row. The sub workflow would than fetch the data for it's claim, compare it and do the update if necessary.
This would result again in xxxx REST requests, but at least they are scoped to their own workflow instance and shouldn't run into a timeout. If some requests fail, because there are to many. Maybe I can check here also that there are not more than xx Workflows in the "fetch data" step to reduce the amount of request send to the ERP system.
Overall problem: This is running on webconapps in a multitenant environment -> I don't have the archive action, so I can't delete these helper workflows.
Best regards,
Daniel