Excessive Workload Units due to reading JSON?

I have been investigating my workload unit usage because they are unacceptably high, up to point of being commercially unviable. Investigation showed that over 80% of my workload units are used by a very simple plugin that I use to read items from JSON structures. That sounds completely wrong to me. How can such a simple action, that should have been a core part of Bubble anyway, consume such excessive workload units?

Anybody experienced the same issue? Any solution (directions)? Help would be greatly appreciated.

Illustration is an example of one of my APIs, everyhing but create new thread msg is the plugin I am referring to. Most of my APIs look like this.

How are you processing your JSON? This looks like you are processing each JSON over multiple workflows.

What plugin are you referring to?

It are actually two plugins that are the source of over 80% of the workload units used. Both I use to keep the workflows efficient, readable and manageable:

  1. Read JSON and get value by key
  2. Store Temp Data (Result of Step X)

I am sending over raw JSON and then using the ’ Read JSON and get value by key’ plugin to get to individual items in the JSON structure.

If you inspect the plugin code, you will see that this plugin is Server side. So this is using WU.

You should check for a plugin that is client side instead (this will also be faster) if you are just using the plugin to show JSON data in frontend.

This is the same thing for the Store Temp Data. This is a server side plugin, so this consume WU.

What is the end goal of your processing and also what is the JSON (example) that you are processing?

You may need to consider cheaper solution to process your JSON…

1 Like

Hi,

Yes, I understand that these are server side actions. I am processing AI generated content and turning them into bubble.io things/db objects. Pretty much the same for the store temp data. That really is the only way to get some kind of structure in the workflows and keep them readable an manageable. It am considering moving most APIs of of bubble just for the reason of the excessive WU’s. This would be a major pain as we are talking over 250 APIs. :frowning:

Can you share your JSON? In most case, there’s a lot of way to process your data without using plugins…

Looks like you are using sequential actions, is that right? Each action costs 0.70 WU no matter what. I would recommend building your own plugin that allows 10/20/whatever keys to be processed in a single action, that way you only spend 0.70 WU to process everything.

Here is relatively simple example of some JSON being generated elsewhere (financial engine), that I need to turn into a single object/row for each year and each revenue stream if that makes sense.

{
“revenueStreams”: [
{
“id”: “1746550510714x939239413954178400”,
“name”: “Gift Subscriptions”,
“type”: “unit_sales”,
“churnRate”: 0,
“revenuePerUnit”: 45,
“years”: [
{
“year”: 2024,
“totalUnits”: 0,
“activeUnits”: 0,
“revenue”: 0
}
]
}
]
}

So typically we would have multiple revenue streams and for each stream there will be five years of summed up values.

In my current setup I read the revenue streams from the JSON and schedule an API on a list for the streams. Than within that AP I read the years and schedule an API on the list of years to create the actual rows.

Each API uses the read JSON plugin to read the actual values to set in the database or forward to the next API

There’s no reason to process using plugins for that. This can be done with Schedule API on a list WF
The only thing you may need is to use API Connector to create Data Type… but this really depend of your process.

For example, for a lot of users using OpenAI, they will receive the JSON as a string in the API request response. So you can create a backend WF, use detect data and send a test payload to this endpoint and let Bubble parse the JSON. (seach forum, there’s a lot of example)

In API Connector, you will create a call that will call your own backend WF and set it as POST with JSON body and just <json_body> in body field. Send the received JSON string for OpenAI to this endpoint

In backend WF, you will have two other workflows:one that will be of the type revenueStreams and one that will be of the type Years.

When you receive the backend WF, Schedule on a list the revevenuestreams WF with the received list of revenueStreams and in this second WF Schedule on a list the Years list.

1 Like

Okay thanks Jici. I’ll check that out. I am using a similar setup in other parts of our platform. I’ll see if I can get it to work here as well.

2 Likes