> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# xgWait Command

Last updated on Dec 22, 2025

If you need to wait for processing of one portion of the script to complete before processing the next, you should insert an xgWait command. When an xgWait command is encountered, Incredibuild does not proceed before receiving confirmation that the previous statement or group of statements have completed.

The xgWait.exe tool can be used to pause execution until all tasks with a given group identifier have completed. This allows creating dependencies between different execution parts in the script.

**Note:** xgWait is not relevant for Automatic Interception interface.

### **Usage**

```
xgWait /group=<group[,group2,group3,...]> [/exitcode=<#|highest|lowest>] [/silent] [/all]
```

### **Command Line Options**

| Option    | Function                                                                                        | Notes                                                                                                                                                                                                        |
| --------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| /group    | The identifiers of the Groups to wait for.(To wait for all Groups, use /all instead of /group.) |                                                                                                                                                                                                              |
| /exitcode | Specifies the Exit code that xgWait.exe is to return once all tasks have completed.             | Specify "highest" or "lowest" in order to return the highest or lowest exit code of all codes returned by the task processes, or specify a fixed numeric value.                                              |
| /silent   | To prevent xgWait.exe from writing to the standard output. .                                    |                                                                                                                                                                                                              |
| /all      | To wait until all tasks in all Groups have completed.                                           | xgWait.exe /all is implicitly called at the end of the script/application's execution, in order to allow all tasks submitted with xgSubmit.exe to complete before returning control to the initiating Agent. |
