Wait for Service

The Wait for Service action waits for a specific Windows service to start or stop.

Note: The Actions Quick Reference provides a complete list of actions that you can print for easy reference.

Create a Wait for Service action

  1. Ensure that the user who will be running this action is a local administrator and/or the bot is running as an administrator.

  2. If you do not already know the exact name of the service that you want to wait for, find it.

    1. Open the Services window on the computer.

    2. Right-click on the service and select Properties.

    3. Identify the Service name at the top of the Properties window.

  3. In Nintex Bot, on the Actions list, click Computer and select Wait for Service.

  4. Enter the Service name (not the display name). Optionally, click the Magic Wand to use the Expression Builder.

  5. Select to Wait for the Service to start or Service to stop.

  6. In the timing settings, select how long wait for the service to start or stop.

  7. If needed, adjust the Run error task settings to fine tune how the action runs.

    • Run error task: A botflow containing an error task automatically runs the error task in the event of an error. If the botflow does not contain an error task, the botflow stops in the event of an error.
    • Stop on error: The botflow stops in the event of an error.
    • Ignore errors: The action is skipped in the event of an error and the botflow attempts to execute the next action.
  8. (Optional) Add a Note to document special instructions or functionality.

  9. Toggle the run switch to Run and click OK to execute and save the action.

  10. Note: The run switch is set to Run by default. To create or modify this action without executing it, click the slider to change the option to Don't Run.  For more information, go to Action Builder.

When the action is executed, Nintex Bot will first get the names of all services running and then check each one against the name that you set up in the action. If the service is found, then that means that it is running. If the service is not found, then it is not running. Nintex Bot will wait for the service by name, and then depending on the settings, it will succeed or fail.

Here are examples of how the action works, depending on the settings: 

  • If the service is not found and you set up the action to wait to stop, the action was successful.

  • If the service is found and you set up the action to wait to start, the action was successful.

  • Nintex Bot will continue to check for the desired condition until the timing constraints are met or the conditions are met.

    • If the 'Wait for' setting is not satisfied and the condition is not met, Nintex Bot will pause for 500 milliseconds and try again by getting all the services and then comparing the names.

    • If you selected 'Do not wait' in the timing settings, Nintex Bot will only try to find the service once and then return a success or failure message.

    • If you selected to 'Wait up to' a specific time in the timing settings, Nintex Bot will pause for 500 milliseconds and then try again. If the action conditions are met, then it will return a success message. If the action conditions are not met and the timing constraints have been met, the action will return a failure message, or it will continue to retry until the specified wait time has been reached or the condition has been met.

    • If you selected to wait forever in the timing settings, Nintex Bot will continue to attempt to pause for 500 milliseconds and try again by getting all the services and then comparing the names until the conditions are met, the execution is paused or stopped, or the application is closed. This is not recommended.