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
Matching Workflows will only be included in the results if you have Find permissions to that Workflow. Workflows that you do not have permissions to will be excluded from the results.
Method Signature
find(): Promise<WorkflowsPage>;
find(options: FindWorkflowOptions): Promise<WorkflowsPage>;
find(callback: (err?: Error, workflowsPage: WorkflowsPage) => any): void;
find(options: FindWorkflowOptions, callback: (err?: Error, workflowsPage: WorkflowsPage) => any): void;
Parameters
Parameter | Type | Description | Default |
---|---|---|---|
options | FindWorkflowOptions | Optional The options options filter criteria to search by, or null to fetch all Workflows. | |
options.owner | string | Optional Search for Workflows owned by a specific team member. The email address of the owner of the Workflow must match exactly, apart from casing. | |
options.category | string | Optional Search for Workflows in a specific category | |
options.query | string | Optional A query string to search by. Applies to the name and description properties of Workflows | |
options.pageSize | number | Optional The number of Workflows to fetch in a single WorkflowsPage response | 25 |
options.pageToken | string | Optional The nextPageToken of a previous find request, used to fetch the next set of results | |
callback | (err?: Error, workflowsPage: WorkflowsPage) => any | Optional The callback | |
returns | WorkflowsPage | The requested page of Workflows |
Example
/*
* This example demonstrates listing all workflows
*/
const { CatalyticClient } = require('@catalytic/sdk');
const catalytic = new CatalyticClient();
const workflows = [];
const options = { pageSize: 25 };
let hasNextPage = true;
while (hasNextPage) {
const workflowsPage = await catalytic.workflows.find(options);
workflows.push(...workflowsPage.workflows);
if (workflowsPage.nextPageToken) {
options.pageToken = workflowsPage.nextPageToken;
} else {
hasNextPage = false;
}
}
workflows.forEach(workflow => {
console.log(workflow.name);
});
Updated almost 3 years ago