# Create a "list" of thing via API Workflow - Problem with second tasks

**URL:** <https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753>\
**Category:** Need help\
**Created:** [November 10, 2024, 9:08am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753 "2024-11-10T09:08:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![annephili75](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@annephili75](https://forum.bubble.io/u/annephili75)\
**Post date:** [November 10, 2024, 9:08am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/1 "2024-11-10T09:08:48Z")

</div>

Hi !

I would like to create a “list” of new thing from a multidropdown.

For this, I followed this very good tutorial: [https://www.youtube.com/watch?v=LLYaNHmt6\_Y&list=PLvRZVR4itmEuaXL3VPh1-\_nI\_NbSpKeXD&index=25](https://www.youtube.com/watch?v=LLYaNHmt6_Y&list=PLvRZVR4itmEuaXL3VPh1-_nI_NbSpKeXD&index=25)

However, after the first task of the Workflow API, I would like to add each created item in a field of another list.

This works but the list is never complete, one or more items are always missing.

I tried to add the task via a trigger event, and it’s the same thing, it works halfway, items are always missing.

 ![Probleme ticket (13)](https://us1.discourse-cdn.com/bubble/original/3X/c/a/ca3fb1517060cb87a74f3ded9d93c3f165b9961b.png)

‘I think’ the problem is that the first task of creating items is not completely finished when the second one starts. But I don’t know how to add a waiting time between 2 tasks … and I’m not even sure that’s the problem.

Thank you for your help !

---

<div class="post-metadata">

**Author:** ![Ops\_4N](https://avatars.discourse-cdn.com/v4/letter/o/b2d939/32.png) [@Ops\_4N](https://forum.bubble.io/u/Ops_4N)\
**Post date:** [November 10, 2024, 10:37am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/2 "2024-11-10T10:37:57Z")

</div>

![241110_6274](https://us1.discourse-cdn.com/bubble/original/3X/8/1/8123ab0e0ffdfda33a70f834b60a9ca42eeef994.png)

---

<div class="post-metadata">

**Author:** ![saloon-esquiver0t](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/saloon-esquiver0t/32/253776_2.png) [@saloon-esquiver0t](https://forum.bubble.io/u/saloon-esquiver0t)\
**Post date:** [November 10, 2024, 9:18pm UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/3 "2024-11-10T21:18:56Z")

</div>

Dont’t work in backend

---

<div class="post-metadata">

**Author:** ![georgecollier](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/georgecollier/32/182327_2.png) [@georgecollier](https://forum.bubble.io/u/georgecollier)\
**Post date:** [November 10, 2024, 9:23pm UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/4 "2024-11-10T21:23:41Z")

</div>

> [@annephili75](#):
>
> I think’ the problem is that the first task of creating items is not completely finished when the second one starts.

Yes, you’re right. You’re encountering race conditions. This is generally an issue with Lists on data types.

You can reduce the risk of this by assigning an interval between workflows. On your Schedule API workflow on a List (if using it), add an interval of 1 second or 2 seconds.

Now, if you have one trigger setting off multiple workflows all at the same time, there’s no easy solution (short of an overengineered queuing system). I’d just avoid using the list at all and instead jut Do a search when you need it rather than accessing the list directly.

---

<div class="post-metadata">

**Author:** ![annephili75](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@annephili75](https://forum.bubble.io/u/annephili75)\
**Post date:** [November 11, 2024, 6:27am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/5 "2024-11-11T06:27:13Z")

</div>

Thank you but this action doesn’t exist on backend workflow …

 ![Capture d’écran (2487)](https://us1.discourse-cdn.com/bubble/original/3X/0/f/0ff61e05dd4318e34b3307b39b1e952328b82161.png)

---

<div class="post-metadata">

**Author:** ![annephili75](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@annephili75](https://forum.bubble.io/u/annephili75)\
**Post date:** [November 11, 2024, 6:29am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/6 "2024-11-11T06:29:41Z")

</div>

I know … But in this situation, it’s the only way … 😅

---

<div class="post-metadata">

**Author:** ![annephili75](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@annephili75](https://forum.bubble.io/u/annephili75)\
**Post date:** [November 11, 2024, 6:30am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/7 "2024-11-11T06:30:34Z")

</div>

Thanks for these advices !! It seems to work ! 😀

---

<div class="post-metadata">

**Author:** ![mitchbaylis](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mitchbaylis/32/122860_2.png) [@mitchbaylis](https://forum.bubble.io/u/mitchbaylis)\
**Post date:** [November 11, 2024, 8:35am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/8 "2024-11-11T08:35:30Z")

</div>

the only way to reliably get this to work is to do a recursive workflow with a slight delay between the steps.

you still need a slight delay between the steps since if it is super fast to process bubble still drops records even though they get added sequentially.

I often do this like  
schedule api workflow where  
current number starts at 1  
max number is 10 (number I want to create

create the thing  
add to other thing  
schedule same workflow again +1 to current number and 0.3 second delay (have condition to only run this after add to thing is not empty)  
only schedule it if current is less than max number

you definitely want to do simple math here - plus 1 to the current number. DO NOT count created records as that is a search (heavier) and maybe the creation step fails and so you get an infinite loop…

backend api is best for this workflow since the front end could be interrupted and stopped before all X items are created and added to list (ie user navigates away from page)

---

<div class="post-metadata">

**Author:** ![annephili75](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@annephili75](https://forum.bubble.io/u/annephili75)\
**Post date:** [November 11, 2024, 7:31pm UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/9 "2024-11-11T19:31:12Z")

</div>

Thank you very much for all these explanations and advice

I had not seen that it was possible to add a delay! I did it and it seems to work well!

---

<div class="post-metadata">

**Author:** ![msgiblin](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/msgiblin/32/119904_2.png) [@msgiblin](https://forum.bubble.io/u/msgiblin)\
**Post date:** [November 11, 2024, 8:14pm UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/10 "2024-11-11T20:14:28Z")

</div>

Another potential solution I recently used - when creating the list of things via API workflow, I included a field of type text. When triggering the workflow, I generated a random set of characters that I included for this field, and triggered another workflow that when the count of things with that random set of characters count = the number of things scheduled to be created, to add those items to the other thing. This prevented any potential race conditions, and added them all in 1 step once they were complete.

---

<div class="post-metadata">

**Author:** ![annephili75](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@annephili75](https://forum.bubble.io/u/annephili75)\
**Post date:** [November 12, 2024, 8:25am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/11 "2024-11-12T08:25:38Z")

</div>

Very interesting process ! Thank you very much !!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [January 19, 2025, 9:08am UTC](https://forum.bubble.io/t/create-a-list-of-thing-via-api-workflow-problem-with-second-tasks/347753/12 "2025-01-19T09:08:54Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
