# Working with long-running workflows

> Processes that require logical fragmentation or human intervention (validations, approvals, exception handling) such as invoice processing and performance reviews, are handled with a set of instruments in the UiPath® suite: a dedicated project template in Studio called [Long Running Automation](https://docs.uipath.com/studio/standalone/latest/user-guide/long-running-automation), resource allocation capabilities in Orchestrator, and actions within Action Center.

Processes that require logical fragmentation or human intervention (validations, approvals, exception handling) such as invoice processing and performance reviews, are handled with a set of instruments in the UiPath® suite: a dedicated project template in Studio called [Long Running Automation](https://docs.uipath.com/studio/standalone/latest/user-guide/long-running-automation), resource allocation capabilities in Orchestrator, and actions within Action Center.

Broadly, you configure your workflow using activities from the [Persistence](https://docs.uipath.com/activities/other/latest/workflow/persistence-activities), [IntelligentOCR](https://docs.uipath.com/activities/other/latest/document-understanding/about-the-intelligent-ocr-activities-pack), [DocumentUnderstanding](https://docs.uipath.com/activities/other/latest/document-understanding/about-the-documentunderstanding-package) ,and [ML.Services](https://docs.uipath.com/activities/other/latest/document-understanding/ml-services-activities) activity packages. The workflow can be configured so that a suspended job can only be resumed if certain requirements have been met. Only after the requirements have been met, resources are allocated for job resumption, thus ensuring no waste in consumption.

In Orchestrator this is marked by having the job [suspended](https://docs.uipath.com/orchestrator/automation-suite/2.2510/user-guide/job-states), awaiting for requirements to be met, and then having the job [resumed](https://docs.uipath.com/orchestrator/automation-suite/2.2510/user-guide/job-states) and executed as usual. Depending on which pair you use, completion requirements change, and the Orchestrator response adjusts accordingly.

## Jobs

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activites  
     Use Case  
  
 
 
  
   
      
          Start Job and Get Reference  
          Wait for Job and Resume  
      

     Introduce a job condition, such as uploading queue items.  After the main job has been suspended, the auxiliary job gets executed. After this process is complete, the main job is resumed. Depending on how you configured your workflow, the resumed job can make use of the data obtained from the auxiliary process execution.  If your workflow uses the Start Job and Get Reference activity to invoke another workflow, your Robot role should be updated with the following permissions:
      
         View on Processes. 
         View , Edit , Create on Jobs. 
         View on Environments. 
      

  
 

## Queues

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activities  
     Use Case  
  
 
 
  
   
      
          Add Queue Item and Get Reference  
          Wait for Queue Item and Resume  
      

     Introduce a queue condition, such as having queue items processed.  After the main job has been suspended, the queue items need to be processed through the auxiliary job. After this process is complete, the main job is resumed. Depending on how you configured your workflow, the resumed job can make use of the output data obtained from the processed queue item.  
  
 

## Actions

### Form actions

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activities  
     Use Case  
  
 
 
  
   
      
          Create Form Task  
          Wait for Form Task and Resume  
      

     Introduce user intervention conditions, found in Action Center as actions.  After the job has been suspended, an action is generated in Action Center (as configured in Studio).  Only after action completion, is the job  resumed  .  Form actions need to be completed by the assigned user. User assignment can be handled directly in Action Center, or through the  Assign Tasks  activity.  
  
 

### External actions

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activities  
     Use Case  
  
 
 
  
   
      
          Create External Task  
          Wait for External Task and Resume  
      

    Introduce user intervention conditions, found in Action Center as actions.  After the job has been suspended, an action is generated in Action Center (as configured in Studio).  Only after action completion, is the job  resumed  .  External actions can be completed by any user with Edit permissions on Actions, and access to the associated folder.  
  
 

### Document Validation actions

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activities  
     Use Case  
  
 
 
  
    IntelligentOCR.Activities
      
          Create Document Validation Action  
          Wait for Document Validation Action and Resume  
      
DocumentUnderstanding.Activities
      
          Create Validation Task  
          Create Validation Task and Wait  
          Create Classification Validation Task  
          Create Classification Validation Task and Wait  
          Wait for Classification Validation Task and Resume  
      

     Introduce user intervention conditions, found in Action Center as actions.  After the job has been suspended, an action is generated in Action Center (as configured in Studio).  Only after action completion, is the job  resumed  .  Document Validation actions need to be completed by the assigned user. User assignment can be handled directly in Action Center, or through the  Assign Tasks  activity.  In order for the Robot to upload, download and delete data from a storage bucket, it needs to be granted the appropriate permissions. This can be done by updating the Robot role with the following:  To upload document data: 
      
         View , Create on Storage Files. 
         View on Storage Buckets. 
      
 To delete document data after downloading: 
      
         View , Delete on Storage Files. 
         View on Storage Buckets. 
      

  
 

### Document Classification actions

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activities  
     Use Case  
  
 
 
  
   
      
          Create Document Classification Action  
          Wait for Document Classification Action and Resume  
      

     Introduce user intervention conditions, found in Action Center as actions.  After the job has been suspended, an action is generated in Action Center (as configured in Studio).  Only after action completion, is the job  resumed  .  Document Classification actions need to be completed by the assigned user. User assignment can be handled directly in Action Center, or through the  Assign Tasks  activity.  In order for the Robot to upload, download and delete data from a storage bucket, it needs to be granted the appropriate permissions. This can be done by updating the Robot role with the following:  To upload document data: 
      
         View , Create on Storage Files. 
         View on Storage Buckets. 
      
 To delete document data after downloading: 
      
         View , Delete on Storage Files. 
         View on Storage Buckets. 
      

  
 

### Data Labeling actions

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
    Activities 
    Use case 
  
 
 
  
   
      
          Create Labeling Task  
          Wait for External Task and Resume  
      

     Introduce user intervention conditions, found in Action Center as actions.  After the job has been suspended, an action is generated in Action Center (as configured in Studio).  Only after action completion, is the job  resumed  .  Data Labeling actions require a connection to the AI Center tenant.  
  
 

## Duration

 <colgroup>
  <col/>
  <col/>
 </colgroup>
 
  
     Activity  
     Use Case  
  
 
 
  
   
      
          Resume After Delay  
      

     Introduce a time interval as a delay, during which the workflow is suspended.  After the delay has passed, the job is resumed.  
  
  
   
      
          Configure task timer  
      

    Allows you to configure a timer for each task in Action Center. You can configure one of these actions as the outcome on the timer's expiry:
      
         alert the assigned user 
         reassign the task 
      

  
 

Job fragments are not restricted to being executed by the same Robot. They can be executed by any Robot that is available when the job is resumed and ready for execution. This also depends on the execution target configured when defining the job. Details [here](https://docs.uipath.com/orchestrator/automation-suite/2.2510/user-guide/about-jobs#execution-target).

### Example

I defined my job to be executed by specific Robots, say X, Y and Z. When I start the job only Z is available, therefore my job is executed by Z until it gets suspended awaiting user validation. After it gets validated, and the job is resumed, only X is available, therefore the job is executed by X.

* From a monitoring point of view, such a job is counted as one, regardless of being fragmented or executed by different Robots.
* Suspended jobs cannot be assigned to Robots, only resumed ones can.

To check the triggers required for the resumption of a suspended job, click its corresponding Details button, and check the **Triggers** tab in the side panel that opens.
