# Publish website redirects from Google Sheets

Publish a checked table of same-site redirects in one KV write. Invalid rows leave the working table in place.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=google-sheets-redirects-to-cloudflare-kv&templateName=Publish+website+redirects+from+Google+Sheets)

**Required accounts**

- Google Sheets
- Cloudflare Workers KV

## Publish website redirects from Google Sheets

### 1. Trigger · Daily schedule

**Schedule**. Run automatically on the configured schedule.

### 2. Action · Read the redirect table

**Google Sheets**. Call any Google Sheets API v4 operation with the connected account.

### 3. Action · Publish the checked redirect table

**Cloudflare Workers KV**. Check every source and destination before replacing the active redirect table in a single write. A conflicting row leaves the previous table available.

## Set up your workflow

1. **Prepare the two-column sheet** Name the first two cells source and destination. Start with /old-guide and /guides/start in row 2. Use paths on your own site. Blank rows are ignored and each source must occur once.
2. **Select the spreadsheet and schedule** Connect Google Sheets and enter /v4/spreadsheets/SPREADSHEET\_ID/values/Redirects!A:B as the API path. Replace the ID and tab name, then choose how often the schedule should publish edits.
3. **Connect KV to your website** Select the namespace in the publishing step. Bind that same namespace as ROUTES in your redirect Worker and keep its table key at redirects:active. The supplied Worker example reads this key for each request. [Download the redirect Worker](https://www.fasthook.io/examples/kv-redirect-worker.mjs)
4. **Test a redirect and a rejected edit** Run the workflow, then request /old-guide without following redirects. Check for HTTP 301 and a Location ending in /guides/start. Add a second /old-guide row and rerun. The publish step should reject it and the original redirect should still work.

## Related integrations

- [Schedule trigger](https://www.fasthook.io/docs/triggers/schedule)
- [Google Sheets integrations](https://www.fasthook.io/apps/google-sheets/integrations)
- [Cloudflare Workers KV integrations](https://www.fasthook.io/apps/cloudflare-workers-kv/integrations)

## Related workflow templates

- [Back up a group of KV keys to R2](https://www.fasthook.io/templates/cloudflare-kv-prefix-backups-to-r2.md): Export a selected prefix with binary values, metadata and absolute expiry times.
- [Audit Klaviyo reporting settings in Google Sheets](https://www.fasthook.io/templates/klaviyo-account-reporting-settings-to-google-sheets.md): Every 10 minutes, append the scheduled time and these readings to the worksheet you choose at installation: Account time zone, Reporting currency, Account locale.
- [Track Klaviyo audience growth in Google Sheets](https://www.fasthook.io/templates/klaviyo-daily-list-growth-to-google-sheets.md): Every 10 minutes, record the scheduled time and the number of profiles in the Klaviyo list you choose.
- [Track the most active Polymarket event each day in Google Sheets](https://www.fasthook.io/templates/polymarket-daily-most-active-event-to-google-sheets.md): Every 10 minutes, append the scheduled time and these readings to the worksheet you choose at installation: Leading event ID, Trading volume over the last 24 hours, Liquidity.
- [Track Raindrop.io file upload usage in Google Sheets](https://www.fasthook.io/templates/raindrop-upload-quota-to-google-sheets.md): Every 10 minutes, append the scheduled time and these readings to the worksheet you choose at installation: Upload space used this month, Monthly upload allowance.
- [Track the Clerk user count in Google Sheets](https://www.fasthook.io/templates/clerk-daily-user-count-to-google-sheets.md): Every 10 minutes, append the scheduled time and these readings to the worksheet you choose at installation: Registered users.
