PricingBlog

Workflow don't always executes completely

  • roccons-1268017595563376711

    roccons

    1 year ago

    I have a workflow attached to the click event of my "Update note" button, which should first update a register in my Supabase table (Call: Update Note) and then a select to refresh the data which populates my list of repeating elements (Call: All Notes), to avoid discrepancy. But after several tests and after including a debug status message I discovered that when I click the "Update note" button, sometimes (randomly) only the first call is executed so the register is correctly updated in my Supabase table, but not reflected in my repeating list, and I need to click for a second time in order to have the second call executed and my list updated. What am I missing?
    1268017595722764298-z_workflow.png
    1268017595970355301-z_update.png
    1268017596238794802-z_all.png
  • roccons-1268018817427177473

    roccons

    1 year ago

    It's worth to mention that there is no error, since I'm updating status both in success and in error, it's apparently just the workflow sometimes stopping without executing the last block
  • max.kayr-1268048355922284621

    Max

    1 year ago

    Hi @roccons! The second API call won't wait for the first one to finish. They are basically called at the same time. So if you are lucky, the first one is fast and the data is already updated when the second one hits Supabase. If you want to call All Notes after Update Note, you have to move it to the "On success" callback of the "Call: Update Note" step.
    1268048356035264573-image.png
  • roccons-1268254605926600806

    roccons

    1 year ago

    That makes sense. I already did the change and it worked flawlessly, thanks!
    💪1
  • roccons-1268265757314383993

    roccons

    1 year ago

    sorry, now is working also using the on success event in the API!
  • roccons-1268266735732002907

    roccons

    1 year ago

    With this last change now I'm able to update my note using auto fetch in the "Update Note" API, so the Note is updated automatically, without the need to click on the Update button. It seems been to be working fine!
    👍1