Find Instance Steps
Find Instance steps within an Instance or across all Instances of a Worfkflow.
Permissions Required
You must have Find permissions to the Instance for this request to succeed.
Method Signature
findInstanceSteps(): Promise<InstancesPage>;
findInstanceSteps(options: FindInstanceStepsOptions): Promise<InstancesPage>;
findInstanceSteps(callback: (err?: Error, steps: InstanceStepsPage) => any): void;
findInstanceSteps(options: FindInstanceStepsOptions, callback: (err?: Error, steps: InstanceStepsPage) => any): void;
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
options | FindInstanceStepsOptions | Optional The options options filter criteria to search by, or null to fetch all InstanceSteps. | |
options.owner | string | Optional Search for InstanceSteps owned by a specific team member. The email address of the owner of the Instance must match exactly, apart from casing. | |
options.instanceID | string | Optional Find InstanceSteps within a specific Instance | |
options.workflowID | string | Optional Find InstanceSteps within Instances of a specific Workflow | |
options.assignee | string | Find Steps assigned to a specific user by email or username. Results will include Steps assigned to a Group to which the user belongs. | |
options.query | string | Optional A query string to search by. Applies to the name and description properties of InstanceSteps | |
options.pageSize | number | Optional The number of InstanceSteps to fetch in a single InstanceStepsPage response | 25 |
options.pageToken | string | Optional The nextPageToken of a previous find request, used to fetch the next set of results | |
callback | (err?: Error, instancesPage: InstanceStepsPage) => any | Optional The callback | |
returns | InstanceStepsPage | The requested page of InstanceSteps |
Example
/*
* This example demonstrates finding Steps across all Instances
* assigned to a specific user. Note that this will include Steps
* assigned to a Group to which the User belongs.
*/
const { CatalyticClient } = require('@catalytic/sdk');
const catalytic = new CatalyticClient();
const steps = [];
const options = {
pageSize: 25,
assignee: '[email protected]'
};
let hasNextPage = true;
while (hasNextPage) {
const stepsPage = await catalytic.steps.find(options);
steps.push(...stepsPage.steps);
if (stepsPage.nextPageToken) {
options.pageToken = stepsPage.nextPageToken;
} else {
hasNextPage = false;
}
}
steps.forEach(step => {
console.log(step.name);
});
Updated almost 4 years ago