Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

Sorry, I didn't fully explain. That was just an example flow and not what I am actually doing, as the issues I am encountering was to have the flow initiate. It was just to show what the settings look like for my trigger for the flow I am working on. The following actions are more complex in mine.

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.

michaelward
Tera Guru

A valid use case here is the user simply triggers the event, say through a ui action.  Let's just say that UI action is meant to make a rest call to get the latest earthquake data.  No condition in ServiceNow triggers this event, it's just a user's desire to get some outside data.  I would wire my UI Action to a script and outbound REST configuration, but let's say you wanted to do that using Flow Designer.  Can a logical approach be to trigger on the Event table and then perform an action to make the REST call?  It would seem so to me.  My particular issue right now is the flow designer trigger configuration does not allow me to select the Event table.  This is in Rome.