# Configuring Multiple Instances of WorkflowGen

## Overview <a href="#configuring-multiple-instances-of-workflowgen-overview" id="configuring-multiple-instances-of-workflowgen-overview"></a>

This section describes how to configure multiple instances of WorkflowGen on the **same** web server. Each instance of WorkflowGen also requires a dedicated license. This section assumes that you've already installed separate instances of WorkflowGen as described in the [Setup](https://docs.workflowgen.com/tech/10.0/setup) section.

{% hint style="info" %}
For instructions on how to configure multiple instances of WorkflowGen on **different** servers in a Web Farm setup, see the [Web Farm architecture](https://docs.workflowgen.com/tech/10.0/advanced-configuration/web-farm-architecture) section.
{% endhint %}

## Setup and configuration <a href="#configuring-multiple-instances-of-workflowgen-setup-and-configuration" id="configuring-multiple-instances-of-workflowgen-setup-and-configuration"></a>

To configure multiple instances of WorkflowGen on a single server, perform the steps outlined below. While more than two installations are possible, the following steps assume only two instances are installed.

Before modifying the service, it must be uninstalled using the `winsvc-uninstall.cmd` file found in the `\bin` folder of the application installation (for example, `DRIVE:\Program Files\Advantys\WorkflowGen\Services\bin\winsvc-uninstall.cmd`). Be sure to run it as the administrator of the server.

### WorkflowGen directory synchronization service

For both instances of WorkflowGen, edit the parameter name in the `WfgDirectoriesSyncService.exe.config` WorkflowGen directory synchronization service configuration file as shown in the following examples.

**Instance 1:**

Edit the `DRIVE:\Program Files\Advantys\WorkflowGen1\Services\bin\WfgDirectoriesSyncService.exe.config` file as follows:

```html
<add key="ServiceName" value="WorkflowGenDirSyncService1" />
```

**Instance 2:**

Edit the `DRIVE:\Program Files\Advantys\WorkflowGen2\Services\bin\WfgDirectoriesSyncService.exe.config` file as follows:

```html
<add key="ServiceName" value="WorkflowGenDirSyncService2" />
```

### WorkflowGen engine service

For both instances of WorkflowGen, edit the parameter name in the `WfgWorkflowEngineService.exe.config` WorkflowGen engine service configuration file.

**Instance 1:**&#x20;

Edit the `DRIVE:\Program Files\Advantys\WorkflowGen1\Services\bin\WfgWorkflowEngineService exe.config` file as follows:

```html
<add key="ServiceName" value="WorkflowGenEngineService1" />
```

**Instance 2:**&#x20;

Edit the `DRIVE:\Program Files\Advantys\WorkflowGen2\Services\bin\WfgWorkflowEngineService exe.config file` as follows:

```html
<add key="ServiceName" value="WorkflowGenEngineService2" />
```

## Windows command scripts (install and uninstall of services)

For both instances of WorkflowGen you need to modify the Windows shell scripts that are used to install and uninstall the `WfgDirectoriesSyncService` and `WfgWorkflowEngineService` Windows services as described above.

**Instance 1:**

Install script: `DRIVE:\Program Files\Advantys\WorkflowGen1\Services\bin\winsvc-install.cmd`\
\
Based on the value given for the `ServiceName` parameter defined in the WorkflowGen directory synchronization service section above, your `winsvc-install.cmd` file should appear as follows:

```
%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /i "C:\Program Files\Advantys\WorkflowGen1\Services\bin\WfgDirectoriesSyncService.exe"
net start WorkflowGenDirSyncService1

%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /i "C:\Program Files\Advantys\WorkflowGen1\Services\bin\WfgWorkflowEngineService.exe"
net start WorkflowGenEngineService1

pause
```

Uninstall script: `DRIVE:\Program Files\Advantys\WorkflowGen1\Services\bin\winsvc-uninstall.cmd`\
\
Based on the value given for the `ServiceName` parameter defined in the WorkflowGen directory synchronization service section above, your `winsvc-uninstall.cmd` file should appear as follows:

```
%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /u "C:\Program Files\Advantys\WorkflowGen1\Services\bin\WfgDirectoriesSyncService.exe" /LogFile=

%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /u "C:\Program Files\Advantys\WorkflowGen1\Services\bin\WfgWorkflowEngineService.exe" /LogFile=

pause
```

**Instance 2:**

Install script: `DRIVE:\Program Files\Advantys\WorkflowGen2\Services\bin\winsvc-install.cmd`\
\
Based on the value given for the `ServiceName` parameter defined in the WorkflowGen directory synchronization service section above, your `winsvc-install.cmd` file should appear as follows:

```
%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /i "C:\Program Files\Advantys\WorkflowGen2\Services\bin\WfgDirectoriesSyncService.exe"
net start WorkflowGenDirSyncService2

%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /i "C:\Program Files\Advantys\WorkflowGen2\Services\bin\WfgWorkflowEngineService.exe"
net start WorkflowGenEngineService2

pause
```

Uninstall script: `DRIVE:\Program Files\Advantys\WorkflowGen2\Services\bin\winsvc-uninstall.cmd`\
\
Based on the value given for the `ServiceName` parameter defined in the WorkflowGen directory synchronization service section above, your `winsvc-uninstall.cmd` file should appear as follows:

```
%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /u "C:\Program Files\Advantys\WorkflowGen2\Services\bin\WfgDirectoriesSyncService.exe" /LogFile=

%windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /u "C:\Program Files\Advantys\WorkflowGen2\Services\bin\WfgWorkflowEngineService.exe" /LogFile=

pause
```

### Install the Windows Services

For both instances, you must run the install scripts that have been modified as described above using administrator permissions.

**Instance 1:**

`DRIVE:\Program Files\Advantys\WorkflowGen1\Services\bin\winsvc-install.cmd`

**Instance 2:**

`DRIVE:\Program Files\Advantys\WorkflowGen2\Services\bin\winsvc-install.cmd`
