Best way to handle Add to List on backend workflows

Been running into this multiple times as of late and was just wondering if anyone had any tips/tricks.

The issue is that if you create a lot of data using a backend workflow at once and try to add it to a list under another data type you will often time miss some records.

For example you create an array of 10 items. In each backend workflow you create and item and add it to the list. However the final list will most times have <10 items.

I either have to spread out the flow or create a post workflow sync flow that runs to capture the missed items.

Just wondering if there was something I am missing or if anyone has come up with a more clever solution.

Yeah, just do it recursively to ensure nothing gets missed due to race conditions.

Can you explain? Do you mean adding in buffer time into the schedule workflow on a list?

No.. i mean don’t use ‘Schedule Workflow on a list’ - that will always have the potential to cause race conditions and sync issue with this type of thing.

Run the WF recursively instead, and either add each item as you go, or add them all at the end - either way will ensure none of them get missed.

I’d only User ‘Schedule WF on a List’ for performing bulk operations that are completely independent from one another.

I see, and there wouldn’t be an alternative? The user would have to wait for all the items to be generated and would not see anything on the front end until each is done.

For example the app generates 25 plans. The backend flow generates all 25 almost instantly and then a sync flow triggers to sync them to the list.

In the way you suggest the user would see one at a time for ~25 seconds or however long bubble takes. Is that correct?

Try the Data API Bulk Create endpoint.

It’s fully synchronous and faster (and cost less in WU).

2 Likes