Find Workflows

Finds Workflows that match your criteria. The Workflows.find method supports a fluent style where you can chain together your search criteria.

πŸ‘

Permissions Required

You must have Find permissions to the Workflow in order to for this request to succeed.

Method Signature

WorkflowsPage find();
WorkflowsPage find(Filter filter);
WorkflowsPage find(String pageToken);
WorkflowsPage find(Filter filter, String pageToken);
WorkflowsPage find(Filter filter, String pageToken, Integer pageSize);

Parameters

ParameterTypeDescription
filterFilterThe filter criteria to search by, or null to fetch all Workflows.
pageTokenStringThe token of the page to fetch
pageSizeIntegerThe number of Workflows to return per page

You can search for matches among the following attributes of the Where class.

NameTypeDescription
textStringFuzzy matches text attributes of an Instance, including Name and Description.
ownerStringSearch for Instances owned by a specific team member. The email
address of the owner of the Instance must match exactly, apart from casing.
categoryStringFind all Instances in a specific category

Example

/*
 * This example demonstrates finding all Workflows owned by a
 * particular user and having a name that matches particular text.
 * This also demonstrates paging through results to collect all
 * matches into a single list.
 */
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.Workflow;
import org.catalytic.sdk.entities.WorkflowsPage;
import java.util.List;
import java.util.ArrayList;

public class Program {
  
    public static void main(String[] args) throws Exception {
      
      	// Create and initialize the Catalytid SDK Client
      	CatalyticClient catalytic = new CatalyticClient();
        List<Workflow> workflows = new ArrayList<>();
			  
      	Where where = new Where().text().matches("SDK Example")
            .and().owner().is("[email protected]");
				
      	// Find Workflows that are owned by Alice with the name SDK Example
      	WorkflowsPage results = catalytic.workflows().find(where);
      
      	// Add the results to the workflows array
      	workflows.addAll(results.getWorkflows());
      
      	// Loop through all the pages and add them to the workflows array
        while(results.getNextPageToken() != null) {
            results = catalytic.workflows().find(where, results.getNextPageToken());
            workflows.addAll(results.getWorkflows());
        }
    }
}