Flows and Business Rules don't trigger/fire when an API call creates a record on a table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a Flow with a trigger setting of "Record Created or Updated" on the em_event table.
The flow triggers perfectly when testing and I manually create a new record using the "New" UI Action. However, once this goes to Production, an API call is going to be creating/updating those records. We are simulating this in our UAT environment by using POSTMAN to drop a "payload" that creates the new record on the table.
The Flow doesn't trigger in this manner, however. AI research indicated that the "injection method" the API is using is bypassing the CRUD functions that Flow triggers use to recognize activity. It was suggested that I use a Business Rule instead, and call the Flow using that Business Rule.
Unfortunately, even with that setup, I'm still seeing the same behavior.. The business rule isn't getting triggered any more than the Flow did... Again, MANUALLY creating the new entries triggers the business rule which calls the flow (now a sub-flow) and everything works... but I need to have the flow/business rule trigger when the API creates/updates the records.
Has anyone else run into something like this?
Thanks in advance for any help you can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
strange
Try raising a case with ServiceNow
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You need to look at the endpoint postman is sending a payload to, which would be the same as using the REST API Explorer. In Scripted REST APIs find the POST resource for this API/specific endpoint and make sure the script does not conatin setWorkflow(false) which will prevent Business Rules (and the flow) from running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Did you check this KB and validated.
KB0998922 Flow triggers not working on record create
Check if in any BR on your target table, SetWorkflow(false) is mentioned somewhere or not,
Cause
Any business rules with "SetWorkflow(false)" - will prevent other business rules and engines from executing, including flow designer.
Hence when you are inserting a record into the table even though flow conditions are matched, flow didn't get executed.
Resolution
kindly please remove the line current.setWorkflow(false); from the business rules to resolve the issue
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Adrian Weber1 , Could you please share the end point you are using.
By any chance, did you try to send the same payload using the Rest API explorer? Also, is the record created in em_event table when sending the payload using Postman?
Regards,
Nishant