Product documentation Docs
    • English
    • Deutsch
    • 日本語
    • 한국어
    • Français
  • More Sites
    • Now Community
    • Developer Site
    • Knowledge Base
    • Product Information
    • ServiceNow.com
    • Training
    • Customer Success Center
    • ServiceNow Support Videos
  • Log in

Product documentation

  • Home
How search works:
  • Punctuation and capital letters are ignored
  • Special characters like underscores (_) are removed
  • Known synonyms are applied
  • The most relevant topics (based on weighting and matching to search terms) are listed first in search results
Topics are ranked in search results by how closely they match your search terms
  • A match on the entire phrase you typed
  • A match on part of the phrase you typed
  • A match on ALL of the terms in the phrase you typed
  • A match on ANY of the terms in the phrase you typed

Note: Matches in titles are always highly ranked.

  • Release version
    Table of Contents
    • Now Platform capabilities
Table of Contents
Choose your release version
    Home London Platform Capabilities Now Platform capabilities Workflow Workflow activities Workflow activities reference Subflow activities in workflow Parallel Flow Launcher workflow activity

    Parallel Flow Launcher workflow activity

    • Save as PDF Selected topic Topic & subtopics All topics in contents
    • Unsubscribe Log in to subscribe to topics and get notified when content changes.
    • Share this page

    Parallel Flow Launcher workflow activity

    The Parallel Flow Launcher activity launches multiple subflows in parallel.

    Workflows running in parallel execute simultaneously and may complete in any order. The activity can launch a single subflow or multiple subflows as needed. You can manage the input values and values returned for each subflow.
    Note: The Parallel Flow Launcher activity waits until all subflows are completed before proceeding. If any subflow does not finish, the activity waits indefinitely.
    Note: Do not launch a large number of subflows with the Parallel Flow Launcher activity. If overused, this activity can overburden the instance. For launching very large numbers of subflows, consider putting the Parallel Flow Launcher inside a loop controlled by a turnstile or other conditional activity and having it do batches.

    Activity variables

    Activity variables determine the initial behavior of the activity.

    Table 1. Parallel Flow Launcher activity input variables
    Field Description
    Parallel Flow Launcher configuration
    Name A unique name for the activity.
    Stage The stage to display when the workflow reaches the activity.
    Inputs Inputs to the subflows to run. Specify an array of name: value pairs for each input defined in the workflow being launched. The name and data type of each input variable entered must match those used by the subflow that this activity launches. For a detailed example, see Parallel Flow Launcher Example.
    Parallel Flow Launcher selection
    Workflow The workflow to run.
    Advanced Check Advanced, to enter a script that uses a WorkflowCoordinator object to manage the subflows. When you check Advanced, a text box appears where you can enter a script that specifies a unique workflow for each set of input variables. See WorkflowCoordinator object for more information.
    Parallel Flow Launcher iteration

    Specify parameters to tune the performance of batched workflows.

    Count If not specified by an input set, Count determines the number of subflows executed in parallel from this activity. If the Advanced option is not selected, ensure that this field is populated with a valid number.
    Max flows The maximum number of workflows this activity can launch. If this value is a positive integer, it overrides the max parameter used in the WorkflowCoordinator constructor.
    Max simultaneous The maximum number of parallel workflows this activity can run at one time. If this value is a positive integer, it overrides the poolsize parameter used in the WorkflowCoordinator constructor.
    Parallel Flow Launcher Process
    Process flow complete To specify a script that runs after each subflow completes, check Process flow complete. If you check this field, a text box labelled Flow complete appears, where you can enter the script to run.
    Flow complete The script that runs each time a subflow finishes. This field is available when the Process flow complete option is selected.

    The same script functions and variables available in other workflow scripts, such as those in the Run Script activity, are available here. For more information, see Completed subflow values in scripts.

    The variable "flow" is available to this script. It is an object that contains the following information about the flow that is finishing:

    flow.output (String): The value that the subflow returns to the parent if it executed a Return Value activity before ending.

    flow.index (Number): The zero-relative index of the subflow that finished.

    flow.contextId (String): The sys_id of the workflow context for the completed subflow.

    flow.inputs (Object): The inputs that were passed to the subflow when its context was created and started.

    flow.status (String): The final state of the context. This corresponds to the state column in the subflow context record, which has possible values of executing, finished, cancelled, or faulted. (Since the flow is completed, it cannot be executing at this point.)

    Parallel Flow Launcher Split
    Process finished To specify a script that runs after all subflows have finished, check Process finished. If you check this field, a text box labelled Finished Script appears where you can enter the script to run. The ‘coordinator’ variable is made available to this script and is an object that allows access to any of the finished subflows using the getFlow(index) method. For example:
    for (var i = 0; i < coordinator.getNumFlows(); i++) 
    writeFlowResultsToTable( i, coordinator.getFlow(i) );
    Finished script The script that runs after all subflows launched by the activity are complete. You can use variables that contain completed flow information in this script.

    The ‘coordinator’ variable is made available to this script and is an object that allows access to any of the finished subflows using the getFlow(index) method. For example:

    for (var i = 0; i < coordinator.getNumFlows(); i++) 
    writeFlowResultsToTable( i, coordinator.getFlow(i) );
    This field is available when Process finished is selected.

    States

    The activity state tells the workflow engine what to do with the activity. To view an activity's state, point to the activity. A pop-up window shows the State and Result of the activity. If the activity is in an error state, the pop-up window provides a brief Fault Description.

    Table 2. Parallel Flow Launcher activity states
    State Description
    Waiting The activity is waiting for all subflows to finish. All subflows have started and some may have finished.
    Finished The activity successfully completed all of the subflows.
    Error The activity encountered an error.
    • WorkflowCoordinator object

      A WorkflowCoordinator object specifies which subflows to run and the input variables to pass to those subflows.

    • Completed subflow values in scripts

      The Parallel Flow Launcher activity exposes additional variables you can use in scripts.

    • Parallel Flow Launcher example

      This example shows how to use the Parallel Flow Launcher activity with an array of input values and with a WorkflowCoordinator object.

    • Workflows used as subflows

      A workflow can launch another workflow as an activity.

    Tags:

    Feedback
    On this page

    Previous topic

    Next topic

    • Contact Us
    • Careers
    • Terms of Use
    • Privacy Statement
    • Sitemap
    • © ServiceNow. All rights reserved.

    Release version
    Choose your release version

      Parallel Flow Launcher workflow activity

      • Save as PDF Selected topic Topic & subtopics All topics in contents
      • Unsubscribe Log in to subscribe to topics and get notified when content changes.
      • Share this page

      Parallel Flow Launcher workflow activity

      The Parallel Flow Launcher activity launches multiple subflows in parallel.

      Workflows running in parallel execute simultaneously and may complete in any order. The activity can launch a single subflow or multiple subflows as needed. You can manage the input values and values returned for each subflow.
      Note: The Parallel Flow Launcher activity waits until all subflows are completed before proceeding. If any subflow does not finish, the activity waits indefinitely.
      Note: Do not launch a large number of subflows with the Parallel Flow Launcher activity. If overused, this activity can overburden the instance. For launching very large numbers of subflows, consider putting the Parallel Flow Launcher inside a loop controlled by a turnstile or other conditional activity and having it do batches.

      Activity variables

      Activity variables determine the initial behavior of the activity.

      Table 1. Parallel Flow Launcher activity input variables
      Field Description
      Parallel Flow Launcher configuration
      Name A unique name for the activity.
      Stage The stage to display when the workflow reaches the activity.
      Inputs Inputs to the subflows to run. Specify an array of name: value pairs for each input defined in the workflow being launched. The name and data type of each input variable entered must match those used by the subflow that this activity launches. For a detailed example, see Parallel Flow Launcher Example.
      Parallel Flow Launcher selection
      Workflow The workflow to run.
      Advanced Check Advanced, to enter a script that uses a WorkflowCoordinator object to manage the subflows. When you check Advanced, a text box appears where you can enter a script that specifies a unique workflow for each set of input variables. See WorkflowCoordinator object for more information.
      Parallel Flow Launcher iteration

      Specify parameters to tune the performance of batched workflows.

      Count If not specified by an input set, Count determines the number of subflows executed in parallel from this activity. If the Advanced option is not selected, ensure that this field is populated with a valid number.
      Max flows The maximum number of workflows this activity can launch. If this value is a positive integer, it overrides the max parameter used in the WorkflowCoordinator constructor.
      Max simultaneous The maximum number of parallel workflows this activity can run at one time. If this value is a positive integer, it overrides the poolsize parameter used in the WorkflowCoordinator constructor.
      Parallel Flow Launcher Process
      Process flow complete To specify a script that runs after each subflow completes, check Process flow complete. If you check this field, a text box labelled Flow complete appears, where you can enter the script to run.
      Flow complete The script that runs each time a subflow finishes. This field is available when the Process flow complete option is selected.

      The same script functions and variables available in other workflow scripts, such as those in the Run Script activity, are available here. For more information, see Completed subflow values in scripts.

      The variable "flow" is available to this script. It is an object that contains the following information about the flow that is finishing:

      flow.output (String): The value that the subflow returns to the parent if it executed a Return Value activity before ending.

      flow.index (Number): The zero-relative index of the subflow that finished.

      flow.contextId (String): The sys_id of the workflow context for the completed subflow.

      flow.inputs (Object): The inputs that were passed to the subflow when its context was created and started.

      flow.status (String): The final state of the context. This corresponds to the state column in the subflow context record, which has possible values of executing, finished, cancelled, or faulted. (Since the flow is completed, it cannot be executing at this point.)

      Parallel Flow Launcher Split
      Process finished To specify a script that runs after all subflows have finished, check Process finished. If you check this field, a text box labelled Finished Script appears where you can enter the script to run. The ‘coordinator’ variable is made available to this script and is an object that allows access to any of the finished subflows using the getFlow(index) method. For example:
      for (var i = 0; i < coordinator.getNumFlows(); i++) 
      writeFlowResultsToTable( i, coordinator.getFlow(i) );
      Finished script The script that runs after all subflows launched by the activity are complete. You can use variables that contain completed flow information in this script.

      The ‘coordinator’ variable is made available to this script and is an object that allows access to any of the finished subflows using the getFlow(index) method. For example:

      for (var i = 0; i < coordinator.getNumFlows(); i++) 
      writeFlowResultsToTable( i, coordinator.getFlow(i) );
      This field is available when Process finished is selected.

      States

      The activity state tells the workflow engine what to do with the activity. To view an activity's state, point to the activity. A pop-up window shows the State and Result of the activity. If the activity is in an error state, the pop-up window provides a brief Fault Description.

      Table 2. Parallel Flow Launcher activity states
      State Description
      Waiting The activity is waiting for all subflows to finish. All subflows have started and some may have finished.
      Finished The activity successfully completed all of the subflows.
      Error The activity encountered an error.
      • WorkflowCoordinator object

        A WorkflowCoordinator object specifies which subflows to run and the input variables to pass to those subflows.

      • Completed subflow values in scripts

        The Parallel Flow Launcher activity exposes additional variables you can use in scripts.

      • Parallel Flow Launcher example

        This example shows how to use the Parallel Flow Launcher activity with an array of input values and with a WorkflowCoordinator object.

      • Workflows used as subflows

        A workflow can launch another workflow as an activity.

      Tags:

      Feedback

          Share this page

          Got it! Feel free to add a comment
          To share your product suggestions, visit the Idea Portal.
          Please let us know how to improve this content

          Check any that apply

          To share your product suggestions, visit the Idea Portal.
          Confirm

          We were unable to find "Coaching" in Jakarta. Would you like to search instead?

          No Yes
          • Contact Us
          • Careers
          • Terms of Use
          • Privacy Statement
          • Sitemap
          • © ServiceNow. All rights reserved.

          Subscribe Subscribed Unsubscribe Last updated: Tags: January February March April May June July August September October November December No Results Found Versions Search preferences successfully updated My release version successfully updated My release version successfully deleted An error has occurred. Please try again later. You have been unsubscribed from all topics. You are now subscribed to and will receive notifications if any changes are made to this page. You have been unsubscribed from this content Thank you for your feedback. Form temporarily unavailable. Please try again or contact  docfeedback@servicenow.com  to submit your comments. The topic you requested does not exist in the release. You were redirected to a related topic instead. The available release versions for this topic are listed There is no specific version for this documentation. Explore products Click to go to the page. Release notes and upgrades Click to open the dropdown menu. Delete Remove No selected version Reset This field is required You are already subscribed to this topic Attach screenshot The file you uploaded exceeds the allowed file size of 20MB. Please try again with a smaller file. Please complete the reCAPTCHA step to attach a screenshot
          Log in to personalize your search results and subscribe to topics
          No, thanks Login