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

ParameterTypeDescriptionDefault
optionsFindInstanceStepsOptionsOptional The options options filter criteria to search by, or null to fetch all InstanceSteps.
options.ownerstringOptional 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.instanceIDstringOptional Find InstanceSteps within a specific Instance
options.workflowIDstringOptional Find InstanceSteps within Instances of a specific Workflow
options.assigneestringFind Steps assigned to a specific user by email or username. Results will
include Steps assigned to a Group to which the user belongs.
options.querystringOptional A query string to search by. Applies to the name and description properties of InstanceSteps
options.pageSizenumberOptional The number of InstanceSteps to fetch in a single InstanceStepsPage response25
options.pageTokenstringOptional The nextPageToken of a previous find request, used to fetch the next set of results
callback(err?: Error, instancesPage: InstanceStepsPage) => anyOptional The callback
returnsInstanceStepsPageThe 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);
});