n8n

How to Automate Squarespace to GitHub Backups?

Protect your site code by saving Squarespace header and footer injections to GitHub on a set schedule. Great for web teams and agencies that want history, version control, and easy rollback without manual copy and paste.

A schedule or manual run pulls your site data, extracts the header and footer injection blocks, cleans the code, and then saves them as HTML files in a GitHub repository. The flow tries to update the files first and creates them if they do not exist. A global settings node stores the repo owner, repo name, and folder path so you can point backups to the right place. Batch logic processes the header and footer together, and each commit includes a timestamp to track changes over time.

Setup is simple. Add your Squarespace site URL to the HTTP step and enter your GitHub details in the globals node. Expect consistent backups every few hours and a clean commit history per site. This is useful for compliance, client reporting, and fast recovery if something breaks on your site.

What are the key features?

  • Runs on a schedule every two hours and can also run on demand
  • Fetches Squarespace page context and reads header and footer injections
  • Cleans and normalizes the HTML before saving to keep files tidy
  • Processes header and footer as a small batch for each site
  • Edits files in GitHub if they exist and creates them if they do not
  • Stores repo owner, name, and path in one globals node for easy changes
  • Merges header and footer data before batching so both are always saved
  • Adds a timestamp to each commit to track when backups ran

What are the benefits?

  • Reduce manual backup work from 30 minutes to 2 minutes per site
  • Automate 100 percent of header and footer backup tasks
  • Improve backup accuracy by removing copy and paste errors
  • Keep a dated GitHub history for quick rollback and audits
  • Scale to many client sites with the same setup

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with GitHub and Squarespace. See the Tools Required section above for links to create accounts with these services.
  3. Open the Get Squarespace data node and paste your site URL. Keep the query parameter format set to page-context. Make sure the site is public so the request can read the page data.
  4. Open the Globals node and set repo.owner to your GitHub username, repo.name to the repository name, and repo.path to the folder you want for backups. End the path with a slash.
  5. Set up GitHub credentials: double click the Edit Injection data node, then on the Credential to connect with dropdown, click Create new credential. Choose GitHub and follow the on screen steps. If using a personal access token, create one in GitHub with repo scope and paste it into n8n.
  6. Repeat the same GitHub credential selection for the Create Injection data node so both GitHub nodes use the same credential.
  7. Check the Schedule Trigger and adjust the interval to match your policy. The default runs every two hours.
  8. Click Execute on the manual trigger to run a test. After it completes, open your GitHub repo and confirm two HTML files were created or updated in the chosen folder.
  9. If files are not created, verify the repo.path has a trailing slash and that your GitHub credential has access to the repo. Also confirm the site URL is correct and reachable.
  10. Review commit messages to see timestamps. Leave the schedule active to keep backups current without manual steps.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

GitHub

Sign up

Free tier: $0 / mo

Squarespace

Sign up

Advanced plan: $99 / mo (billed annually) required for Developer API keys

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.