Restarting workflow that was completed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 12:06 AM
Hi,
Restarting a workflow is creating a new workflow context is this a expected behavior.
Scenario is that request item was completed(workflow also completed) and workflow was updated. After which the request was reopened again which caused both old version and new version workflow to run at same time creating 2 workflow context to run. Is this a expected behavior, if not how to avoid this scenario.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 12:36 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 12:46 AM
Hi @AshwinV ,
Find the details in belwo servicenow supprot doc:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0713154
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 12:51 AM - edited 07-28-2023 12:52 AM
Hello another way is to cancel the existing workflow and to trigger a new one
sample script below
var wf = new GlideRecord("tablename");
wf.get('sys_id of the record');
var oldwf = new Workflow();
oldwf.cancel(wf);
var newwf = new Workflow();
newwf.startFlow(new Workflow().getWorkflowName('workflowname',wf,'');
Harish