What is the main reason for the setup you have instead of using the native built in functionality that Bubble already provides for ensuring slugs are unique.
When you run the workflow action for set a things slug, the value you enter, Bubble checks against all records of the same data type, and if another record already exists, Bubble will append a numerical value to the new slug for the thing you are setting the slug for, in sequential order.
I would imagine that your setup is part of the issue as you are performing a search, which is not necessary.
If I have a data type called restaurant, and I set a slug to be the name of the restaurant, my setup is simply to use the set a thing slug and the value is the restaurants nameā¦Bubble does all the heavy lifting for me there, so they will slugify the name and also check against all other restaurant entries and determine if a slug of the same value already exists, and if so, add a numerical value sequentially.
So, if I have McDonalds and there are 2 entries already with slugs
mcdonalds
mcdonalds-1
and then I add a new McDonalds, Bubble will make the new slug automatically to be
mcdonalds-2
I donāt know what they do behind the scenes for that or how it impacts WU consumption, but looking at your setup you are using a Search for the slug value and a formatted as text to evaluate. I would venture to guess the Search is what is the problem, and might not be the setting of a slug workflow action itself.
Also, if you are going to be appending the unique ID instead of a sequential number, and keep in mind the sequential number is handled by Bubble to ensure no duplicates and maintain slugs as unique identifiers, which was an added feature due to cries from the community for an easier approach to human readable URLs for SEO purposes, because unique IDs are not human readable and do not add any benefits for SEO and likely lower SEO āscoresā, I would suggest just not using slugs at all and just use the unique id itself as that is already a built in field that is automatically populated, since the approach of using a slug with appended unique ID does not get you the SEO benefits the slug feature is intended for. Additionally, remember, every character returned (so each number or letter of a datafield) costs WUs, so when you are taking the unique ID (that already exists and is built in, so we can not control that and will always be returned via a search and cost us WUs), and appending that to the slug, you are doubling the WU consumption for returning data values via a search, and from the way I see it, for no added value, since, again, I believe the slug is for SEO only and not just for unique identification of entries (it is unique, but we already had unique IDs).
In my apps, I do not use slugs on data types that will not be used for SEO purposes, and any data type that will not have a āunique pageā where that page is part of an SEO strategy, I just use the unique ID.
Have you tested setting the thing slug without using the Do a Search approach and just simply setting the value to the proposed value and let Bubble append a sequential number? Iād be interested to know if you experience the same WU consumption.