Flow actions not executing from transform script

sd2097
Tera Guru

Hi all,

 

I am trying to execute flow actions from transform scripts using the code snippet that we get. The same snippet is working as expected in other server side scripts, but from transform scripts (onAfter, onComplete), the action is not even executing, and the code is getting stuck at a particular point.

 

What can be the possible reasons for this?

 

Thanks,

SD

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@sd2097 

share screenshots on how you are doing that?

Which other scripts are able to call those flow actions?

Make sure your Flow Action is Configured to Run as -> System User

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

This is the code snippet I am running. And the same code snippet is working as expected in business rules, ui actions, script includes.

But as I said, that in transform scripts, the action is not executing at all.

sd2097_0-1762759353369.png

 

Thanks,

@sd2097 

you should run the code in background and not foreground if you want to make it run async

are you sure the action is configured to Run as -> System User?

Also did you check the action might have executed but it threw error as soon as it started?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

Similar result while running the flow in the background.

 

sd2097_0-1762761889858.png

 

Also, we don't have the option to specify the 'Run As' in flow actions. That option is there in flows and subflows.

 

Thanks,