Skip to content

Conversation

@MYaswanth28
Copy link
Contributor

PR Description:

Dynamic Catalog Task Generator - The primary goal is to decouple complex task creation logic from the visual Flow Designer or Workflow canvas. Instead of using numerous branches and conditional activities within a flow, this script centralizes the rules for task fulfillment.

Pull Request Checklist

Overview

  • Put an x inside of the square brackets to check each item.
  • [ x] I have read and understood the CONTRIBUTING.md guidelines
  • [ x] My pull request has a descriptive title that accurately reflects the changes and the description has been filled in above.
  • [ x] I've included only files relevant to the changes described in the PR title and description
  • [ x] I've created a new branch in my forked repository for this contribution

Code Quality

  • [x ] My code is relevant to ServiceNow developers
  • [ x] My code snippets expand meaningfully on official ServiceNow documentation (if applicable)
  • [ x] I've disclosed use of ES2021 features (if applicable)
  • [ x] I've tested my code snippets in a ServiceNow environment (where possible)

Repository Structure Compliance

  • [ x] I've placed my code snippet(s) in one of the required top-level categories:
    • Core ServiceNow APIs/
    • Server-Side Components/
    • Client-Side Components/
    • Modern Development/
    • Integration/
    • Specialized Areas/
  • [ x] I've used appropriate sub-categories within the top-level categories
  • [ x] Each code snippet has its own folder with a descriptive name

Documentation

  • [ x] I've included a README.md file for each code snippet
  • [ x] The README.md includes:
    • Description of the code snippet functionality
    • Usage instructions or examples
    • Any prerequisites or dependencies
    • (Optional) Screenshots or diagrams if helpful

Restrictions

  • [ x] My PR does not include XML exports of ServiceNow records
  • [x ] My PR does not contain sensitive information (passwords, API keys, tokens)
  • [x ] My PR does not include changes that fall outside the described scope

@rohi-v rohi-v self-assigned this Oct 15, 2025
@rohi-v
Copy link
Contributor

rohi-v commented Oct 15, 2025

HI @MYaswanth28

Thank You for the contribution.

Code looks good. However, if the requirement is simply to create catalog tasks based on conditions, the OOTB “Create Catalog Task” action can handle this more easily.

With this script, we would need to create a separate action to call the Script Include and add separate wait conditions for task completion, which makes the overall solution more complex. Additionally, this approach doesn’t support multiple “AND”/OR" conditions easily which limits flexibility in more advanced scenarios.

Let me know your thoughts on this.

@MYaswanth28
Copy link
Contributor Author

MYaswanth28 commented Oct 16, 2025

@rohi-v The CatalogTaskGenerator script is not intended to replace simple OOTB conditional task creation. It solves problems that the standard OOTB actions struggle with

If a user selects 10 servers in a Multi-Row Variable Set (MRVS), the OOTB action requires a loop and separate task creation within a subflow or custom action. The Script Include can easily loop through the MRVS data and call the same _createTask helper function 10 times in a single step.

@rohi-v
Copy link
Contributor

rohi-v commented Oct 16, 2025

Understood @MYaswanth28

The call of script include still require custom action but I understand what you're talking about.

Can you please add that point in the readme file too so that its used only when intended and not for every workflow/flowS

@MYaswanth28
Copy link
Contributor Author

Updated Now @rohi-v

@rohi-v rohi-v merged commit 48e315a into ServiceNowDevProgram:main Oct 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants