How to trigger a flow from an event?

Jacob23
Mega Guru

Hi,

I am trying to trigger a flow by using the "Record Created" trigger, then searching the table for the sysevent table. I have then added a condition to only run if it is an event with a specific name.

I did an example of what I am trying to do below. The condition is for when an event is created from an incident being inserted so I have specified the name to "incident.inserted". I have then set an action to send an email to me (in Dev), however, this will not run. ServiceNow does not seem to recognise this as a trigger. Of course, if I run a test from within the flow this works, but that is because it sets the trigger as true automatically.

find_real_file.png

Does anyone know how to set it so you can run a flow based on an event generated?

The flow I am using for work is using an event that we custom made, and is generated from a business rule using gs.eventQueue, just an FYI, but I don't think this would be the cause for the trigger not working in my flow??

 

Any help is much appreciated!!

1 ACCEPTED SOLUTION

For my use case it need to start off from a event, what I posted was an example of what my flow is. For privacy I just did an example.

However, I have found the answer. It is something to do with when using gs.eventQueue, setWorkflow is set to false so setWorkflow(false). You need to create a property that sets this value to true like so:

Name: trigger_engine.ignore.set_workflow

Type: True

Value: True

Having this setup allows for "Record" triggers for "Create", "Create/Update", "Updated" for events to actually trigger.

 

View solution in original post

11 REPLIES 11

Saurav11
Kilo Patron
Kilo Patron

Hi,

 

Instead of using the trigger as an event, why not change the trigger to what causes the vent to fire in the first place and then later in the flow you can use event table queried in the flow or actions.

Hope this helps. Please mark the answer as correct/helpful based on impact.

For my use case it need to start off from a event, what I posted was an example of what my flow is. For privacy I just did an example.

However, I have found the answer. It is something to do with when using gs.eventQueue, setWorkflow is set to false so setWorkflow(false). You need to create a property that sets this value to true like so:

Name: trigger_engine.ignore.set_workflow

Type: True

Value: True

Having this setup allows for "Record" triggers for "Create", "Create/Update", "Updated" for events to actually trigger.

 

Hello @Jacob23 How did you get the sysevent table to appear in your table field of the action? In a Tokyo instance, that table cannot be reached.

Hello,

Where are you trying to search for this? I have done this in the trigger at the start of the flow not an action. What is the name of the action you are trying to use?

 

If you are using a trigger based flow then make sure you have it set for the record to "Created or Updated". I have just done this and can see the table field and searched for "sysevent".

Jacob23_0-1690457629358.png