Calling workflow from script

agulati
Kilo Expert

Is there a way to call a workflow using script?I want the workflow to be only called from script and not by default when record is created for   a table.

12 REPLIES 12

adiddigi
Tera Guru

Aman, if by what you post you mean you want to attach a workflow to a particular record, you will have to do it using Workflow Script API.



You will see some basic usage examples on http://wiki.servicenow.com/index.php?title=Workflow_Script depending on your requirement, you will have to mix and match the scrips on that page.


Thanks Abhiram.



I am using the script. But issue here is that the workflow also gets triggered when the record is inserted. is there a property at workflow level that we can set so that it can only be called from scripts.


Jim Coyne
Kilo Patron

The workflow does not have to be triggered on creation of the record.   You can set conditions on workflow and it will only be triggered once they are meet.   That is usually good enough instead of using a script to attach the workflow.


I want to call the workflow only when assignment group changes and i dont see that option in the conditions.


i see there is a way to specify is , not in... and other options in condition but not the changes()