# List of Commands

## `login`

The `login` command lets you add your WorkflowGen credentials to authorize the CLI. The CLI supports basic and Open ID Connect authentication.&#x20;

#### Basic or Integrated Windows authentication

```
wfg login [WORKFLOWGEN_URL] -u [WORKFLOWGEN_USERNAME] -p [WORKFLOWGEN_PASSWORD] --password-file [PASSWORD_PATH] -c [CONTEXT_NAME]
```

{% hint style="info" %}
Basic and Integrated Windows authentication are available since WorkflowGen version 7.0.0.
{% endhint %}

#### Auth0 authentication

```
wfg login [WORKFLOWGEN_URL] --authentication-mode AUTH0 --domain [DOMAIN] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
Auth0 authentication is available since WorkflowGen version 7.11.0.
{% endhint %}

#### MSIDV2 (Microsoft Identity Platform v2) authentication

```
wfg login [WORKFLOWGEN_URL] --authentication-mode MSIDV2 --tenant-id [TENANT_ID] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
MSIDV2 authentication is available since WorkflowGen version 7.16.0.
{% endhint %}

{% hint style="warning" %}
For **MSIDV2** mode, you must first have registered a new dedicated application (`server-side application`) in your Azure Active Directory and on your WorkflowGen server by following the instructions in the [Microsoft Entra ID Configuration for Server-Side Scripts](https://docs.advantys.com/docs/azure/azure-active-directory-configuration-for-server-side-scripts) section in the [WorkflowGen for Azure](https://docs.advantys.com/docs/azure) guide.

All of the operations invoked from the WorkflowGen CLI will therefore use the user account specific in the `Impersonate username` field of the `Non-interactive client` application associated to the WorkflowGen CLI in WorkflowGen.
{% endhint %}

#### Okta authentication

```
wfg login [WORKFLOWGEN_URL] --authentication-mode OKTA --metadata-url [METADATA_URL] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
Okta authentication is available since WorkflowGen version 7.13.0.
{% endhint %}

#### AD FS authentication

```
wfg login [WORKFLOWGEN_URL] --authentication-mode ADFS --domain [DOMAIN] --client-id [CLIENT_ID] --client-secret [CLIENT_SECRET] -c [CONTEXT_NAME]
```

{% hint style="info" %}
AD FS authentication is available since WorkflowGen 7.11.0.
{% endhint %}

#### Argument

| **Name** | **Type** | **Description** | **Behavior** |
| -------- | -------- | --------------- | ------------ |
| `url`    | String   | WorkflowGen URL | Required     |

#### Options

| **Alias**               | **Type** | **Description**                                                                              | **Default value**                          | **Behavior** |
| ----------------------- | -------- | -------------------------------------------------------------------------------------------- | ------------------------------------------ | ------------ |
| `--username` or `-u`    | String   | WorkflowGen username                                                                         | None                                       | Required     |
| `--password` or `-p`    | String   | WorkflowGen password                                                                         | None                                       | Optional     |
| `--webforms` or `-w`    | String   | Webforms path                                                                                | `C:\inetpub\wwwroot\wfgen\wfapps\webforms` | Optional     |
| `--context` or `-c`     | String   | Context name                                                                                 | `DEFAULT`                                  | Optional     |
| `--authentication-mode` | String   | Authentication mode (`BASIC`, `AUTH0`, `MSIDV2`, `ADFS`, `OKTA`)                             | `BASIC`                                    | Optional     |
| `--client-id`           | String   | Client's public identifier                                                                   | None                                       | Optional     |
| `--domain`              | String   | `ADFS` or `AUTH0` domain                                                                     | None                                       | Optional     |
| `--tenant-id`           | String   | `MSIDV2` tenant ID                                                                           | None                                       | Optional     |
| `--metadata-url`        | String   | `OKTA` metadata URL                                                                          | None                                       | Optional     |
| `--client-secret`       | String   | Data known only to the application and the authorization server                              | None                                       | Optional     |
| `--client-secret-file`  | String   | File containing the client secret known only to the application and the authorization server | None                                       | Optional     |
| `--port`                | String   | WorkflowGen port                                                                             | None                                       |              |

#### 📌 Basic authentication login e**xamples**

```
wfg login http://localhost/wfgen -u wfgen_admin -p myPassword
```

```
wfg login http://localhost/wfgen -u wfgen_admin --password-file ./path/to/password.txt
```

#### 📌 **Auth0 login examples**

```
wfg login http://localhost/wfgen --authentication-mode AUTH0 --domain myDomain.auth0.com --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode AUTH0
```

#### 📌 MSIDV2 login examples

```
wfg login http://localhost/wfgen --authentication-mode MSIDV2 --tenant-id myTenantId --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode MSIDV2 --tenant-id myTenantId --client-id myClientId --client-secret myClientSecret
```

#### 📌 Okta login examples

```
wfg login http://localhost/wfgen --authentication-mode OKTA --metadata-url https://MyOktaDomain/.well-known/openid-configuration --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode OKTA --metadata-url https://MyOktaDomain/.well-known/openid-configuration --client-id myClientId --client-secret myClientSecret
```

#### 📌 AD FS login examples

```
wfg login http://localhost/wfgen --authentication-mode ADFS --domain myAdfsDomain --client-id myClientId
```

```
wfg login http://localhost/wfgen --authentication-mode ADFS --domain myAdfsDomain --client-id myClientId --client-secret myClientSecret
```

## `config`

The `config` command lets you configure the CLI.&#x20;

{% hint style="info" %}
Available since WorkflowGen version 7.0.0.
{% endhint %}

### `current-context`

Displays the current context.

#### **Usage**

```
wfg config current-context
```

### `delete-context`

Deletes the specified context from the configuration.

#### **Usage**

```
wfg config delete-context [CONTEXT_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` represents the name given to the CLI context that contains your server and user information.
{% endhint %}

#### **Argument**

| **Name** | **Type** | **Description**               | **Behavior** |
| -------- | -------- | ----------------------------- | ------------ |
| `name`   | String   | Name of the context to delete | Required     |

#### 📌 Example

```
wfg config delete-context WFGEN_PROD
```

### `delete-server`

Deletes the specified server from the configuration.

#### **Usage**

```
wfg config delete-server [SERVER_NAME] --force
```

#### **Argument**

| **Name** | **Type** | **Description**              | **Behavior** |
| -------- | -------- | ---------------------------- | ------------ |
| `name`   | String   | Name of the server to delete | Required     |

#### **Option**

| **Alias**         | **Type** | **Description**                                          | **Default value** | **Behavior** |
| ----------------- | -------- | -------------------------------------------------------- | ----------------- | ------------ |
| `--force` or `-f` | Boolean  | Force the server deletion and delete associated contexts | `false`           | Optional     |

#### 📌 Example

```
wfg config delete-server WFGEN_PROD_SERVER --force
```

### `delete-user`

Deletes the specified user from the configuration.

#### **Usage**

```
wfg config delete-user [USER_NAME] --force
```

#### **Argument**

| **Name** | **Type** | **Description**            | **Behavior** |
| -------- | -------- | -------------------------- | ------------ |
| `name`   | String   | Name of the user to delete | Required     |

#### **Option**

| **Alias**         | **Type** | **Description**                                          | **Default value** | **Behavior** |
| ----------------- | -------- | -------------------------------------------------------- | ----------------- | ------------ |
| `--force` or `-f` | Boolean  | Forces the user deletion and deletes associated contexts | `false`           | Optional     |

#### 📌 Example

```
wfg config delete-user ADMIN_PROD_ACCOUNT --force
```

### `get-contexts`

Describes one or several contexts.

#### **Usage**

```
wfg config get-contexts [CONTEXT_NAME1] [CONTEXT_NAME2] [CONTEXT_NAME3]
```

{% hint style="info" %}
`[CONTEXT_NAME]` represents the name given to the CLI context that contains your server and user information.
{% endhint %}

#### **Argument**

| **Name** | **Type** | **Description**              | **Behavior** |
| -------- | -------- | ---------------------------- | ------------ |
| `names`  | String   | Name(s) of context(s) to get | Optional     |

#### 📌 Example

```
wfg config get-contexts WFGEN_PROD
```

### `get-servers`

Displays servers defined in the configuration.

#### **Usage**

```
wfg config get-servers
```

### `get-users`

Displays users defined in the configuration.

#### **Usage**

```
wfg config get-users
```

### `rename-context`

Renames a context in the configuration.

#### **Usage**

```
wfg config rename-context [CONTEXT_OLD_NAME] [CONTEXT_NEW_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` represents the name given to the CLI context that contains your server and user information.
{% endhint %}

#### **Arguments**

| **Name**   | **Type** | **Description**        | **Behavior** |
| ---------- | -------- | ---------------------- | ------------ |
| `old-name` | String   | Context name to rename | Required     |
| `new-name` | String   | New context name       | Required     |

#### 📌 Example

```
wfg config rename-context WFGEN_PROD WFGEN_DEV
```

### `rename-server`

Renames a server in the configuration.

#### **Usage**

```
wfg config rename-server [SERVER_OLD_NAME] [SERVER_NEW_NAME]
```

#### **Arguments**

| **Name**   | **Type** | **Description**       | **Behavior** |
| ---------- | -------- | --------------------- | ------------ |
| `old-name` | String   | Server name to rename | Required     |
| `new-name` | String   | New server name       | Required     |

#### 📌 Example

```
wfg config rename-server WFGEN_PROD_SERVER WFGEN_DEV_SERVER
```

### `rename-user`

Renames a user in the configuration.

#### **Usage**

```
wfg config rename-user [USER_OLD_NAME] [USER_NEW_NAME]
```

#### **Arguments**

| **Name**        | **Type** | **Description**    | **Behavior** |
| --------------- | -------- | ------------------ | ------------ |
| `USER_OLD_NAME` | String   | Username to rename | Required     |
| `USER_NEW_NAME` | String   | New username       | Required     |

#### 📌 Example

```
wfg config rename-user ADMIN_PROD_ACCOUNT ADMIN_DEV_ACCOUNT
```

### `set-context`

Sets a context entry in the configuration.

#### **Usage**

```
wfg config set-context [CONTEXT_NAME] --server [SERVER_NAME] --user [USER_NAME]
```

{% hint style="info" %}
`[CONTEXT_NAME]` represents the name given to the CLI context that contains your server and user information.
{% endhint %}

#### **Argument**

| **Name** | **Type** | **Description** | **Behavior** |
| -------- | -------- | --------------- | ------------ |
| `name`   | String   | Context name    | Required     |

#### **Options**

| **Alias**          | **Type** | **Description** | **Default value** | **Behavior** |
| ------------------ | -------- | --------------- | ----------------- | ------------ |
| `--server` or `-s` | String   | Server name     | None              | Required     |
| `--user` or `-u`   | String   | Username        | None              | Required     |

#### 📌 Example

```
wfg config set-context WFGEN_PROD --server WFGEN_PROD_SERVER --user ADMIN_PROD_ACCOUNT
```

### `set-server`

Sets a server entry in the configuration.

#### **Usage**

```
wfg config set-server [SERVER_NAME] --url [URL] --version [SERVER_VERSION]
```

#### **Argument**

| **Name** | **Type** | **Description** | **Behavior** |
| -------- | -------- | --------------- | ------------ |
| `name`   | String   | Server name     | Required     |

#### **Options**

| **Alias**            | **Type** | **Description**           | **Default value** | **Behavior** |
| -------------------- | -------- | ------------------------- | ----------------- | ------------ |
| `--url` or `-u`      | String   | WorkflowGen URL           | None              | Optional     |
| `--webforms` or `-w` | String   | WorkflowGen webforms path | None              | Optional     |
| `--version` or `-v`  | String   | WorkflowGen version       | None              | Optional     |

#### 📌 Example

```
wfg config set-server WFGEN_PROD_SERVER --url http://localhost/wfgen/admin --version 7.22.0
```

### `set-user`

Sets a user entry in the configuration.

#### Usage

```
wfg config set-user [USER_NAME] --username [USER_USERNAME] --password [USER_PASSWORD]
```

#### **Argument**

| **Name** | **Type** | **Description** | **Behavior** |
| -------- | -------- | --------------- | ------------ |
| `name`   | String   | Username        | Required     |

#### **Options**

| **Alias**            | **Type** | **Description**      | **Default value** | **Behavior** |
| -------------------- | -------- | -------------------- | ----------------- | ------------ |
| `--username` or `-u` | String   | WorkflowGen username | None              | Required     |
| `--password` or `-w` | String   | WorkflowGen password | None              | Required     |

#### 📌 Example

```
wfg config set-user ADMIN_PROD_ACCOUNT --username wfgen_admin --password QWRtaW4xMjMh
```

### `use-context`

Sets the current context in the configuration.

#### Usage

```
wfg config use-context [CONTEXT_NAME]
```

#### **Argument**

| **Name** | **Type** | **Description** | **Behavior** |
| -------- | -------- | --------------- | ------------ |
| `name`   | String   | Context name    | Required     |

#### 📌 Example

```
wfg config use-context WFGEN_PROD
```

{% hint style="info" %}
`[CONTEXT_NAME]` represent the name given to the CLI context that contains your server and user information.
{% endhint %}

## `project`

The `project` command lets you either export or import an entire WorkflowGen project from a manifest.&#x20;

{% hint style="info" %}
Available since WorkflowGen version 7.17.0.
{% endhint %}

### `init`

The `init` command allow you to generate a `manifest.json` file interactively.

**Usage**

```
wfg project init --path projectPath
```

**Options**

| **Alias**         | **Type** | **Description**                                                | **Default value** | **Behavior** |
| ----------------- | -------- | -------------------------------------------------------------- | ----------------- | ------------ |
| `--path` or `-p`  | String   | Directory path where the project will be initialized           | Current directory | Optional     |
| `--bare`          | Boolean  | Generates a `manifest.json` file with the bare minimum content | `false`           | Optional     |
| `--force` or `-f` | Boolean  | Forces the `manifest.json` generation                          | `false`           | Optional     |

#### &#x20;📌 Examples

```
wfg project init --path ./MyProject
```

```
wfg project init --path ./MyProject --bare --force
```

### `export`

Exports a project from your WorkflowGen server to a local repository.

#### **Usage**

```
wfg project export --path [PROJECT_PATH]
```

#### **Option**

| **Alias**        | **Type** | **Description**                                                    | **Default value** | **Behavior** |
| ---------------- | -------- | ------------------------------------------------------------------ | ----------------- | ------------ |
| `--path` or `-p` | String   | Path to folder where the project's manifest and files are located. | Current directory | Optional     |

#### 📌 Example

```
wfg project export --path ./MyProject
```

### `import`

Imports a project from a local repository to your WorkflowGen server.

#### **Usage**

```
wfg project import --source [PATH] --force
```

#### **Options**

| **Alias**          | **Type** | **Description**                                              | **Default value** | **Behavior** |
| ------------------ | -------- | ------------------------------------------------------------ | ----------------- | ------------ |
| `--source` or `-s` | String   | Project path                                                 | Current directory | Optional     |
| `--force` or `-f`  | Boolean  | Updates the project's existing global lists and applications | `false`           | Optional     |

#### 📌 Example

```
wfg project import --source c:\repository
```

### `show`

Displays the content of a manifest link to a project.

**Usage**

```
wfg project show --path [PROJECT_PATH]
```

#### **Option**

| **Alias**        | **Type** | **Description** | **Default value** | **Behavior** |
| ---------------- | -------- | --------------- | ----------------- | ------------ |
| `--path` or `-p` | String   | Project path    | Current directory | Optional     |

#### 📌 Example

```
wfg project show --path c:\repository
```

## `process`

The `process` command lets you `export`, `import`, `get`, `update`, or `delete` a process.&#x20;

{% hint style="info" %}
Available since WorkflowGen version 7.17.0.
{% endhint %}

### `export`

Exports a specific process from your WorkflowGen server to a local repository.

#### **Usage**

```
wfg process export [PROCESS_NAME] [PROCESS_VERSION] --destination [PATH]
```

#### **Arguments**

| **Name**  | **Type** | **Description** | **Behavior** |
| --------- | -------- | --------------- | ------------ |
| `name`    | String   | Process name    | Required     |
| `version` | Int      | Process version | Required     |

#### **Option**

| **Alias**               | **Type** | **Description** | **Default value** | **Behavior** |
| ----------------------- | -------- | --------------- | ----------------- | ------------ |
| `--destination` or `-d` | String   | Export path     | Current directory | Optional     |

#### 📌 Example

```
wfg process export SIMPLE_APPROVAL 1
```

### `import`

Imports a specific process from a local repository to your WorkflowGen server.

#### **Usage**

```
wfg process import [PROCESS_PATH] --useVersionNumber --state [STATE] --folder [PROCESS_FOLDER]
```

#### **Argument**

| **Name**    | **Type** | **Description**              | **Behavior** |
| ----------- | -------- | ---------------------------- | ------------ |
| `file-path` | String   | Path of the process XML file | Required     |

#### **Options**

| **Alias**              | **Type** | **Description**                                                                                  | **Default value** | **Behavior** |
| ---------------------- | -------- | ------------------------------------------------------------------------------------------------ | ----------------- | ------------ |
| `--use-version-number` | Boolean  | Use the process version from the XML file                                                        | `false`           | Optional     |
| `--state` or `-s`      | String   | Specify with which status the process will be imported                                           | `TEST`            | Optional     |
| `--folder`             | String   | Destination name of the process folder into which to import the process; the folder should exist | `DEFAULT`         | Optional     |

{% hint style="info" %}

#### **`UseVersionNumber`**

* `<use-version-number = true>` will try to add the process with the version number inside the XML file, if it doesn't already exist.<br>
* `<use-version-number = false>` will add the process with the latest version number plus one (e.g. if the latest current version is `3`, setting this to `false` will import the process as version `4`).

#### **`state`**

The state can be one of the following:

* `TEST` (default)
* `ACTIVE`
* `DEV`
* `ARCHIVE`
  {% endhint %}

#### 📌 Example

```
wfg process import c:\repository\SIMPLE_APPROVALv1.xml
```

### `get`

Displays one or several processes.

#### **Usage**

```
wfg process get [PROCESS_NAME] [PROCESS_VERSION] --output
```

#### **Arguments**

| **Name**  | **Type** | **Description** | **Behavior**                             |
| --------- | -------- | --------------- | ---------------------------------------- |
| `name`    | String   | Process name    | Optional                                 |
| `version` | Int      | Process version | Optional (except if a name is specified) |

#### **Option**

| **Alias**          | **Type** | **Description**                                          | **Default Value** | **Behavior** |
| ------------------ | -------- | -------------------------------------------------------- | ----------------- | ------------ |
| `--output` or `-o` | String   | Define the output format. Valid values: `json`, `table`. | `table`           | Optional     |

#### 📌 Example

```
wfg process get SIMPLE_APPROVAL 1 -o json
```

### `update`

Updates information for a single process.

#### **Usage**

```
wfg process update [PROCESS_NAME] [PROCESS_VERSION] -d [DESCRIPTION] -s [STATE]
```

#### **Arguments**

| **Name**  | **Type** | **Description** | **Behavior** |
| --------- | -------- | --------------- | ------------ |
| `name`    | String   | Process name    | Required     |
| `version` | Int      | Process version | Required     |

#### Options

| **Alias**               | **Type** | **Description**                                                  | **Default value** | **Behavior** |
| ----------------------- | -------- | ---------------------------------------------------------------- | ----------------- | ------------ |
| `--description` or `-d` | String   | Specifies the description with which the process will be updated | None              | Optional     |
| `--state` or `-s`       | String   | Specify with which status the process will be updated            | None              | Optional     |

{% hint style="info" %}

#### **`state`**

The state can be one of the following:

* `TEST`
* `ACTIVE`
* `DEV`
* `ARCHIVE`
  {% endhint %}

#### 📌 Example

```
wfg process update SIMPLE_APPROVAL 1 -s DEV
```

### `delete`

Deletes a single process by name and version.

#### **Usage**

```
wfg process delete [PROCESS_NAME] [PROCESS_VERSION]
```

#### Arguments

| **Name**  | **Type** | **Description** | **Behavior** |
| --------- | -------- | --------------- | ------------ |
| `name`    | String   | Process name    | Required     |
| `version` | Int      | Process version | Required     |

#### 📌 Example

```
wfg process delete SIMPLE_APPROVAL 1
```

### `test`

Runs test cases of your processes.

**Usage**

```
wfg process test [PATH_TEST_FILES] --verbosity [LEVEL] --doctor
```

**Arguments**

| **Name**     | **Type** | **Description**             | **Behavior** |
| ------------ | -------- | --------------------------- | ------------ |
| `test-files` | String   | Path(s) to the test file(s) | Required     |

**Option**

| **Name**              | **Type** | **Description**                                                                                                                                       | **Behavior** |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `--verbosity` or `-v` | String   | <p>Establishes the level of verbosity</p><p><br>Possible values: <code>q\[uiet]</code>,<code>n\[ormal]</code> (default) ,<code>d\[etailed]</code></p> | Optional     |
| `--doctor`            | String   | Check if test cases are compliant. Only available as of WorkflowGen version 8.0.3.                                                                    | Optional     |

📌 **Example**

```
wfg process test c:\repository\SIMPLE_APPROVALv1_Test.json c:\repository\SIMPLE_REQUESTv1_Test.json --verbosity quiet
```

📌 **Example of a test file**

<pre class="language-json"><code class="lang-json">{
<strong>    "processName": "SIMPLE_APPROVAL",
</strong>    "processVersion": 1,
    "tests": [
        {
            "describe": "First test",
            "requestParameters": [],
            "actions": [
                {
                    "name": "INITIATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "REQUEST_SUBJECT",
                            "textValue": "OK"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED"
                    }
                },
                {
                    "name": "VALIDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "APPROVAL_DECISION",
                            "textValue": "YES"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED",
                        "data": [
                            {
                                "name": "APPROVAL_DECISION",
                                "textValue": "YES"
                            }
                        ]
                    }
                }
        },
        {
            "describe": "Second test",
            "requestParameters": [],
            "actions": [
                {
                    "name": "INITIATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "REQUEST_SUBJECT",
                            "textValue": "OK"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED"
                    }
                },
                {
                    "name": "VALIDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "APPROVAL_DECISION",
                            "textValue": "NO"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED",
                        "data": [
                            {
                                "name": "APPROVAL_DECISION",
                                "textValue": "NO"
                            }
                        ]
                    }
                },
                {
                    "name": "UPDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "REQUEST_SUBJECT",
                            "textValue": "OK2"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED"
                    }
                },
                {
                    "name": "VALIDATES",
                    "operation": "COMPLETE",
                    "parameters": [
                        {
                            "name": "APPROVAL_DECISION",
                            "textValue": "YES"
                        }
                    ],
                    "assertions": {
                        "status": "CLOSED",
                        "subStatus": "COMPLETED",
                        "data": [
                            {
                                "name": "APPROVAL_DECISION",
                                "textValue": "YES"
                            }
                        ]
                    }
                }
        }
    ],
    "deleteRequest": false
}
</code></pre>

## `global-list`

The `global-list` command lets you `export`, `import`, `get`,  or `delete` a global list.&#x20;

{% hint style="info" %}
Available since WorkflowGen version 7.17.0.
{% endhint %}

### `export`

Exports a specific global list from your WorkflowGen server to a local repository.

#### **Usage**

```
wfg global-list export [GLOBAL_LIST_NAME] --destination [PATH]
```

#### **Argument**

| **Name** | **Type** | **Description**  | **Behavior** |
| -------- | -------- | ---------------- | ------------ |
| `name`   | String   | Global list name | Required     |

#### **Option**

| **Alias**               | **Type** | **Description** | **Default value** | **Behavior** |
| ----------------------- | -------- | --------------- | ----------------- | ------------ |
| `--destination` or `-d` | String   | Export path     | Current directory | Optional     |

#### 📌 Example

```
wfg global-list export Country
```

### `import`

Imports a specific global list from your local repository to your WorkflowGen server.

{% hint style="warning" %}
**Known issue (#3373):** See the [WorkflowGen 7.22.2 release notes](https://discuss.workflowgen.com/t/workflowgen-7-22-2).
{% endhint %}

#### **Usage**

```
wfg global-list import [GLOBAL_LIST_PATH] --force
```

#### **Argument**

| **Name**    | **Type** | **Description**                        | **Behavior** |
| ----------- | -------- | -------------------------------------- | ------------ |
| `file-path` | String   | The path to the global list's XML file | Required     |

#### **Option**

| **Alias**         | **Type** | **Description**               | **Default value** | **Behavior** |
| ----------------- | -------- | ----------------------------- | ----------------- | ------------ |
| `--force` or `-f` | Boolean  | Updates specified global list | `false`           | Optional     |

#### 📌 Example

```
wfg global-list import C:\repository\Country
```

### `get`

Displays one or several global lists.

#### **Usage**

```
wfg global-list get [GLOBAL_LIST_NAME] --output
```

#### **Argument**

| **Name** | **Type** | **Description**     | **Behavior** |
| -------- | -------- | ------------------- | ------------ |
| `names`  | String   | Global list name(s) | Optional     |

#### **Option**

| **Alias**          | **Type** | **Description**                                          | **Default value** | **Behavior** |
| ------------------ | -------- | -------------------------------------------------------- | ----------------- | ------------ |
| `--output` or `-o` | String   | Define the output format. Valid values: `json`, `table`. | `table`           | Optional     |

#### 📌 Example

```
wfg global-list get Country Clients --output json
```

### `delete`

Deletes a single global list by name.

#### **Usage**

```
wfg global-list delete [GLOBAL_LIST_NAME]
```

#### **Argument**

| **Name** | **Type** | **Description**  | **Behavior** |
| -------- | -------- | ---------------- | ------------ |
| `name`   | String   | Global list name | Required     |

#### 📌 Example

```
wfg global-list delete Country
```

## `application`

The `application` command lets you `export`, `import`, `get`, `get-parameters`,  or `delete` an application.&#x20;

{% hint style="info" %}
Available since WorkflowGen version 7.14.0.
{% endhint %}

### `export`

Exports a specific application from your WorkflowGen server to a local repository.

#### **Usage**

```
wfg application export [APPLICATION_NAME] --destination [PATH]
```

#### **Argument**

| **Name** | **Type** | **Description**  | **Behavior** |
| -------- | -------- | ---------------- | ------------ |
| `name`   | String   | Application name | Required     |

#### **Option**

| **Alias**               | **Type** | **Description** | **Default value** | **Behavior** |
| ----------------------- | -------- | --------------- | ----------------- | ------------ |
| `--destination` or `-d` | String   | Export path     | Current directory | Optional     |

#### 📌 Example

```
wfg application export XMLTODATABASE
```

### `import`

Imports a specific application from your local repository to your WorkflowGen server.

#### **Usage**

```
wfg application import [APPLICATION_PATH] --force
```

#### **Argument**

| **Name**    | **Type** | **Description**                                      | **Behavior** |
| ----------- | -------- | ---------------------------------------------------- | ------------ |
| `file-path` | String   | The full path containing the application's JSON file | Required     |

#### **Option**

| **Alias**         | **Type** | **Description**                   | **Default value** | **Behavior** |
| ----------------- | -------- | --------------------------------- | ----------------- | ------------ |
| `--force` or `-f` | Boolean  | Updates the specified application | `false`           | Optional     |

#### 📌 Example

```
wfg application import c:\repository\XMLTODATABASE.xml
```

### `get`

Displays one or several applications.

#### **Usage**

```
wfg application get [APPLICATION_NAME]] --output
```

#### **Argument**

| **Name** | **Type** | **Description**     | **Behavior** |
| -------- | -------- | ------------------- | ------------ |
| `names`  | String   | Application name(s) | Optional     |

#### **Option**

| **Alias**          | **Type** | **Description**                                          | **Default value** | **Behavior** |
| ------------------ | -------- | -------------------------------------------------------- | ----------------- | ------------ |
| `--output` or `-o` | String   | Define the output format. Valid values: `json`, `table`. | `table`           | Optional     |

#### 📌 Example

```
wfg application get XMLTODATABASE --output json
```

### `get-parameters`

Displays an application's parameters.

#### **Usage**

```
wfg application get-parameters [APPLICATION_NAME] --output
```

#### **Argument**

| **Name** | **Type** | **Description**  | **Behavior** |
| -------- | -------- | ---------------- | ------------ |
| `name`   | String   | Application name | Required     |

#### **Option**

| **Alias**          | **Type** | **Description**                                          | **Default value** | **Behavior** |
| ------------------ | -------- | -------------------------------------------------------- | ----------------- | ------------ |
| `--output` or `-o` | String   | Define the output format. Valid values: `json`, `table`. | `table`           | Optional     |

#### 📌 Example

```
wfg application get-parameters XMLTODATABASE --output json
```

### `delete`

Deletes a single application by name.

#### **Usage**

```
wfg application delete [APPLICATION_NAME]
```

#### **Argument**

| **Name** | **Type** | **Description**  | **Behavior** |
| -------- | -------- | ---------------- | ------------ |
| `name`   | String   | Application name | Required     |

#### 📌 Example

```
wfg application delete XMLTODATABASE
```

## `action`

{% hint style="info" %}
Available since WorkflowGen version 7.17.0.
{% endhint %}

### `get`

Lets you display the action information of a request or process.

#### **Usage**

```
wfg action get [requestNumber] --processName --processVersion --status --output
```

#### **Argument**

| **Name**        | **Type** | **Description**                               | **Behavior** |
| --------------- | -------- | --------------------------------------------- | ------------ |
| `requestNumber` | Int      | ID number of the request that you want to get | Optional     |

#### **Option**

| **Alias**                  | **Type** | **Description**                                                    | **Default value** | **Behavior** |
| -------------------------- | -------- | ------------------------------------------------------------------ | ----------------- | ------------ |
| `--processName` or `-p`    | String   | Name of the process whose actions you want to retrieve             | (none)            | Optional     |
| `--processVersion` or `-v` | Int      | Version of the process whose actions you want to retrieve          | (none)            | Optional     |
| `--status` or `-s`         | String   | Retrieve the requests with a specified status (`OPEN` or `CLOSED)` | (none)            | Optional     |
| `--output` or `-o`         | String   | Define the output format. Valid values: `json`, `table`.           | `table`           | Optional     |

#### 📌 Example

```
wfg action get 1994 -s OPEN -o json
wfg action get -p SIMPLE_REQUEST
```

### `complete`

Lets you complete an action for a process.

#### Usage

```
wfg action complete [activityNumber] [requestNumber] --parameter
```

#### Argument

| **Name**         | **Type** | **Description**                                            | **Behavior** |
| ---------------- | -------- | ---------------------------------------------------------- | ------------ |
| `activityNumber` | Int      | Action number of the action that you want to complete      | Required     |
| `requestNumber`  | Int      | ID number of the request whose action you want to complete | Required     |

#### Option

| **Alias**             | **Type** | **Description**                                                                                                                                           | **Behavior** |
| --------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `--parameter` or `-p` | String   | Your complete action parameter contains a string in the following format: `ValueType:ParameterName=Value`. `ValueType` can be `text`,`numeric`, or `date` | Optional     |

#### 📌 Example

```
wfg action complete 1 1994 -p text:SUBJECT="My Subject"
```

### `cancel`

Lets you cancel an ongoing action.

#### Usage

```
wfg action cancel [actionNumber] [requestNumber] --force
```

#### Argument

| **Name**         | **Type** | **Description**                                          | **Behavior** |
| ---------------- | -------- | -------------------------------------------------------- | ------------ |
| `activityNumber` | Int      | Action number of the action that you want to cancel      | Required     |
| `requestNumber`  | Int      | ID number of the request whose action you want to cancel | Required     |

#### Option

| **Alias**         | **Type** | **Description**        | **Default value** | **Behavior** |
| ----------------- | -------- | ---------------------- | ----------------- | ------------ |
| `--force` or `-f` | Boolean  | Force the cancellation | `false`           | Optional     |

#### 📌 Example

```
wfg action cancel 1 1994 -f
```

## `request`

{% hint style="info" %}
Available since WorkflowGen version 7.17.0.
{% endhint %}

### `get`

Lets you manage a WorkflowGen request.

#### **Usage**

```
wfg request get [requestNumber] --processName --processVersion --status --output
```

#### **Argument**

| **Name**        | **Type** | **Description**                                     | **Behavior** |
| --------------- | -------- | --------------------------------------------------- | ------------ |
| `requestNumber` | String   | ID number(s) of the request(s) that you want to get | Optional     |

#### **Option**

| **Alias**                  | **Type** | **Description**                                                      | **Default value** | **Behavior** |
| -------------------------- | -------- | -------------------------------------------------------------------- | ----------------- | ------------ |
| `--processName` or `-p`    | String   | Name of the process whose requests you want to retrieve              | (none)            | Optional     |
| `--processVersion` or `-v` | Int      | Version of the process whose requests you want to retrieve           | (none)            | Optional     |
| `--status` or `-s`         | String   | Retrieve the requests with the specified status (`OPEN` or `CLOSED)` | (none)            | Optional     |
| `--output` or `-o`         | String   | Define the output format. Valid values: `json`, `table`.             | `table`           | Optional     |

#### 📌 Example

```
wfg request get 1994 -s OPEN -o json
wfg request get -p SIMPLE_REQUEST
```

### `create`

Lets you create a new request from a process.

#### Usage

```
wfg request complete [processName] [processVersion] --parameter
```

#### Argument

| **Name**         | **Type** | **Description**                                              | **Behavior** |
| ---------------- | -------- | ------------------------------------------------------------ | ------------ |
| `processName`    | String   | Name of the process of which you want to create a request    | Required     |
| `processVersion` | Int      | Version of the process of which you want to create a request | Required     |

#### Option

| **Alias**             | **Type** | **Description**                                                                                                                                            | **Behavior** |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `--parameter` or `-p` | String   | Your complete action parameter contains a string in the following format: `ValueType:ParameterName=Value`. `ValueType` can be `text`,`numeric`, or `date`. | Optional     |

#### 📌 Example

```
wfg request complete 1 1994 -p text:SUBJECT="My Subject"
```

### `cancel`

Lets you cancel an ongoing request.

#### Usage

```
wfg request cancel [requestNumber] --force
```

#### Argument

| **Name**        | **Type** | **Description**                            | **Behavior** |
| --------------- | -------- | ------------------------------------------ | ------------ |
| `requestNumber` | Int      | The request number that you want to cancel | Required     |

#### Option

| **Alias**         | **Type** | **Description**        | **Default value** | **Behavior** |
| ----------------- | -------- | ---------------------- | ----------------- | ------------ |
| `--force` or `-f` | Boolean  | Force the cancellation | `false`           | Optional     |

#### 📌 Example

```
wfg request cancel 1994 -f
```

## `graphql`

The `graphql` command lets you run a custom GraphQL query.&#x20;

{% hint style="info" %}
Available since WorkflowGen version 7.0.0.
{% endhint %}

#### Usage

```
wfg graphql [GRAPHQL_QUERY] -v [VARIABLE1_STRING] -V [VARIABLE2_INT] -V [VARIABLE3_BOOL]
```

```
wfg graphql [GRAPHQL_QUERY] --variableJson [VARIABLES_JSON]
```

#### Arguments

| **Name**                 | **Type** | **Description**                                                                                                                                                                                 | **Behavior** |
| ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| `--variable` or `-v`     | String   | Inputs a variable that will be read as a raw string.                                                                                                                                            | See below    |
| `--variableCast` or `-V` | String   | Inputs a variable that the CLI will attempt to cast in a valid JSON type.                                                                                                                       | See below    |
| `--variableJson`         | JSON     | <p>Input a JSON object containing the variables' names as keys and variables' values as the values of those keys.</p><p></p><p>📌 <strong>Example:</strong> <code>{ "key": "value" }</code></p> | See below    |

{% hint style="warning" %}
If the `graphql` query uses variables, you have to specify **either** `--variable` and `--variableCast` **or** `--variableJson`. You can't use `--variableJson` with the other two arguments and vice-versa.
{% endhint %}

#### 📌 Examples

{% tabs %}
{% tab title="PowerShell" %}

```bash
wfg graphql "query { viewer { userName } }"
```

{% endtab %}

{% tab title="Bash" %}

```bash
wfg graphql "query { viewer { userName } }"
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PowerShell" %}

```bash
wfg graphql @'
query ($name: String!, $version: Int!) {
    process(name: $name, version: $version) {
        description
    }
}
'@ -v name=SIMPLE_APPROVAL -V version=1
```

{% endtab %}

{% tab title="Bash" %}

```bash
wfg graphql "$(cat <<QUERY
query (\$name: String!, \$version: Int!) {
        process(name: \$name, version: \$version) {
                description
        }
}
QUERY
)" -v name=SIMPLE_APPROVAL -V version=1
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="PowerShell" %}

```bash
wfg graphql @'
query ($name: String!, $version: Int!) {
    process(name: $name, version: $version) {
        description
    }
}
'@ --variableJson ((@{
    name = "SIMPLE_APPROVAL"
    version = 1
} | ConvertTo-Json -Compress) -replace '"', '\"')
```

{% hint style="warning" %}
Due to a known PowerShell bug at time of writing (<https://github.com/PowerShell/PowerShell/issues/1995>), any double quotes (`"`) will be stripped from the string when sending it to a native executable. The solution is to add a backslash (`\`) before each double quote, or use three double quotes (`"""`).
{% endhint %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.workflowgen.com/cli/list-of-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
