Forum Academy Marketplace Showcase Pricing Features

Workflow cannot access custom state's value, except in debug/slow mode

Hello,

I have Workflow A that sometimes might not work:

When Button Create A is clicked:

  1. Create an Object A
  2. Set custom state “new_obj_id” with value of “Result of Step 1 unique id”
  3. Create a “Workflow Log A” (object id column = “custom_state’s new_obj_id” )
  4. Error occurs

And I have Workflow B :

When Button Create A has an error running workflow:

  1. Create a “Workflow Log B” (object id column = “custom_state’s new_obj_id” )
  2. Delete an Object (unique id = “custom_state’s new_obj_id” )

Essentially Workflow’s A Step 3. and Workflow’s B Step 1. are the same - they take the Object’s A unique id value from the same custom state and create a “Workflow Log” object in a database.

The problem is, when I run these workflows normally, the Workflow Log A is created successfully, with object id column filled properly, but Workflow Log B is created with object id column empty! And what is the most weird to me: both are created properly when I click Button Create A in Debug Mode or Slow mode. Obviously, Object A is not deleted after running in normal mode, but properly deleted in debug mode.

Why is this happening? Is there a way to achieve what I need?
Is it a more general problem with how these “error handling” workflows work?

I’ve tried assigning the custom state to different elements on page and page itself.
I’ve tried adding “Pause before next step” in both workflows in various places.
I’ve tried assigning an arbitrary string in the custom state instead of unique id.

Hi,

It would seem that you have a sequence issue.

Something in the way you set things up is not constraining bubble engine to run things in the order you want. Workflow B should have posterity, and also run “each time” (that there is an error).

A screenshot of your workflows would be helpful here. This is probably something that can be fixed by wrapping your flows in custom events.

1 Like

I agree with @cynthia.conrad1 .
Bubble flows don’t run linearly (read here - The Basics - Bubble Docs) , so your error event was triggered before the element custom state was assigned a value.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.