Find Instances
Finds Instances matching your criteria.
Permissions Required
Matching Instances will only be included in the results if you have Find permissions to that Instance. Instances that you do not have permissions to will be excluded from the results.
Method Signature
find(Filter $filter = null, string $pageToken = null, int $pageSize = null): InstancesPage
Parameters
Parameter | Type | Description |
---|---|---|
$filter | Filter | The filter criteria to search by, or null to fetch all Instances. |
$pageToken | string | The token of the page to fetch |
$pageSize | int | The number of Instances to return per page |
You can search for matches among the following attributes
Name | Type | Description |
---|---|---|
text | string | Fuzzy matches text attributes of an Instance, including Name and Description. |
owner | string | Search for Instances owned by a specific team member. The email address of the owner of the Instance must match exactly, apart from casing. |
status | InstanceStatus :- Running - Completed - Cancelled | Find Instances with a specific status |
workflowId | string | Find Instances of a specific Workflow |
Example
<?php
/*
* This example demonstrates finding all Instances.
* 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;
use Catalytic\SDK\Entities\InstanceStatus;
$catalytic = new CatalyticClient();
$where = (new Where())
->workflowId()->is('7e77254c-d2d6-4271-965a-98390aefa50a')
->and()->status()->is(InstanceStatus::RUNNING);
$results = $catalytic->instances()->find($where);
$instances = $results->getInstances();
// Loop through all the pages of results
while (!empty($results->getNextPageToken())) {
$results = $catalytic->instances()->find($where, $results->getNextPageToken());
$instances = array_merge($instances, $results->getInstances());
}
Updated over 2 years ago