Cancel WorkFlow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 01:36 AM
If I have an Approval WorkFlow in execution and I want to make a button to cancel the flow execution, what method can I use?
workflow.cancel() ?
Will it stop other flows as well?
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 01:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2024 01:43 AM
@ma kaiyue Cancel Workflow method cancels all the workflows attached with a GlideRecord.
Workflow - cancel(GlideRecord record)
Cancels all running workflows on this record by broadcasting the cancel event to activities in all running workflows on this record.
You may wish to use
Workflow - cancelContext(GlideRecord context)
Cancels this running context by broadcasting a cancel event to activities in this workflow context
For more information please refer to https://docs.servicenow.com/bundle/washingtondc-api-reference/page/app-store/dev_portal/API_referenc...