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
find(Filter $filter = null, int $pageSize = null, string $pageToken = null): WorkflowsPage
Parameters
Parameter | Type | Description |
---|---|---|
$filter | Filter | The filter criteria to search by, or null to fetch all Workflows. |
$pageToken | string | The token of the page to fetch |
$pageSize | int | The number of Workflows to return per page |
You can search for matches among the following attributes of the Where
class.
Name | Type | Description |
---|---|---|
text | string | Fuzzy matches text attributes of a Workflow, including name and description. |
owner | string | Search for Workflows owned by a specific team member. The email address of the owner of the Workflow must match exactly, apart from casing. |
category | string | Find all Workflows in a specific category |
Example
<?php
/*
* This example demonstrates finding all Workflows of a particular category
* and having a name that matches particular text.
* This also demonstrates paging through results to collect all
* matches into a single list.
*/
require_once(__DIR__ . '/vendor/autoload.php');
use Catalytic\SDK\CatalyticClient;
use Catalytic\SDK\Search\Where;
$catalytic = new CatalyticClient();
$where = (new Where())->category()->is('general')
->and()->text()->matches('PHP');
$results = $catalytic->workflows()->find($where);
$workflows = $results->getWorkflows();
// Loop through all the pages of results
while (!empty($results->getNextPageToken())) {
$results = $catalytic->workflows()->find($where, $results->getNextPageToken());
$workflows = array_merge($workflows, $results->getWorkflows());
}
Updated about 3 years ago