# Creating an event trigger

> :::note
Feature availability depends on the cloud offering that you use. For details, refer to the [Feature availability page](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/orchestrator-feature-availability#orchestrator-feature-availability).
:::

:::note
Feature availability depends on the cloud offering that you use. For details, refer to the [Feature availability page](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/orchestrator-feature-availability#orchestrator-feature-availability).
:::

In the case of connected event triggers, you create the trigger at design time, in Studio. You can then configure the trigger in Orchestrator when deploying the process with which it is associated. For further information, refer to [Configuring connected event triggers](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/managing-package-requirements#configuring-connected-event-triggers).

In the case of disconnected event triggers, you create the trigger in Orchestrator.

For further information, refer to the following:

* [Creating a disconnected event trigger](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/creating-an-event-trigger#creating-a-disconnected-event-trigger)
  :::note
  If a user has the `Connections.View` permission in a folder, they can view and use all connections defined in that folder.
  :::

## Creating a disconnected event trigger

To create a disconnected event trigger, take the following steps:

1. In the folder context, navigate to **Automations**, then select **Triggers**.
2. Select **Event Triggers**, then **+Add a new trigger**.
3. In the **Add Event Trigger** window, on the **General details** page, enter a unique name for your trigger in the **Name** field.
4. From the **Process** dropdown menu, select the process for which you want to create the trigger.
5. From the **Job Priority** dropdown menu, select the priority of the job. The default value is **Inherited**, meaning that the job priority is the same as the one defined for the selected process.
6. From the **Runtime type** dropdown, select the runtime for executing the jobs that the trigger launches.
7. In the **Execution Target** section, select the allocation mechanism and execution target for your jobs. 
 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
   
    Option
   
   
    Description
   
  
 
 
  
   
    
     
      Account
     
    
   
   
    
     The process is executed under a specific account. Specifying
                                       only the account results in Orchestrator allocating the
                                       machine dynamically. Specifying both the account and the
                                       machine template ensures that the job launches on that
                                       specific account-machine pair.
    
   
  
  
   
    
     
      Machine
     
    
   
   
    
     The process is executed on one of the host machines attached
                                       to the selected machine template. Specifying only the
                                       machine template results in Orchestrator allocating the
                                       account dynamically. Specifying both the account and the
                                       machine template ensures that the job launches on that
                                       specific account-machine pair.
    
    Note: Make sure you allocate the runtime licenses required to
                                       execute the job to the associated machine template.
   
  
  
   
    
     
      Hostname
     
    
   
   
    
     After selecting a machine template, the
     
      Hostname
     
     option is displayed, allowing you to select the desired
                                       workstation or robot session to execute the process.
    
    
     All available sessions in the active folder are displayed,
                                       whether they are unconnected, disconnected, or
                                       connected.
    
    Note: You can only use unattended runtimes to configure the
                                       mapping. Make sure you allocate the runtime licenses
                                       required to execute the job to the associated machine
                                       template.
   
  
 

   :::note
   A warning is displayed upon selecting a hostname with an **Unresponsive** or **Disconnected** status. Jobs scheduled for execution by an inactive session remain in a **Pending** state until the corresponding connection to Orchestrator resumes. In this scenario, take one of the following actions:
   * To acknowledge your selection of the inactive hostname, click
   **Confirm**.
   * To go back and select another hostname or **Any connected
   machine**, select **Cancel**. Configuring the same trigger with the same account-machine mapping, but with the additional hostname selection, doubles the number of jobs to execute. For example, you configure the T1 trigger with the A1 account mapped to the MT1 machine template. Ten jobs are queued in this configuration. Later on, you configure the same T1 trigger with the A1 account mapped to the MT1 machine template, but now you also select the H1 hostname. The same ten jobs are queued again for this case, because Orchestrator interprets the configuration as new.
   :::
8. In the **Runtime Arguments** section, select the entry point to use for job execution from the **Entry point** dropdown menu. For details, refer to [Entry points](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-processes#entry-points).
9. If your process has input arguments, provide appropriate values for them. For more details, refer to [About input and output arguments](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/about-input-and-output-arguments#about-input-and-output-arguments).
10. To select a job termination strategy, enable the **Schedule ending of job execution** toggle.

    :::note
    The amount of time you specify elapses according to the specifications, even if the job is queued. For example, if you schedule a job to run at 1 p.m. and set it to stop after 20 minutes, the job stops at 1:20 p.m. even if it had been in a queue until 1:15 p.m., and then started. Additionally, if you opt to stop a pending or running job after two hours and kill the same job after three hours, the job is killed after five hours. This happens because, first, Orchestrator receives the signal that the job was stopped after two hours. Upon receiving the signal, Orchestrator times the kill action to occur in three hours, thus resulting in a total of five hours.
    :::

You have the following options:
  * Select **Stop** from the dropdown menu: This option initiates an attempt to gracefully end the job execution when the job has been in a pending or running state for the amount of time you set. You can set a minimum interval of one minute, and a maximum interval of 10 days, 23 hours and 59 minutes.
  * Select **Kill** from the dropdown menu: This option initiates an attempt to forcefully end the job execution when the job has been in a pending or running state for the amount of time you set. You can set a minimum interval of one minute, and a maximum interval of 10 days, 23 hours and 59 minutes.
  * Select **Stop** from the dropdown menu and enable the **If the job does not stop, kill it** option. This option initiates an attempt to gracefully end the job execution when the job has been in a pending or running state for the amount of time you set for the stop action. If the attempt results in the job remaining in a stopping state, Orchestrator then attempts to kill the job after the amount of time you set for the kill action. You can set a minimum interval of one minute, and a maximum interval of 10 days, 23 hours and 59 minutes.

11. To receive an alert if a job has remained in a pending or resumed state for a certain amount of time, enable the **Generate an alert if the job is stuck in pending or resumed status** toggle and set the acceptable duration for the job to remain in a pending or resumed state. The minimum configurable duration is one minute, and the maximum duration is eleven days. If the job exceeds the configured duration, an error-severity alert pop-up appears, with the following text: "N jobs for #process {process_number} have been pending or resumed for more than X hours and Y minutes.", where:
    * `N` is the number of jobs that triggered the alert.
    * `{process_number}` is the process identifier.
    * `X` is the configured number of hours that the job exceeded while in a pending or resumed state. Days are converted to hours.
    * `Y` is the configured number of minutes that the job exceeded while in a pending or resumed state.

12. To receive an alert if a job has not completed within a set interval, enable the **Generate an alert if the job started and has not completed** toggle and set the acceptable duration for the job to complete. The minimum configurable duration is one minute, and the maximum duration is eleven days. If the job exceeds the configured duration, an error-severity alert pop-up appears, with the following text: "Job for #process {process_number} has been running for more than X hours and Y minutes.", where:
    * `{process_number}` is the process identifier.
    * `X` is the configured number of hours that the job exceeded without completing. Days are converted to hours.
    * `Y` is the configured number of minutes that the job exceeded without completing.

13. To determine when to disable the trigger following job execution failures, enable the **Set execution-based trigger disabling** toggle. Upon enabling the toggle, you must set the following options:

| Option | Description |
| --- | --- |
| **Disable when consecutive job execution fail count** | The trigger is disabled after the number of failed executions you specify. You can choose a value between 0 and 100. The default is 0, meaning that the trigger is never disabled. Stopped jobs are not counted toward this value. |
| **Grace period on disabling the trigger (days)** | The number of days to wait before disabling the trigger after the first failure of a job. You can choose a value between 0 and 30. The default is 0, meaning that the trigger is disabled as soon as the job fails, with no waiting time. |

14. To keep the same account-machine context configured for starting the job, select **Keep Account/Machine allocation on job resumption**. Selecting this option optimizes your license and resource usage.
15. When you complete the **General details** configuration, advance to the **Event details** page by selecting **Next**.
16. Select the appropriate connector from the **Select connector** dropdown menu.
17. Select an existing connection from the **Connection** dropdown menu. If no connection is defined, a **Connect to...** button appears, allowing you to create a new connection on the fly.
18. Select an event from the **Event** dropdown list.
19. Under **Data filters**, use **Add condition** and **Add group** to define your desired filters.
20. When you are done, select **Add** to create the trigger. The event trigger appears in the **Event Triggers** grid, with the **Disconnected** value in the **Type** column.
