Sync PR details from API to CSV via SFTP

Recipe ToolsMarketingDeveloper ToolAPI IntegrationData ParserUtilitiesFile Transfer

What it does

When a clock trigger fires every 5 minutes, this automation fetches pull request details in batches. It loops through paginated results, accumulates them into a list, and writes the data to a CSV file on SFTP.

Who it's for

Engineering teams who need to keep pull request data synchronized from an API to a CSV file on a regular schedule.

How teams use this

Sync pull requests to a data warehouse

Fetch PR details every 5 minutes and write them to CSV on Sftp so a data team can load the file into a warehouse for reporting and analysis.

Monitor PR metrics across teams

Run this automation to keep a central CSV updated with the latest pull request data, then use that file to track engineering KPIs and team velocity.

Add filtering by repository or status

Extend the Rest request to include query parameters that filter pull requests by repository name or status so only relevant PRs are synced to the CSV.

Route data to multiple destinations

After accumulating the list, add a second Sftp step or a database connection to send the same PR data to another system for redundancy or different team access.

How it works

  1. Start on a 5 minute interval. This automation runs every 5 minutes to fetch the latest pull request details from the API.
  2. Send request for PR details. Send a request via Rest to fetch pull request details from the API. The loop repeats with an offset to paginate through all results until no more data is returned.
  3. Accumulate results into a list. Collect each batch of pull request items returned from the Rest call into a single list as the loop processes multiple pages of data.
  4. Write data to CSV on SFTP. Upload the accumulated pull request list to a CSV file on an Sftp server so the data is stored and ready for downstream use.