I think i'm still missing something in my api workflow list on a schedule in my backend workflows

Hi guys,
I’m a beginner so I really need your expierience.
I have a marketplace with data but I want the listing/data that the user putted in will be deleted afetr 60 days.
This is what I did. I share some print screens. Please tell me what isn’t ok.

Are you trying to delete a list of ‘Properties’, or just an individual ‘Property’?

From the use case you’ve described, it looks like you should be deleting an individual ‘Property’ 60 days after it’s created.

But in your workflows you’re deleting a list of properties (you don’t show details of the search you’re making so I’m not sure where you’re getting that list from).

Also, the first action in your Workflow is to schedule itself for the current date/time when it’s run, so that will create an infinite loop with no break.

I can’t see what you’re trying to achieve with your ‘Loop’ workflow either.

Assuming you’re trying to delete a ‘Property’ 60 days after it’s created, all you need to do is have a backend workflow with a single action ‘Delete a Thing’.

Then in whatever workflow you use to create the property in the first place simply schedule the delete property workflow to run 60 days later.

1 Like

Thank you very much.
I will try to chance it.
Thank you 1000 times
kind regards
Stijn

Hi,
I tried to chance it. I hope I understood everything.
For me it is like learning a new language.
Would you please look at the new version of my backend workflow



Thanks in advance
Kind regards

Without knowing exactly what you’re trying to achieve and how you’re triggering the workflow it’s impossible to give you an exact explanation…

But if I understand what you’re trying to do then you’re on the right track, but need to make a few changes…

  1. you don’t need to expose the workflow as a public endpoint unless you’re triggering it via an external API (which I’m assuming you’re not), so you can uncheck that box.

  2. This is just a personal preference, but I wouldn’t call your first parameter ‘allproperties’ if it’s referring to a single property (which I’m assuming it is unless I’m misunderstanding what you’re trying to achieve). I’d just call it Property.

Again, it’s entirely a personal choice what you call things, and you can use any name you like, but it can be confusing if you’re using a plural parameter name to refer to a singular item, especially if you need to reference the plural of that item at some point. That’s just a personal preference, and it won’t affect functionality, but it may help you understand the process of your workflow better.

  1. You don’t need to have a key for current date. Current date/time is standard Bubble data and can be accessed directly in the workflow settings, so you don’t need to pass it as a key.

  2. The first step of your current workflow is to schedule itself to start after 60 days.

That means when you trigger your workflow, the workflow will trigger itself to start again in 60 days time. When that new workflow starts again in 60 days time, the first thing it is doing is triggering itself to start again in 60 days time, and so on and so on for infinity.

Unless, I’ve completely misunderstood what you’re trying to do, that doesn’t make any sense (especially once you’ve already deleted the property that you’d be rescheduling the workflow to run on again in 60 days).

So there’s no need for that first step at all.

You only need the ‘Delete Property’ step, to delete the property in question.

Then, in whatever workflow you use to create the property in the first place (whether it’s in the browser in the backend), just add a step to schedule this workflow for the current date plus 60 days.

That’s the simplest way to achieve what I think you’re trying to do (although perhaps I’ve misunderstood what you trying to do).

There’s always more than 1 way to do things though, and often the best way to learn how it all works is just by experimentation. So keep it up :slight_smile:

Hi Adam
I want to thank you so much for all your time and effort.
It’s nice to see there are still people who want to help others to learn things.
I have one last question: " will the backend workfow automaticly beeing activated the moment I deploy the current version to live?"
Have a nice weekend
grtz

Hi @anon70120467,

Yes, once you deploy to live, everything in your dev version (including your backend workflows) will go live.

Of course, you’ll have to activate them via a workflow in order to run, but once it’s live whatever process you have to do that will work on the live database.

Thank you vry much for the advice and help.