npm package: @itentialopensource/find-tasks-in-workflow-collection
Description: Pre-Built to find tasks and their counts in workflow collection
Author: Itential Artifacts
Latest version: 0.0.11-2023.1.0

<!-- This is a comment in md (Markdown) format, it will not be visible to the end user -->

<!-- Update the below line with your Pre-Built name -->
# Find Tasks In Workflow Collection

<!-- Leave TOC intact unless you've added or removed headers -->
## Table of Contents

* [Overview](#overview)
* [Installation Prerequisites](#installation-prerequisites)
* [Requirements](#requirements)
* [Features](#features)
* [Future Enhancement](#Future Enhancement)
* [How to Install](#how-to-install)
* [How to Run](#how-to-run)
* [Additional Information](additional-information)

## Overview
This Pre-Built Automation allows users to check which workflows are using the provided tasks and how many times are they being used in those workflows.
An important use case would be, when migrating to a higher version of Itential Automation Platform, a user can run this Pre-Built to check if certain tasks that have been deprecated are being used in any of the Workflows.

<!-- Write a few sentences about the Pre-Built and explain the use case(s) -->
<!-- Avoid using the word Artifact. Please use Pre-Built, Pre-Built Transformation or Pre-Built Automation -->
<!-- Ex.: The Migration Wizard enables IAP users to conveniently move their automation use cases between different IAP environments -->
<!-- (e.g. from Dev to Pre-Production or from Lab to Production). -->

<!-- Workflow(s) Image Placeholder - TO BE ADDED DIRECTLY TO GitLab -->
<!-- REPLACE COMMENT BELOW WITH IMAGE OF YOUR MAIN WORKFLOW -->

<table><tr><td>
	<img src="./images/workflow.png" alt="workflow" width="800px">
</td></tr></table>

<!-- REPLACE COMMENT ABOVE WITH IMAGE OF YOUR MAIN WORKFLOW -->

<!-- ADD ESTIMATED RUN TIME HERE -->
<!-- e.g. Estimated Run Time: 34 min. -->
_Estimated Run Time_: 5 minutes

## Installation Prerequisites

Users must satisfy the following pre-requisites:

<!-- Include any other required apps or adapters in this list -->
<!-- Ex.: EC2 Adapter -->
* Itential Automation Platform
  * `^2022.1`

## Features

 * Allows the use to check which workflows are using the tasks without direct Mongo access.
 * Provide the number of times each of the provided task is being used in each of the workflows.
 * Error handling for when the users session is invalid. The workflow reinitiates a login before continuing.
 * User readable report to easily find out which workflows have the tasks in question and how many times.

<!-- Unordered list highlighting the most exciting features of the Pre-Built -->
<!-- EXAMPLE -->
<!-- * Automatically checks for device type -->
<!-- * Displays dry-run to user (asking for confirmation) prior to pushing config to the device -->
<!-- * Verifies downloaded file integrity (using md5), will try to download again if failed -->

## Future Enhancement

 * The prebuilt should be able to process any Workflow name containing "\" which in current version apears in the ignored list. 

## How to Install

To install the Pre-Built:

* Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the [Requirements](#requirements) section in order to install the Pre-Built. 
* The Pre-Built can be installed from within App-Admin_Essential. Simply search for the name of your desired Pre-Built and click the install button (as shown below).

<!-- REPLACE BELOW WITH IMAGE OF YOUR PUBLISHED PRE-BUILT -->

<table><tr><td>
  <img src="./images/install.png" alt="install" width="600px">
</td></tr></table>

<!-- REPLACE ABOVE WITH IMAGE OF YOUR PUBLISHED PRE-BUILT -->

<!-- OPTIONAL - Explain if external components are required outside of IAP -->
<!-- Ex.: The Ansible roles required for this Pre-Built can be found in the repository located at https://gitlab.com/itentialopensource/pre-built-automations/hello-world -->

## How to Run

Use the following to run the Pre-Built:

<!-- Explain the main entrypoint(s) for this Pre-Built: Automation Catalog item, Workflow, Postman, etc. -->

1. In Automation Catalog, find the **Find Tasks In Workflow Collection** entry.
2. Fill out the form (as shown below) with the appropriate values.
<table><tr><td>
  <img src="./images/form.png" alt="form" width="300px">
</td></tr></table>
3. You will see the Report on completion of the workflow. Once the information has been verified, you can complete the workflow by clicking on End Job.
<table><tr><td>
  <img src="./images/report.png" alt="report" width="300px">
</td></tr></table>

## Additional Information

Please use your Itential Customer Success account if you need support when using this Pre-Built.