- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 01:33 AM
Hi All,
Is there a way to add dynamically add activities to the playbook at runtime by script?
I can do this by adding an optional activity and then add them during playbook execution manually but wanted to check if there a way to do this automatically.
The requirement is I need too add the activities multiple number of time based on the selection made on the previous activities.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 10:18 AM
We do support this today. Check this out - dev doc on the various Playbook API's that are available, including adding optional activities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 01:36 AM
I don't think this is feasible within playbook.
Activities within playbook can be configured once before publish, you can update and add again new activity later and re-publish again.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 10:18 AM
We do support this today. Check this out - dev doc on the various Playbook API's that are available, including adding optional activities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2025 03:31 PM
Thanks Jason. That worked.
For others reference , there are two namespaces for managing Playbooks through script
sn_playbook - to cancel, restart, trigger playbooks etc.
sn_pad - to activate, deactivate playbooks, add optional activities etc.