<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pagination of API endpoints with Workato in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2002#M811</link>
    <description>&lt;P&gt;That sounds like quite the contstructions. I'm just trying to pull data on a couple thousand slack channels! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;What's been your transient storage system of choice for all that data? &lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 05:59:54 GMT</pubDate>
    <dc:creator>michielb</dc:creator>
    <dc:date>2021-12-22T05:59:54Z</dc:date>
    <item>
      <title>Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1993#M802</link>
      <description>&lt;P&gt;I'm running into a couple cases where I need to process a lot of data out of an API (like all projects in Jira, or all channels in Slack), and these endpoints tend to be paginated.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I've been playing around with the repeat action, but that takes a fixed length list to iterate, and with paginated data you often don't know how many interations you're going to have to do. I guess I could set up a helper list with 50000 iterations, and stop when I'm done, but it feels like there should be a better solution.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I haven't been able to find any good design documentation/tutorials on how to work with paginated data in Workato. Does anyone know where to find that?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks, Michiel&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 23:05:28 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1993#M802</guid>
      <dc:creator>michielb</dc:creator>
      <dc:date>2021-12-21T23:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1994#M803</link>
      <description>&lt;P&gt;often the API will tell you total records as well as the page size. You can use this in the create list helper step, as a formulia. total/pagesize. BTW it rounds correctly, UP.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 23:09:34 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1994#M803</guid>
      <dc:creator>clifford</dc:creator>
      <dc:date>2021-12-21T23:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1995#M804</link>
      <description>&lt;P&gt;If the API tells you how many records, or better yet, how many pages then you can do this:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;1. Call the API once&lt;/P&gt;&lt;P&gt;2. Create a helper list with size = number of pages (or number of records/page size)&lt;/P&gt;&lt;P&gt;3. Iterate through the helper list with a FOR EACH loop&lt;/P&gt;&lt;P&gt;4. Within the for each, call the API and set the page_num = the sequence number of your for each loop&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;After this if you can do whatever you want, either process the records in the for each loop or add them to the end of a pre-defined list so you can process them when the for each loop completes.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If the API doesn't tell you how many records it's going to return, then that's truly unfortunate, but manageable. You can define a variable as a high number to start with to mimic the number of pages in step 2 above. But then, you can avoid calling the endpoint an unnecessary number of times by saving the latest number of records returned from the endpoint within your for each loop as a variable, and use an IF condition within the for each to only call the endpoint if the most recent number of returned records was &amp;gt; 0, or if the number of returned records is equal to the max page size if you know that information.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 23:29:20 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1995#M804</guid>
      <dc:creator>jblanchett</dc:creator>
      <dc:date>2021-12-21T23:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1996#M805</link>
      <description>&lt;P&gt;It would be great if Workato offered a WHILE loop to handle this unknown number of pages, but they don't. I suspect they did that to avoid unintentional, long running jobs&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 23:33:16 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1996#M805</guid>
      <dc:creator>jblanchett</dc:creator>
      <dc:date>2021-12-21T23:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1997#M806</link>
      <description>&lt;P&gt;You still got to make sure it can get processed within the allowed timeframe. In this case I think it is 90 minutes or it will just time-out.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 23:44:39 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1997#M806</guid>
      <dc:creator>steven-marissen</dc:creator>
      <dc:date>2021-12-21T23:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1998#M807</link>
      <description>&lt;P&gt;One strategy we have used for large lists that may require lots of calculations (like analysis on all POs for the entire year) is to do something like this:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Recipe 1 (Controller Recipe) - determines number of pages and kicks off the individual processes (or for an unknown number of pages monitors for when the process is complete)&lt;/P&gt;&lt;P&gt;Recipe 2 (Grunt Work Recipe) - callable recipe that gets each page of data and stores data in a temporary location (potentially doing some calculation/transformation)&lt;/P&gt;&lt;P&gt;Recipe 3 (Clean-up) - once all the pages are processed the controller recipe will start the clean-up recipe to create the final deliverable&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;We have built recursive-style processes using workato pub/sub and we have daisy-chained multiple processes of these together to do multiple large scale extractions and transformations.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Generating the 1099 report is a good example.  This process has multiple large scale extractions that are dependent on each other.  We had to get:&lt;/P&gt;&lt;P&gt;1. all vendors that are 1099-able out of NetSuite&lt;/P&gt;&lt;P&gt;2. all accounts in NetSuite that are designated as 1099-able&lt;/P&gt;&lt;P&gt;3. all bills for the vendors&lt;/P&gt;&lt;P&gt;4. all payments for those bills&lt;/P&gt;&lt;P&gt;5. calculate the percentage of lines on the bill that were 1099-able, and what percentage of the payment was applied to each line to get the 1099 amount&lt;/P&gt;&lt;P&gt;6. after all the calculations were complete - do the roll up to calculate the 1099 amount per payment, per bill, and eventually per vendor.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;We didn't know the number of vendors, bill, or payments and had to track all of this independently (in addition to dealing with delays in getting data out of netsuite and doing calculations).  The process was 100% automated (click "Start" and then 20 minutes later you received the report of all 1099s for vendors).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 00:14:39 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1998#M807</guid>
      <dc:creator>mike-flynn1</dc:creator>
      <dc:date>2021-12-22T00:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1999#M808</link>
      <description>&lt;P&gt;The design that we use is to move the logic to a callable recipe and perform one job per page of the API call. When all the records in the page are processed, call the same recipe with the next page URL (you can call callable recipe xyz). Stop the execution when the last page is reached.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;- Main Recipe: MR_1: Can run on a schedule. It will async call CR_1.&lt;/P&gt;&lt;P&gt;- Callable Recipe 1: CR_1 - This recipe simply calls another callable recipe (CR_2 - Async)&lt;/P&gt;&lt;P&gt;- Callable Recipe 2: CR_2 - This recipe will have an input parameter "page_url" that can be used to make a paginated call and then process the records.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If CR_2 recieves another page, then it will call and pass the page_url to CR_1 which will call CR_2 again. This process will continue unless you reach the last page.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Additionally, if you have huge volume of data, then create another Callable Recipe CR_3 to process individual records. CR_2 can pass the data for each record to CR_3. Pros: Use concurrency to increase 5x throughput, Better error debugging as each record will have it's own job.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 01:10:46 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/1999#M808</guid>
      <dc:creator>prerak-rustagi</dc:creator>
      <dc:date>2021-12-22T01:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2000#M809</link>
      <description>&lt;P&gt;It would be great if we could have the ability to call a callable from itself. &lt;A href="https://systematic.workato.com/workato-migration/users/2371475"&gt;Deven Maru&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 03:15:19 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2000#M809</guid>
      <dc:creator>mroldanvega</dc:creator>
      <dc:date>2021-12-22T03:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2001#M810</link>
      <description>&lt;P&gt;I had to do this recently. Everyone's advice is great. I just wanted to point to some recipe examples that show this. This post has two good examples:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://support.workato.com/en/support/discussions/topics/1000093084" target="_blank" rel="noreferrer noopener"&gt;Recipe pagination examples : Workato Success Center&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Dec 2021 04:09:05 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2001#M810</guid>
      <dc:creator>jeremyo</dc:creator>
      <dc:date>2021-12-22T04:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2002#M811</link>
      <description>&lt;P&gt;That sounds like quite the contstructions. I'm just trying to pull data on a couple thousand slack channels! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;What's been your transient storage system of choice for all that data? &lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 05:59:54 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2002#M811</guid>
      <dc:creator>michielb</dc:creator>
      <dc:date>2021-12-22T05:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2003#M812</link>
      <description>&lt;P&gt;Sometimes lookup tables if the data doesn't return too many columns or multiple relationships.  For more complicated use cases we use a MySQL database.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 08:02:40 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2003#M812</guid>
      <dc:creator>mike-flynn1</dc:creator>
      <dc:date>2021-12-22T08:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2004#M813</link>
      <description>&lt;P&gt;We do this with a few recipes. One thing I think Workato sshold consider is building this pagination into the connectors themselves directly. With the billing model including number of actions, doing these paginations with helper lists can create some pretty huge action numbers from a recipe run making these recipes quite expensive.  I can't think of any use cases outside of testing where it would make sense to not retrieve all of the results and the logic to figure these paginations out really inhibits the idea of citizen develpment as it can get pretty complex. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;For example, Okta will paginate group members and you need to dig through the http header with a custom action to get the link to the next result page if it exists which is different than a lot of other APIs that simply add the next page or whatever into the body attributes. We use helper lists for this and it wrks but consumes a lot of actions. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;A much more challenging use case is BigQuery. We have a recipe that runs a query that results is a relatively large file we need to SFTP to a vendor. BigQuery will paginate on number of records OR size of data. In this case we are retrieving a lot of columns so we hit the data limit first (which btw took a very long time to figure out). So if you add another column to your query the number of results will change. In this case we had to create a helper list to take the total results and divide by the number of rows returned to know how many iterations were needed to get the full results since it can be different depending on the run and the data returned. We create an entry in the helper list to represent the iteration so it's usually just a list with like 3 or 4 rows. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;It's possible to do all of this inside recipes but it seems like it would be a lot more trivial to do behind the scenes in the ruby built into the connector itself and also limit the number of actions we need to consume to run these things and not make us figure it out on our own. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 11:04:53 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2004#M813</guid>
      <dc:creator>rbflood</dc:creator>
      <dc:date>2021-12-22T11:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2005#M814</link>
      <description>&lt;P&gt;I have a simple implementation using "flag":&lt;/P&gt;&lt;P&gt;(1) create variable "flag"="" (empty string)&lt;/P&gt;&lt;P&gt;(2) create helper list 100, assume max 100 pages&lt;/P&gt;&lt;P&gt;(3) iterate through helper list&lt;/P&gt;&lt;P&gt;(4) inside loop:&lt;/P&gt;&lt;P&gt;(4a) if "flag" does not equal "pagination_end", call API and process the data. For example start pagination with ([index]*50)+1 for 50 records each page.&lt;/P&gt;&lt;P&gt;(4b) if list size &amp;lt; 50, update variable "flag"="pagination_end"&lt;/P&gt;&lt;P&gt;(5) after pagination the recipe can continue&lt;/P&gt;&lt;P&gt;This will ensure that the remaining iteration will be skipped while the recipe continues. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;See example: https://app.workato.com/recipes/1969723?st=7b3e58&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 12:30:46 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2005#M814</guid>
      <dc:creator>james-ng</dc:creator>
      <dc:date>2021-12-22T12:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination of API endpoints with Workato</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2006#M815</link>
      <description>&lt;P&gt;Yeah, it feels like there should be some control mechanism to support pagination. I suppose you could build a custom connector to handle the case, but that's somewhat defeating the point of a low-code system.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 03:43:59 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/pagination-of-api-endpoints-with-workato/m-p/2006#M815</guid>
      <dc:creator>michielb</dc:creator>
      <dc:date>2021-12-23T03:43:59Z</dc:date>
    </item>
  </channel>
</rss>

