# Custom Events vs. API Workflows

**URL:** <https://forum.bubble.io/t/custom-events-vs-api-workflows/18442>\
**Category:** Need help\
**Created:** [September 27, 2017, 3:21pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442 "2017-09-27T15:21:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex5](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@alex5](https://forum.bubble.io/u/alex5)\
**Post date:** [September 27, 2017, 3:21pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/1 "2017-09-27T15:21:04Z")

</div>

Hi,

Can someone explain to me the difference between having an API workflow

a) Schedule an API workflow (at current time)  
b) Trigger a Custom Event

Assume that the API workflow only needs one argument and that said argument is a thing (not a list)

I want to understand when you’d use one form vs. the other.

Many thanks in advance,

Alex

---

<div class="post-metadata">

**Author:** ![romanmg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/romanmg/32/237672_2.png) [@romanmg](https://forum.bubble.io/u/romanmg)\
**Post date:** [September 27, 2017, 3:53pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/2 "2017-09-27T15:53:58Z")

</div>

Hi Alex,

The biggest difference is that API workflows run on the server side, so your user could close the page, and it will still run. If the user exits in the middle of a (non API) custom event processing some heavy workflow (a change to a big list of things, for example), or before it is even triggered (if scheduled) they risk cutting it off and leaving it unfinished.

Triggering a custom event (scheduled or not) is your better option if your workflow involves element display on that specific page (e.g. showing a popup). There are tons of use cases for custom events though.

Scheduling an API workflow for current time and triggering a custom event (not scheduled) may show no difference for the user, especially if it’s a quick database action. I tend to send things to the API queue if it’s a “background process” that might take some time or if it needs to happen much later in the future after the user is likely to leave the page.

As with many things, it depends on your use case. Hope this helps.

* * *

[Gaby | Coaching Bubble  
Private coaching, courses, and tons of free resources](https://coachingbubble.com?ref=forum)

---

<div class="post-metadata">

**Author:** ![alex5](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@alex5](https://forum.bubble.io/u/alex5)\
**Post date:** [September 27, 2017, 7:27pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/3 "2017-09-27T19:27:35Z")

</div>

Thank you Gaby.

When you refer to the Custom Events, are you referring to the ones you setup in the Page Workflow? I was referring to the ones that seem to be “server-side” custom events,which you can create them in the API Workflows page.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/e/4/e49737ce9c3980de5c950fde2bac97ae01462692.png)

---

<div class="post-metadata">

**Author:** ![romanmg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/romanmg/32/237672_2.png) [@romanmg](https://forum.bubble.io/u/romanmg)\
**Post date:** [September 27, 2017, 10:43pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/4 "2017-09-27T22:43:40Z")

</div>

I was talking about triggering custom events on pages, but this brings up a good point. There are going to be instances where there will be no difference, triggering a custom event here is still happening on server side. Also, a single parameter API endpoint set to current time is going to do the same.

Maybe there’s an important technical difference that I’m not thinking of when it comes to choosing one over the other when they’re both set up to do the exact same thing, but I’ll leave that to the Bubble guys to say.

It just depends on what you’re doing. Yes, you can schedule something to happen at current time, but typically if you’re **scheduling** an API workflow from another API workflow, then there’s a reason for it: It needs to happen at some point later than current time, it needs to be scheduled **on a list** , it needs to receive multiple parameters…

One of my favorite use cases for a Custom Event is to consolidate universal actions that happen from different triggers. For example, if I have 5 API endpoints that all, at some point, need to run the same 10 actions, I’m not going to have 50 actions - I’d rather have the 10 actions under a Custom Event and simply trigger this custom event from each of the 5 endpoints. This is a scenario where the date/time isn’t the point - it’s more about keeping a clean workspace (and less room for error).

---

<div class="post-metadata">

**Author:** ![alex5](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@alex5](https://forum.bubble.io/u/alex5)\
**Post date:** [September 29, 2017, 2:40am UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/5 "2017-09-29T02:40:13Z")

</div>

Many thanks for your thoughts.

---

<div class="post-metadata">

**Author:** ![romanmg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/romanmg/32/237672_2.png) [@romanmg](https://forum.bubble.io/u/romanmg)\
**Post date:** [October 3, 2017, 3:19pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/7 "2017-10-03T15:19:33Z")

</div>

Hey @prestanalytics.info, would you mind posting this as a separate thread since this is an unrelated question to the original post here? I’ll be happy to answer as soon as I see it!

---

<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:** [December 6, 2017, 3:21pm UTC](https://forum.bubble.io/t/custom-events-vs-api-workflows/18442/9 "2017-12-06T15:21:18Z")

</div>

Closed on December 6, 2017, 3:21pm UTC

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