This workflow generates Time-based One-Time Passwords (TOTP) via webhook or manual trigger. Key nodes include Manual Trigger (manual execution), TOTP Webhook (receives requests), Merge Triggers (combines triggers), Validate Input (checks inputs), Check Validation (ensures valid inputs), Rate Limit Check (monitors usage), Generate TOTP Code (creates TOTP), Log TOTP Attempt (records activity), Check TOTP Success (validates result), Format Output (structures response), Success Response (returns code), Validation Error Response (handles invalid inputs), and TOTP Error Response (manages generation errors). No external API is used.\n\nSetup Requirements: Install n8n from n8n.io or sign up at cloud.n8n.io. Import the JSON into n8n’s workflow editor. Configure TOTP credentials in n8n (Credentials > TOTP Account) with a secret key (minimum 16 characters, base32-encoded). Alternatively, provide secretKey in the request. Set up TOTP Webhook with path generate-totp and header authentication (e.g., Bearer YOUR_TOKEN). Configure your app to send POST requests with optional accountName and secretKey (if not using credentials). Handle errors like invalid secret key (400: Invalid input data) or generation failure (500: TOTP generation failed). Set header auth in n8n (Credentials > HTTP Header Auth).\n\nTesting and Deployment: Import the JSON into n8n. Test manually via Manual Trigger or send a POST request to the webhook URL with JSON: {"accountName": "Test", "secretKey": "JBSWY3DPEHPK3PXP"} or using configured credentials and valid auth header. Verify Validate Input checks inputs and Generate TOTP Code produces a 6-digit code. Confirm Success Response returns status 200 with code, timeRemaining, and expiresAt. Test with an invalid secret key ({"secretKey": "short"}) to trigger Validation Error Response (400: Secret key too short). Test with an incorrect secret key format to trigger TOTP Error Response (500: Failed to generate TOTP). Monitor logs for rate limits. If generation fails, verify secret key format or credentials. Activate the workflow in n8n and ensure the webhook is live. Deploy for secure TOTP generation with error handling and response validation.
$5.49
Workflow steps: 13
Integrated apps: manualTrigger, webhook, merge