---
# System prepended metadata

title: Untitled

---

### Module Fields

When configuring a subscribe module you will be presented with two sections, one section to configure the input details and another to configure the output.

#### Input Configuration

| Field | Description |
|--|--|
| Module Name | A friendly name for the module |
| Tenancy Name | Your UiPath Tenacy Name  |
| Username | The unqiue identifier of newly created job |
| Password | A key that relates to the newly created job  |
| Domain | Represents the name or domain\name of the machine on which Orchestrator is installed, or the user account, such as docteam or uipath.local\docteam.  |
| Events | The events that you wish to subscribe to.  |
| Constraints | Filters on the result provided from each subscribed event |
| One-Time Use | If the webhook connection should be terminated after first use, this is checked by default.  |

#### Output Configuration

| Field | Description |
|--|--|
| Variable | A friendly name to help you recongise the module later |
| Event Message | The full result as returned from UiPath, this is will be presented as a JSON Object  |
| Subscription Error Message | The unqiue identifier of newly created job |

### Event Configuration

The event field allows you to subscribe to any number of events using a webhook at UiPath, you can find more information about the different types of events [here](https://orchestrator.uipath.com/docs/types-of-events).

In order to configure multiple events in within the configuration field you must comma-seperate them. An example can be seen below:

`job.created, job.started, job.faulted`

During this stage, we're subscribe to all events of a particular type, in order to filter this down further we'll use the constraints field to only show your users specific content. More information on contraints can be found below. 

### Constraints Configuration

The constraints configuration allows you provide specific filters of what should be shown within your experience, as mentioned previously, in the events field we have subscribed to a number of different events based on their type, in order for us to filter these down further, we can add constraints. This allows you target filters on multiple items that are presented within the JSON provided as an output for event. For example in the event of `job.completed`, the following response would be provided:

```
   {
       "Type": "job.completed",
       "EventId": "c61eae1c50c74ab192ba49def7311c65",
       "Timestamp": "2019-07-02T15:24:46.1699691Z",
       "Job": {
           "Id": 10976846,
           "Key": "05dd1643-8e13-410b-aaac-31f2bf8e76e2",
           "State": "Successful",
           "StartTime": "2019-07-02T15:24:39.823Z",
           "EndTime": "2019-07-02T15:24:46.1387195Z",
           "Info": "Job completed",
           "OutputArguments": {},
           "Robot": {
               "Id": 187512,
               "Name": "Developer Robot",
               "MachineName": "DEVTEST-RPA1"
           },
           "Release": {
               "Id": 155725,
               "Key": "53469f90-88ee-4453-99b7-d51779be07bd",
               "ProcessKey": "FixedDelayProcess"
           }
       },
       "TenantId": 15331,
       "OrganizationUnitId": 16696
   }
```
For example if we wished to only show messages related to a particular job, we could do this by creating the following constraints:

`Type=job.completed,Job.Id=10976846`

Note: There is currently a known issue where you must specify a type, this means that you cannot have multiple event types in a single subscription. 

Similarly if we only wanted to recieve results for a certain robot we could add the following constraints:

`Type=job.completed,Robot.Id=187512`

### Variable & Event Message

When we look to configure how our event should be shown to a user, we can look at two main fields, first we have variable. Variables are used to capture the result that is been returned from the event. The event response is returned in JSON, we must store this in a variable which this allow us to format it how we want later on. 

Let's look for example of how we can tie the variable and event message together, in the event we configured a subscription to the following event:

`job.completed`

and then configured a the constraints to be: 

`Type=job.completed,Job.Id=10976846`

We would be looking for any events that are related to job completions in relation to the job id of 10976846. In the event that we can an event that matches this, the response would look like this:

```
   {
       "Type": "job.completed",
       "EventId": "c61eae1c50c74ab192ba49def7311c65",
       "Timestamp": "2019-07-02T15:24:46.1699691Z",
       "Job": {
           "Id": 10976846,
           "Key": "05dd1643-8e13-410b-aaac-31f2bf8e76e2",
           "State": "Successful",
           "StartTime": "2019-07-02T15:24:39.823Z",
           "EndTime": "2019-07-02T15:24:46.1387195Z",
           "Info": "Job completed",
           "OutputArguments": {},
           "Robot": {
               "Id": 187512,
               "Name": "Developer Robot",
               "MachineName": "DEVTEST-RPA1"
           },
           "Release": {
               "Id": 155725,
               "Key": "53469f90-88ee-4453-99b7-d51779be07bd",
               "ProcessKey": "FixedDelayProcess"
           }
       },
       "TenantId": 15331,
       "OrganizationUnitId": 16696
   }
```

If we set the response to a variable of `$result` we would be setting `$result` equal the JSON returned in the response. Once we have set the variable this means that we can use it in the Event Response field. 

Let's look at how we'd configure the Event Response field, Let's assume we wanted to create a message that informed the user of a job completing, with the end message that is provided to the user being the following:

> Job 10976846 has completed

In order to configure this we would need to configure the following in the event message response field:

```
Job $Result.Job.Id has completed
```

As you can see we can access items in the variable using standard JSON notation, by first having `$Result` equal to entire object return by the API, we can dig deeper by targetting each individual key. In this scenario targetting `Job.Id` within the overall result. 

### Subscription Error Message

The subscription error message is provided to a user when we were unable to subscribe to any given event that was specified within the subscribe module. This is not linked to the Event Message, and is instead related solely to the subription module action.
