Workflow needs to run more than once on a record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 07:06 AM
I’m looking for some guidance. We have a orchestration workflow running on the sys_user table to process employee terminations. The workflow is on the sys_user table with conditions and is set to run based on a choice field that set through a transform. The process works great.
We’re having issues with the common use case among contingent workers and consultants, someone is terminated, rehired and terminated again. I understand why the workflow won’t run again until the context is deleted. However, we want to keep the previous context for auditing. Also, we don’t want to have the workflow wait and use a rollback since the offboarding workflow needs to be the published version at the new time.
Question is… what’s the best practice to run a workflow multiple times against a record without removing the previous context.
- Labels:
-
Orchestration
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 07:37 AM
Hi Aran
Both Active and historic workflow contexts, as well as the activities within them, can be viewed using the Live Workflows section of the Workflow application menu - All contexts.
Here you can see all the current and historic workflow contexts the Related record or ID field (depending on your version) will have the record reference it it so you can filter on that.
Regards,
Paul
Regards
Paul

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 08:28 AM
Hi Paul. We see the contexts, the issue is that the workflow won't run again until you delete them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 08:38 AM
Hi,
I hope following thread will help you.
https://community.servicenow.com/community?id=community_question&sys_id=b0888321db5cdbc01dcaf3231f961938
Regards,
Tejal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2019 08:53 AM
Thanks Tejal - I think the restartWorkflow() will restart the same workflow. As an example, if someone is offboarded on Jan 26, 2019 and then brought back June 1, 2019 and then says until 2022 an offboarded again, we want the active published workflow in 2022 to run, not the older version used in 2019. Make sense?