See llms.txt for all machine-readable content.

Back to Templates

Log daily new Spanish companies to Google Sheets or CSV with BORME API

Quick overview

This workflow runs Tuesday to Saturday at 07:30 (Europe/Madrid), fetches the previous day’s Spanish company incorporation events from the BORME API, and writes one row per event to Google Sheets (with optional CSV export on self-hosted n8n).

How it works

  1. Runs on a cron schedule Tuesday to Saturday at 07:30 (Madrid time).
  2. Calls the BORME API to retrieve yesterday’s INCORPORATION events, paging through up to 20 pages of 200 events each.
  3. Splits the API response into individual events.
  4. Extracts and flattens key incorporation fields (such as company name, province, address, capital, CNAE, and source PDF URL) into a single row per event.
  5. Appends or updates rows in Google Sheets, matching on event_id to avoid duplicates.
  6. Optionally converts the rows to a CSV file and saves it to disk when running on self-hosted n8n.

Setup

  1. Create a Header Auth credential with the header name X-API-Key and your BORME API key as the value, and select it in the BORME API request step.
  2. Add a Google Sheets OAuth credential and set the target spreadsheet URL and sheet name in the workflow’s Settings values.
  3. Ensure your Google Sheet includes an event_id column so rows can be matched and updated correctly.
  4. (Optional, self-hosted) Enable the CSV nodes and set csv_folder to a writable path for saving the generated CSV files.

Requirements