Multi-Factor Authentication using Voice Calls and Email Verification - n8n Workflow

Implement robust MFA using this n8n workflow. Combines ClickSend TTS voice verification and SMTP email codes for enhanced security. Utilize the n8n trigger form to start the flow.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Security Teams: Needing to prototype or deploy MFA solutions quickly. Developers: Looking for an integrated example of using Text-to-Speech APIs (ClickSend) within a low-code environment like n8n. Business Operations: Requiring verified user contact information (phone and email) through a single, automated n8n workflow. n8n Users: Interested in advanced flow control and combining external APIs (ClickSend) with standard email protocols (SMTP).

Overview

This comprehensive n8n workflow provides a robust solution for implementing multi-factor authentication (MFA) without relying on complex, custom-built backend services. Utilizing an On form submission n8n trigger, users submit their phone number and email details, initiating a dual-factor verification process. This specific n8n template ensures security by sequentially validating two distinct factors: a voice code and an email code.

The voice code is delivered using the ClickSend API's Text-to-Speech (TTS) capabilities, ensuring the user hears the code spoken aloud. If the voice verification succeeds, the n8n workflow immediately sends a secondary verification code via email using an SMTP connection. Every n8n node in this flow handles a specific critical step—from code generation and voice formatting to conditional logic (If nodes) and external communication, demonstrating the power of the n8n platform for mission-critical authentication processes. This powerful n8n workflow helps secure user accounts and verify contact details efficiently.

How it Works

This n8n workflow executes a sequential, two-step verification process:


  1. Initiation (n8n Trigger): The flow starts when a user submits data through the On form submission n8n trigger, providing their phone number, desired voice language, email address, and name.

  2. Voice Code Setup: The Set voice code n8n node defines the initial numerical code (e.g., '12345'). The subsequent Code for voice n8n node runs a custom JavaScript script to add spaces between the digits (e.g., '1 2 3 4 5') to improve the clarity of the Text-to-Speech voice call.

  3. Voice Call: The Send Voice n8n node (HTTP Request configured for ClickSend) uses the spaced code to initiate a voice call to the user’s number, speaking the verification number.

  4. Voice Verification Check: The user enters the received code into the Verify voice code form. The Is voice code correct? n8n node checks if the input matches the set code. If the code fails, the user is redirected to the Fail voice code completion form.

  5. Email Code Setup & Delivery: If the voice verification succeeds, the n8n workflow proceeds to the email step. The Set email code n8n node defines the second code (e.g., '56789'). The Send Email n8n node then delivers this code to the user via SMTP.

  6. Email Verification Check: The user enters the email code into the Verify email code form. The Is email code correct? n8n node performs the final validation. If both factors are correct, the Success n8n node displays the completion message. If the email code fails, the Fail email code n8n node terminates the process.

Installation Guide

To deploy this powerful n8n template, follow these steps:


  1. Import: Copy the provided JSON and import it into your n8n instance using the 'New' menu -> 'Import from JSON'.

  2. ClickSend Credentials: This n8n workflow requires credentials for the ClickSend API.

Register with ClickSend and obtain your username and API Key.
In the Send Voice n8n node, create a new 'HTTP Basic Auth' credential. Use your ClickSend username and the API Key as the password.

  1. SMTP Credentials: Configure the Send Email n8n node with your SMTP credentials.

Set up a new SMTP credential connection specifying your host, port, username, and password.
Ensure you update the 'From Email' field in the Send Email n8n node to a valid sender address.

  1. Set Codes: Review the Set voice code and Set email code n8n nodes. While currently static for demonstration, you should consider using a function or a custom n8n node to generate a random, time-bound code in a production environment.

  2. Activation: Set the n8n workflow to 'Active' to enable the On form submission n8n trigger.

Node Details

On form submission (n8n trigger): The starting point of the n8n workflow. It collects user input including phone number ('To'), preferred TTS voice, language, email, and name.
Set voice code / Set email code (Set n8n node): Used to hardcode the verification numbers (12345 and 56789) for demonstration purposes.
Code for voice (Code n8n node): Executes a Javascript function to modify the voice code, inserting spaces between characters (e.g., 1 2 3 4 5) to ensure the Text-to-Speech (TTS) engine pronounces the digits individually.
Send Voice (HTTP Request n8n node): Interfaces with the ClickSend REST API to initiate a TTS voice call. It uses Basic Authentication and dynamically injects the user's phone number and the spaced verification code.
Verify voice code / Verify email code (Form n8n node): Acts as a prompt to the user to enter the code they received via call or email.
Is voice code correct? / Is email code correct? (If n8n node): Implements the core flow control logic. This critical n8n node compares the user-submitted code against the internally stored correct code, directing the n8n workflow down the success or failure path.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*