Share

Bulk cancel Running Workflows in Orchestrator [CB10132]

by Mayank Goyal · 3 Apr 2024

Imagine this scenario: you have a plethora of running workflows in VMWare Aria Automation Orchestration that need to be canceled. Previously, this task might have been time-consuming and tedious, but thanks to the power of REST APIs, I’ve been able to transform this process into a seamless and efficient bulk operation.

With just a few simple API requests, I can initiate the cancellation of numerous workflows, ensuring that I can maintain a high level of orchestration without getting bogged down in manual, repetitive tasks.

You can do the same using a workflow that I have created. Download the package (link below) to get the workflow (“Bulk Cancel Running Workflows”) and follow the process below.

Pass these 3 inputs:

  • Orchestrator FQDN: on which, the workflows are running…of course
  • Bearer Token
  • Date and Time before which all running workflows will be canceled

Once, you pass the input values, Click Run.

Once it is completed, we can go to the other orchestrator (same as provided FQDN) and confirm that all the workflows running before the provided date and time which is 04/03/2024 7:22:00 pm are canceled.

Now, this can be scheduled as well for a previous date and it will auto-cancel workflows that are running since long. You can customize it even further to bypass any particular workflow from cancelling. Also, note that it will not cancel workflows that are waiting for User inputs.

For scheduling this workflow, you would have to create a Wrapper workflow (added in package) that will pass a date to the Date input. For eg. to auto-cancel all workflows that are older than 24 hours, you just create an action (added in package) and pass it to the date variable.

return new Date(new Date(). getTime() - (24 * 60 * 60 * 1000))
JavaScript

That’s all in this post. Until next time, happy orchestrating, everyone!

Package 📦

Link: Find it here on GitHub.

Content:

  • Bulk Cancel Running Workflows
  • [Schedulable] – Cancel Running workflows older than 24 hours
  • Cancel a running workflow
  • getDate24hoursAgoAction
  • cancelARunningWorkflow


Discover more from Cloud Blogger

Subscribe to get the latest posts sent to your email.

You may also like