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
- Click the Download button on this page to get the workflow file.
- Open your n8n editor.
- Use the Import from File feature in n8n to load the downloaded workflow.
Step 2: Configure credentials and settings
- Go to the TOTP node in the workflow.
- Set or add TOTP credentials using your secret key.
- Update any IDs, emails, or channels if the workflow sends notifications (not in this basic example).
- Check your workflow timezone matches your local time.
Step 3: Test the workflow
- Click the run button on the Manual Trigger node.
- Look at the output panel to see the fresh TOTP code.
Step 4: Activate for production
- Switch the workflow to active mode so it can run on demand.
- 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.
