Hi, I have a problem with the backend workflow.
Here’s what it is.
I have content blocks listed in RG, each of which has its own order number. What I want to do is, when I delete a block, let’s say in the middle, the order of the ones after it should be renumbered correctly.
So, in the workflow, I save the number of the deleted block to a custom state and delete it → I run the backend workflow for renumbering. This happens immediately. But everything gets stuck on the frontend, the bubble horizontal loader runs very slowly at the top and never finishes. The server log reports that the backend workflow ran and finished. But the frontend remains stuck.
Do you know what could be causing this?
Hey! @stastnyvenca This usually happens when the backend workflow is indirectly triggering something on the page again, so the frontend keeps waiting and never fully releases. Even though the server log says the backend workflow finished, the page can get stuck if the delete action and the renumbering are tightly coupled.
A couple of things to check: make sure the backend workflow isn’t modifying the same thing the page is still referencing right after the delete, and confirm you’re not scheduling the backend workflow “immediately” in a way that depends on a custom state or page data. A safer pattern is to pass the deleted block’s order as a parameter to the backend workflow, let it renumber independently, and don’t wait on its result in the UI.
1 Like
You can probably do this without a backend workflow using make changes to a list of things.
After deleting Block 3:
- Make changes to a list of things
- (Do a search for Blocks where order ≥ 3)
For each thing, set the order of the field to This Block's order - 1 (i.e, decrease by 1).
1 Like
Thank you guys for reply.
@georgecollier Maybe backend workflow is overkill for that. So I made basic workflow as you suggested. It was still broken, until I set “terminate this workflow” in the end of the workflow. Now it works perfectly 