Workflow Creates Creates a Thing bypassing conditions

I’m using StuartB’s QR Code Scanner plugin.

My workflow goes something like this:

When QR Code Scanner has data

  1. Set state of an element Log (Database search)
  2. Trigger Custom Event Time In Event (Only when: Log’s Time In is empty)

Time In Event

  1. Create a Thing (Log’s Time in)
  2. Hide an element

When I scanned a QR code, it created a Time In entry but did not proceed with the rest of the workflow. I delete the entry manually in the database and run it again with the debugger. I saw that on the first step of QR Scan the values returned by the search says its already existing. So Step 2 does not happen since it does not meet the condition.

Weird. When I try to add Pause before Step #2 it works. But I don’t think that’s optimal because used a static number in the pause.

Hi @christianbernliboon,

If you haven’t already, you should first read the docs on workflow execution rules. Steps within a workflow don’t necessarily finish executing in the order in which they appear.

1 Like

Thank you! I was enlightened by that. Obviously, database interaction starts simultaneously as soon the workflow starts regardless of what Step it was. What I did was I created another custom event just for that Create A Thing. Works now, just feels weird that in a custom event there is only one Step.

1 Like