Differences between "Schedule API workflow" and Schedule API workflow on a list"

@josh, @emmanuel, or anyone else that knows. Maybe I’m not understanding the difference, but why are there two additional fields on the “schedule API workflow on a list”, but not on the “Schedule API Workflow”?

In the “schedule API workflow on a list”, after entering the “list to run on”, it’s so much easier to reference the thing and then use it in all of the key/values by using “This …” – example “This Person”.

In the “schedule API workflow” there isn’t a “thing to run on” field, instead I have to use “get data from an external API” on every field. I think it would be easier to have an option to define a thing and then use the same “This…”

Also is this making multiple API calls, instead of one? For my use case, all of these fields could come from the same object and could be received from one call.

image

When you’re running it on a list, you’re typically doing something for a lot or rows in your database whereas the schedule api workflow is for a single row in the database.

So, for example, I might “schedule API workflow on a list” to send everyone in my database an email that’s personalized for them by including, say, their name.

2 Likes

The situation you describe above DOES NOT make multiple API calls.

It is analogous to the situation where you have an API call configured as “Data” and then do “Make Changes to a thing” where all fields that you are changing are diffferent fields of the return value from the same API call.

Let’s say your make changes step changes two fields, Foo and Bar on some thing.

Field Foo gets its update from “myApiCall’s ReturnedFoo”.

Field Bar gets its update from “myApiCall’s ReturnedBar”.

Further, the make changes step has an “Only when…” of “myApiCall’s Error is empty”.

Does Bubble execute THREE API calls to accomplish this? (That is, must it ping the API thrice to get the values of Error, returnedFoo, and ReturnedBar?)

No (as long as the parameters passed to all calls are the same), it does not.

If all “three” calls are identical, Bubble will execute the call just once. In this example, the API call would be forced to happen by the “Only when…”. Bubble must make the call to determine if Error is null.

However, it understands that, if the parameters there are the same as the parameters used in the data assignment part of the make changes dialog, I must be talking about the SAME CALL.

So, if Error comes back empty, it grabs ReturnedFoo and ReturnedBar from the “cached” results of the call forced by our “Only if…” condition.

I have verified this by observing console data for APIs that I’ve written to be used with Bubble. In cases like this, the API is queried only once.

As for API WF on a List versus Scheduled Workflow, the interface to the former IS superior for the reasons you note.

But you can easily use API WF on a List on a single item. For the list, just send it the thing you want to operate on appended with the :make list operator. That takes your individual object and turns it into a list of object type with just one list item.

(Said “list” is a copy of the object, represented as a single-item list. It does not mutate the original thing of course.)

3 Likes