top of page

How to Run Workflows Based on Saved Search Results with Delegate

  • Writer: Jedidiah Cassinelli
    Jedidiah Cassinelli
  • May 20
  • 3 min read

As covered in How to Supercharge Workflows with Relativity Scripts Using Delegate, there are many ways to harness the power of Relativity Scripts with Delegate. However, one of the most useful ways is to combine them with Saved Search results to run workflows.


Let's look at several ways you might use the results of a saved search for this purpose with Delegate.


Reference material


Below is an example Relativity Script that handles the base case of identifying if there are any new documents being returned by the Saved Search since the last time the Script/Step was run. It accepts two inputs:


  1. Saved Search - the saved search you want to track results for

  2. Unique Identifier - a unique value associated with the results for this saved search as it is used in this step.



The unique identifier can be any value you like, and if you really wanted to use this values across multiple workflows/steps, you technically can - just be aware that you could run into race conditions and conflicts, so it is not recommended.


If there are any new documents found, it proceeds successfully. If it does not find any, it throw an error that stops the workflow.  


This script only determines if there are new documents to process. It DOES NOT determine or specify the set of documents that will be acted upon by the steps in the workflow - that is still determined by how you setup each step (e.g., the Saved Searches selected in defining each individual step).


Feel free to start there if you like diving right in, or follow along below on how to put it to work or modify for further functionality.


Instructions


Putting it (in)to (a) work(flow)


First, some basic setup for using our saved search trigger (SST) script. For simplicity, we’ll assume you’re building a new workflow, but you can just as easily use this in existing workflows.


  1. Create a new Automated Workflow from the Delegate Automated Workflows tab (and set the usual accoutrements - name, description, etc.)

  2. Select the trigger, any option will work fine here, though the Recurring trigger is probably most powerful since we’re going to want to check for new documents pretty regularly.

  3. Add a new step of type Run Relativity Script.

    1. For the Relativity Script, select the SST (editor’s note - assuming here that you’re familiar with creating/installing Relativity Scripts - see Relativity’s documentation for more info)

    2. Select the Saved Search you’d like to use

    3. Provide a Unique Identifier (anything you want - just make it unique to this step & workflow)

  4. Next we’ll need to adjust the step notification and error behavior - for Partial Complete, select the checkbox for “Pause Workflow”.

  5. Add whatever other steps to your workflow that you want. Based on the error handling behavior, you’ll only ever get to these steps if the SST finds that there are new docs returned by the saved search.


Additional options


The above is a basic example, and there are a number of enhancements we could make. It all depends on how you’ve designed your workflow.


Here are a couple possible ways you could organize this differently:


  1. Run the workflow if documents drop out of the result set.

  2. Run the workflow against only incrementally “new” documents

    1. Set a Yes/No field to identify “new” documents

    2. Use that field in saved searches which are used in the subsequent steps

    3. Clear that field at the end (using update field step)


Delegate customers can work with our team to help implement modifications like these. Consulting and troubleshooting support are free with a Delegate license!


One other approach


Instead of using Relativity Scripts to trigger off of a Saved Search’s results, you could use some custom Fields for a similar effect. Read about that in How to Use Custom Fields for Guided Automated Workflows With Delegate.


Or if you're ready to start using Delegate, reach out ➜

Opmerkingen


Het is niet meer mogelijk om opmerkingen te plaatsen bij deze post. Neem contact op met de website-eigenaar voor meer info.
bottom of page