Generate TOTP Codes Securely with n8n Automation

This unique n8n workflow automates the generation of Time-Based One-Time Passwords (TOTP), simplifying secure authentication for users. It saves manual effort and reduces errors by generating TOTP codes instantly upon a trigger.
manualTrigger
totp
Workflow Identifier: 2343
NODES in Use: Manual Trigger, TOTP
Automate TOTP codes with n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow generates a new Time-Based One-Time Password (TOTP) code automatically when triggered.

This stops manual copying of codes and gives a fresh code fast for secure logins.

It uses a saved TOTP secret key to make each code valid and accurate to your timezone.

You get the generated TOTP code immediately after running the workflow.


Who should use this workflow

This is for anyone who needs one-time 2FA codes often and finds it slow or error-prone to get them by hand.

It helps IT staff, admins, or users managing many 2FA accounts to save time and avoid login mistakes.


Tools and services used

  • n8n Automation Platform: To build and run the workflow.
  • TOTP node: Generates the one-time password codes inside n8n.
  • Manual Trigger node: Lets you start the code generation anytime you want.
  • n8n credentials system: Saves the secret key securely for the TOTP node.

Beginner step-by-step: How to use this workflow in n8n production

Step 1: Download and import the workflow

  1. Click the Download button on this page to get the workflow file.
  2. Open your n8n editor.
  3. Use the Import from File feature in n8n to load the downloaded workflow.

Step 2: Configure credentials and settings

  1. Go to the TOTP node in the workflow.
  2. Set or add TOTP credentials using your secret key.
  3. Update any IDs, emails, or channels if the workflow sends notifications (not in this basic example).
  4. Check your workflow timezone matches your local time.

Step 3: Test the workflow

  1. Click the run button on the Manual Trigger node.
  2. Look at the output panel to see the fresh TOTP code.

Step 4: Activate for production

  1. Switch the workflow to active mode so it can run on demand.
  2. Use the manual trigger button whenever you need a new code.

You can also add extra nodes later to send codes by email or chat, or trigger automatically on set times.

For private control, consider running self-host n8n.


Inputs, Processing, Output

  • Input: Manual trigger runs when you click a button.
  • Processing: The TOTP node uses stored secret keys and timezone to make a current valid code.
  • Output: Shows the fresh TOTP code immediately for secure login use.

Customization ideas

  • Use different TOTP credentials for multiple accounts.
  • Replace manual trigger with a Cron node to generate codes on a schedule.
  • Add a Code node after TOTP to format code or add messages.
  • Add email or chat nodes to send codes automatically.

Troubleshooting common issues

  • Issue: No or wrong TOTP code.
  • Cause: Wrong secret or timezone mismatch.
  • Fix: Check secret key and workflow timezone carefully.
  • Issue: Manual trigger does not start the workflow.
  • Cause: Nodes not connected or workflow inactive.
  • Fix: Connect Manual Trigger node to TOTP node and activate workflow.

Pre-production checklist

  • Make sure TOTP credentials are entered and saved correctly.
  • Test manual trigger to confirm valid TOTP code generation.
  • Verify timezone matches where you use the codes.
  • Backup workflow before changing important parts.

Deployment guide

Turn on the workflow by activating it in the n8n editor.

Now codes can be generated on demand with a click.

For better scale, add steps to send codes by notifications automatically.

Use n8n logs to track code generation and find errors fast.


Summary

✓ Saves time by automating TOTP code creation.

✓ Reduces mistakes from manual code copying and typing.

✓ Generates correct TOTP codes using secure credentials and local time.

✓ Easy to trigger manually or schedule for automatic code delivery.

→ Gives users quick and reliable 2FA codes for secure logins.


Automate TOTP codes with n8n

Visit through Desktop to Interact with the Workflow.

Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.