How to retrieve the properties of an IF workflow activity using ServiceNow API?

LeviE
Tera Contributor
Hello people,

I am exploring ServiceNow Rest API and I have a doubt which I could not answer alone.
Given that I have an activity which the activity definition type is an IF: How can I retrieve information like the conditions of the IF activity (not the conditions related to transitions, the condiions related to the IF activity definition), whether the advanced flag is enabled, and the script (if there is one) of the IF activity?
Screenshot 2024-12-11 203824.png

 


Thanks!
1 REPLY 1

Hemanth M1
Giga Sage
Giga Sage

Hi @LeviE ,

 

You can get it from "wf_activity" table 

 

Glide "wg_activity" table with a sys_id of the workflow (Published), reteive conditions and script values.

 

Let me know if you need help in scripting this logic.

ex:

 

HemanthM1_1-1733990904132.png

 

HemanthM1_0-1733990866583.png

 

 

 

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025