{
  "workflow": {
    "id": 2696,
    "name": "Complete guide to setting up and generating TOTP codes in n8n 🔐",
    "views": 1449,
    "recentViews": 0,
    "totalViews": 1449,
    "createdAt": "2025-01-04T21:19:45.650Z",
    "description": "#  Setting Up and Generating TOTP\n\n## Step 1: Receive QR Code and Extract the Link\n\n**1. Receive the QR Code from the 2FA service**\nAfter enabling two-factor authentication (2FA) on services like OpenAI, Google, GitHub, etc., a QR Code will be given to you, which you need to scan. This QR Code contains the TOTP link used to generate one-time passcodes.\n\n**2. Extract the link from the received QR Code**\nTo extract the link from the QR Code, use online tools. These tools will help you extract the corresponding link.\n\nAfter using an online tool, the extracted link will appear in the following format:\n\n```\notpauth://totp/ServiceName:username?secret=secret_key&issuer=ServiceName\n```\nFor example:\n```\notpauth://totp/OpenAI:amir676080@gmail.com?secret=test-test-test&issuer=OpenAI\n```\n\n\n## Step 2: Create TOTP Credential in n8n\n\n1. **Create a new Credential**\nTo use TOTP in n8n, you need to create a new **TOTP Credential**.\n\n2. **Enter the details in the Credential**\n- **In the Secret field:** Enter the **secret key** (extracted from the QR Code link). \nFor example:\n```\n test-test-test\n```\n\n- **In the Label field:** Enter **ServiceName:username** \nFor example:\n```\nOpenAI:amir676080@gmail.com\n\n```\n\n![image.png](fileId:882)\n\n3. **Save the Credential**\nAfter entering the information, click Save to save the Credential.\n\n## Step 3: Get the TOTP Code\n**Click on Test Workflow**\nAfter setting up the credentials in n8n, click on Test, and the corresponding code will be delivered to you.\n\nOutput:\n```\n[\n  {\n    \"token\": \"720769\",\n    \"secondsRemaining\": 18\n  }\n]\n```\n![image.png](fileId:883)\n\n\n**==This code is exactly the same as the one generated by apps and services like Google Authenticator or Authy. 🔐==**\n\n\nContact me on [Telegram]: https://t.me/amir676080\n\n",
    "workflow": {
      "id": "0wfomsVO0TQtQkwU",
      "meta": {
        "instanceId": "2e75c9fb3cdcf631da470c0180f0739986baa0ee860de53281e9edc3491b82a3"
      },
      "name": "Complete Guide to Setting Up and Generating TOTP Codes in n8n 🔐",
      "tags": [],
      "nodes": [
        {
          "id": "0fe95b9a-be2b-4022-829e-8b6c801e5baf",
          "name": "When clicking ‘Test workflow’",
          "type": "n8n-nodes-base.manualTrigger",
          "position": [
            -280,
            -340
          ],
          "parameters": {},
          "typeVersion": 1
        },
        {
          "id": "02fee6b5-7770-4889-b9bb-89bface8872d",
          "name": "TOTP",
          "type": "n8n-nodes-base.totp",
          "position": [
            -40,
            -340
          ],
          "parameters": {
            "options": {}
          },
          "credentials": {
            "totpApi": {
              "id": "credential-id",
              "name": "totpApi Credential"
            }
          },
          "typeVersion": 1
        }
      ],
      "active": false,
      "pinData": {},
      "settings": {
        "timezone": "Asia/Tehran",
        "callerPolicy": "workflowsFromSameOwner",
        "executionOrder": "v1"
      },
      "versionId": "d7a5fff3-3fcd-45cd-ba06-564097567ff5",
      "connections": {
        "When clicking ‘Test workflow’": {
          "main": [
            [
              {
                "node": "TOTP",
                "type": "main",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 16,
    "workflowInfo": {
      "nodeCount": 2,
      "nodeTypes": {
        "n8n-nodes-base.totp": {
          "count": 1
        },
        "n8n-nodes-base.manualTrigger": {
          "count": 1
        }
      }
    },
    "status": "published",
    "readyToDemo": null,
    "user": {
      "name": "AmirHossein MnasouriZade",
      "username": "amir676080",
      "bio": "Hi !\nI'm Amirhossein Mansouri Zade, a student with 4 years of experience in SEO and search engine optimization. Currently, I'm focused on solving various problems and challenges.\nI’m gradually transitioning into the product field and enjoy building the tools I need using N8N. I'll be sharing my workflows and experiences here along the way. 🚀",
      "verified": false,
      "links": [
        "https://www.linkedin.com/in/amirhossein-mansouri-zade/"
      ],
      "avatar": "https://gravatar.com/avatar/e36db6727bb544821e1e5d3ed64b3fa4a4681baaa8087eb67d0af1667eefd855?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 838,
        "icon": "fa:mouse-pointer",
        "name": "n8n-nodes-base.manualTrigger",
        "codex": {
          "data": {
            "resources": {
              "generic": [],
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.manualworkflowtrigger/"
                }
              ]
            },
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0"
          }
        },
        "group": "[\"trigger\"]",
        "defaults": {
          "name": "When clicking ‘Execute workflow’",
          "color": "#909298"
        },
        "iconData": {
          "icon": "mouse-pointer",
          "type": "icon"
        },
        "displayName": "Manual Trigger",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 845,
        "icon": "fa:fingerprint",
        "name": "n8n-nodes-base.totp",
        "codex": {
          "data": {
            "alias": [
              "2FA",
              "MFA",
              "authentication",
              "Security",
              "OTP",
              "password",
              "multi",
              "factor"
            ],
            "details": "Generate a time-based one-time password",
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.totp/"
                }
              ]
            },
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": [
              "Helpers"
            ]
          }
        },
        "group": "[\"transform\"]",
        "defaults": {
          "name": "TOTP"
        },
        "iconData": {
          "icon": "fingerprint",
          "type": "icon"
        },
        "displayName": "TOTP",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 29,
        "name": "SecOps"
      }
    ],
    "image": [
      {
        "id": 882,
        "url": "https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_e1d834b17f.png"
      },
      {
        "id": 883,
        "url": "https://n8niostorageaccount.blob.core.windows.net/n8nio-strapi-blobs-prod/assets/image_1392b61b8b.png"
      }
    ]
  }
}