Artisan IMG > Outreach (outreach) (a4805c6e-3d87-4b86-9d01-575df76d7ea2)

Paginate through Outreach Records

Workflow
Sales
Beginner

This is a 'Workflow' template which means that it is a single standalone workflow.

Some workflow templates can be modified to work with other workflow templates - e.g. to convert a data sync between two services from uni-directional to bi-directional

Overview
Copy

This template demonstrates how you can pull records from Outreach and process them in batches using a process called pagination.

This is a standard method which you will need to use any time you wish to pull large numbers of records (prospects, sequence states etc.) from Outreach, using the Outreach 'List Prospects' operation.

When this happens, Outreach returns a 'next' page link which is used to get the next page of records.

In this case, you can then run a pagination loop which pulls Outreach records in batches and runs until the 'next' link is not returned.

If, for example, you have 6000 records, you can pull these in six batches of 1000 (Outreach allows you to pull a maximum of 1000 records in one call). Rather than making 6000 individual calls which would overwhelm your Outreach API limits.

End Result
Copy

The data fetched from Outreach will be available in batches for whatever processing you need to carry out. In this case, we are using a script step to act as a generic placeholder to demonstrate more logic to handle the page of results is needed.

Prerequisites
Copy

This workflow assumes the following:

  • You have a Outreach instance and can authenticate as an API user.

Getting Live
Copy

In order to configure this workflow for use simply:

  1. Authenticate to Outreach and any other needed systems. Ensure that your authentication will have access to the records required by your automation goals. This authentication must be added to the Outreach connector step within the workflow.

  2. Identify a relevant trigger based on your requirements:

    • If this is a standalone process to be triggered in the Tray platform, you can use a Manual trigger.

    • If it is to initiate daily or on specific intervals then use a Scheduled Trigger.

    • If you wish to fire the workflow when something happens in another system, then you can use a relevant Service Trigger or a Webhook Trigger if there is no pre-built Tray Service Trigger.

  3. Determine which type of record you wish to fetch from Outreach, and what fields from each record. In the List Prospects (Outreach-1) step you can specify if there are specific fields you wish to return and filters for which prospects you wish to return.

    1. You can swap out the `List Prospects` operation for another record type, such as `List sequence states` if you wish to get another record type. If you use the HTTP operation, you will need to update the mappings to the next page link in the `Set next page` data storage connector as the path to the token will be slightly different.

  4. Determine how you wish to process the Outreach records. If the process needs to run quickly, you may wish to leverage the Call/Callable Workflow concept.

  5. The workflow uses a Manual trigger; click Run workflow in the bottom left of the builder anytime you wish to run the workflow.

Workflow Logic
Copy

The overall logic of the workflow is:

  1. A forever loop runs until there are no more batches of records.

  2. Within the loop, the 'next' page link from the last batch of records is fetched using the Data Storage 'Get Value' operation (on the first run, this will be an empty string).

  3. The Outreach 'List Prospects' operation then pulls a batch of records, using the 'next' page link to start from where the last batch finished. Each batch is then available for further processing.

  4. A boolean condition checks if the 'next' page link was returned from the most recent execution of the Outreach step.

    • If the 'next' page link does not exist, the loop will break using the Break Loop step.

    • If the 'next' page link exists, it means there are more batches of records to process, and the loop will continue.

  5. If the loop continues the Data Storage 'Set Value' operation saves the 'next' page link for the next batch of records.

Implementation notes
Copy

The Read me script step within the workflow is a generic placeholder for whatever you may wish to do with each batch of records. You would delete this and replace with whatever logic you wish to use for your production use case.

There are various ways in which you can use this data fetched from Outreach, such as: