Forum Academy Marketplace Showcase Pricing Features

How to trigger a workflow when a new thing is created?

I know there is a way to trigger a workflow when a condition is met. But how do you specify the condition (when a new thing is created)?

Thanks

If you mean by the 2nd sentence, the condition in which a new thing was just created, then you can keep a reference of what the previous object (retrieved from some field) was created and compare that with the latest object that was created (retrieved via search). Trigger the condition when they are not the same and don’t forget to update the previous object.

You could also trigger a custom event when that thing is created.

1 Like

@romanmg, how to catch the custom event? Example?

Her solution implies that you trigger the workflow in the same workflow right after creating the new entry. For example, right after the “Create new thing”, trigger the custom event. Depending on your scenario, the timing of events, and the data structures, this may or may not work for you.

1 Like

@Scott, you are right. Her solution won’t work for my use case as the custom event must be handled on another workflow.

@Scott, I made it work by storing the number of things when the page is loaded and then compare the the current number of things with to the previous in the condition. When the condition is met, update the number of things in the state variable.

Hello there!
I can’t seem to make this work :face_with_raised_eyebrow: :smile:
I’m trying to trigger a workflow when a new thing is created in a database.
In my case, entries can be created by several ways, including manually, so I don’t want to replicate a same (long) workflow multiple times for each trigger (user input, manual input, etc.). Hence triggering from the database step which is the convergent step.

I’m trying to use the “Do when condition is true” trigger and have been trying to use either new “Created date” (eg “Created date = Current date”) or new “unique id” but can’t seem to make it work.

Could anyone please point me in the right direction? :arrow_lower_left::arrow_upper_left::arrow_lower_right::leftwards_arrow_with_hook::arrow_right:

I solved this by simply putting a “YES/NO” in the database for the data type of the “new thing” and set it to “YES” when the new thing is created. On the other side, I ran a workflow “only when” the value for the data type is “yes”. The last step in that workflow is a 2000 MS “Pause”, then the “YES/NO” is changed to “NO”.