Skip to main content

Register users and authenticate with magic links using Google Sheets

Workflow preview

Workflow preview
100%
Register users and authenticate with magic links using Google Sheets preview
Open on n8n.io

1. Workflow Overview

This workflow implements a lightweight authentication system for n8n web portals using Google Sheets as a simple user and session store. It supports email based registration, username and password ...

Best for

  • Miscellaneous automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.googlesheets, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.formtrigger, n8n-nodes-base.gmail, n8n-nodes-base.form, n8n-nodes-base.webhook

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by ICTS Automation.

Original n8n.io source

1.1 Workflow description

Title
Register users and authenticate with magic links using Google Sheets
Workflow name
Register users and authenticate with magic links using Google Sheets

This workflow implements a lightweight authentication system for n8n web portals using Google Sheets as a simple user and session store. It supports email-based registration, username and password login, one-click magic link authentication, and cookie-based session management.

How it works

  1. Users register with an email address through a form.
  2. The workflow generates a password and a one-time authentication token.
  3. User credentials and token are stored in Google Sheets.
  4. An email is sent with login credentials and a magic link.
  5. Users can log in with username and password or click the magic link.
  6. The /auth endpoint validates the token, creates a session id (sid), sets it as an HttpOnly cookie, and invalidates the token.
  7. The /profile endpoint reads the sid cookie, verifies the session in Google Sheets, and displays a protected profile page.

Set up steps

  • Create a Google Sheet with columns: username, password, role, token, sid.
  • Replace YOUR_SPREADSHEET_ID with your Google Sheet ID in all Google Sheets nodes.
  • Replace YOUR_DOMAIN with your n8n instance domain in redirect URLs and email links.
  • Configure Gmail or SMTP credentials in the email node.
  • Ensure your n8n instance is served over HTTPS so Secure cookies function correctly.

This template is suitable for small internal portals, admin dashboards, or proof-of-concept authentication systems built entirely within n8n.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Append or update row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 4 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Prepare sid

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Generate token

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - If has token in DB

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 9 - If has token

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 10 - Search by token

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - On form register

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 12 - Create password and token

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Send username/password

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 14 - Notice register success

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 15 - On form login

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 16 - Check username/password

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 17 - If login success

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 18 - Redirect to login form

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 19 - Redirect to auth url

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 20 - Add token to DB

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 21 - Redirect to auth with new token

Type / Role
n8n-nodes-base.form - form
Config choices
Version 1

Block 22 - Auth

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 23 - Invalid token

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 24 - If token valid

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Showing the first 24 of 35 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Register users and authenticate with magic links using Google Sheets
Complexity advanced
Nodes 35
Categories Miscellaneous
Author ICTS Automation
Published 25 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13703/13703.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Register users and authenticate with magic links using Google Sheets do?

This workflow implements a lightweight authentication system for n8n web portals using Google Sheets as a simple user and session store. It supports email based registration, username and password ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous use case.