{
  "id": "43hulIlfnB1UAXxn",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "random-string-generator",
  "tags": [],
  "nodes": [
    {
      "id": "9025bee8-18c5-4e9f-be2d-50ec77ba1730",
      "name": "Generate a random string",
      "type": "n8n-nodes-base.crypto",
      "position": [
        200,
        -20
      ],
      "parameters": {
        "action": "generate",
        "encodingType": "base64",
        "stringLength": "={{ $('rand_generator_form').item.json.length }}"
      },
      "executeOnce": false,
      "retryOnFail": false,
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "f82ca3f1-25b8-4d84-8dc9-055364aac3a7",
      "name": "rand_generator_form",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -240,
        -20
      ],
      "parameters": {
        "options": {
          "buttonLabel": "Generate now"
        },
        "formTitle": "rand pass generator",
        "formFields": {
          "values": [
            {
              "fieldType": "number",
              "fieldLabel": "length",
              "placeholder": "16",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "copies",
              "placeholder": "5",
              "requiredField": true
            }
          ]
        },
        "responseMode": "lastNode"
      },
      "typeVersion": 2.2
    },
    {
      "id": "042211a5-364c-43d5-a4e1-d3842c3c90d3",
      "name": "Display results",
      "type": "n8n-nodes-base.form",
      "position": [
        1080,
        -20
      ],
      "parameters": {
        "operation": "completion",
        "respondWith": "showText",
        "responseText": "={{ $json.html }}"
      },
      "typeVersion": 1
    },
    {
      "id": "2d8f8a46-8260-4f03-b48a-aff708c17297",
      "name": "format into html",
      "type": "n8n-nodes-base.html",
      "position": [
        860,
        -20
      ],
      "parameters": {
        "html": "<!DOCTYPE html>\n\n<html>\n<head>\n  <meta charset=\"UTF-8\" />\n  <title>random strings</title>\n</head>\n<body>\n  <div class=\"container\">\n  <h2>{{ $('rand_generator_form').item.json.copies }}X {{ $('rand_generator_form').item.json.length }}-char random strings</H2>\n  \n  <ul>{{ $json.concatenated_data }}</ul>\n  </div>\n</body>\n</html>\n\n<style>\ncontainer {\n  background-color: #ffffff;\n  text-align: center;\n  padding: 16px;\n  border-radius: 8px;\n}\n\nh1 {\n  color: #ff6d5a;\n  font-size: 24px;\n  font-weight: bold;\n  padding: 8px;\n}\n\nh2 {\n  color: #909399;\n  font-size: 18px;\n  font-weight: bold;\n  padding: 8px;\n}\n</style>\n\n<script>\nconsole.log(\"Hello World!\");\n</script>"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8a133d07-aad9-4b34-94f2-dfe624602a3d",
      "name": "concatenate items",
      "type": "n8n-nodes-base.summarize",
      "position": [
        640,
        -20
      ],
      "parameters": {
        "options": {},
        "fieldsToSummarize": {
          "values": [
            {
              "field": "data",
              "separateBy": "\n",
              "aggregation": "concatenate"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "5373a3a2-fe56-4278-95f5-ddee17ad2e5c",
      "name": "format an item",
      "type": "n8n-nodes-base.set",
      "position": [
        420,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ac0116d7-11bb-4a51-8660-d4c276e52ba3",
              "name": "data",
              "type": "string",
              "value": "=<li>{{ $json.data }}</li>"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2a9c823c-8fdc-42a3-8787-384373cb695d",
      "name": "duplicates",
      "type": "n8n-nodes-base.set",
      "position": [
        -20,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": []
        },
        "duplicateItem": true,
        "duplicateCount": "={{ $json.copies -1}}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "fdcbc663-20b4-4d19-ad61-a28b92f1c137",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -180
      ],
      "parameters": {
        "width": 1640,
        "height": 600,
        "content": "## random-string generator\n\n### Summary\nThis n8n workflow generates random strings containing only alphanumeric characters. \nYou can specify the length of the string and how many copies you like to generate.\n\n\n\n\n\n\n\n\n\n\n\n### Nodes used\n* formTrigger\n* set\n* crypto\n* summarize (concatenate)\n* HTML\n* form (form ending)\n\n### Notes\n* Dups operation is used to generate multipe copies as specified.\n* n8n Form apparently can't display HTML properly yet."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "b5495b3b-4ce9-4050-a952-6403342eb547",
  "connections": {
    "duplicates": {
      "main": [
        [
          {
            "node": "Generate a random string",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "format an item": {
      "main": [
        [
          {
            "node": "concatenate items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "format into html": {
      "main": [
        [
          {
            "node": "Display results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "concatenate items": {
      "main": [
        [
          {
            "node": "format into html",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rand_generator_form": {
      "main": [
        [
          {
            "node": "duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate a random string": {
      "main": [
        [
          {
            "node": "format an item",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}