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
- Runs on a cron schedule Tuesday to Saturday at 07:30 (Madrid time).
- Calls the BORME API to retrieve yesterday’s INCORPORATION events, paging through up to 20 pages of 200 events each.
- Splits the API response into individual events.
- Extracts and flattens key incorporation fields (such as company name, province, address, capital, CNAE, and source PDF URL) into a single row per event.
- Appends or updates rows in Google Sheets, matching on
event_id to avoid duplicates.
- Optionally converts the rows to a CSV file and saves it to disk when running on self-hosted n8n.
Setup
- 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.
- Add a Google Sheets OAuth credential and set the target spreadsheet URL and sheet name in the workflow’s Settings values.
- Ensure your Google Sheet includes an
event_id column so rows can be matched and updated correctly.
- (Optional, self-hosted) Enable the CSV nodes and set
csv_folder to a writable path for saving the generated CSV files.
Requirements