{
  "name": "Rows in, QR codes out",
  "nodes": [
    {
      "parameters": {
        "content": "### How it works\nTurn a list of web links into QR codes you can change later. Each row goes to the One Tap QR Actor on Apify, and you get back a code ID, a scan link and an image link for each one.\n\nThe workflow starts in test mode, which is free. Test codes show a notice page when scanned and are deleted 48 hours after they’re made, so don’t print them. When you’re ready, set **Config → mode** to `live`.\nNo subscription. No expiry date. $10 per code, paid once.\n$0.50 per link change.\n\n### Setup\nInstall the verified Apify community node `@apify/n8n-nodes-apify` (tested 0.9.0). Add an Apify API credential and select it on both Apify nodes. In the Actor field, pick the Actor from the list or enter ID `ERfhoylX8E5z1xPSg`. Keep **Config → mode** set to `test` until you want paid codes. Then click Execute workflow.\n\n### Customization\nReplace **Enter sample URLs** with Google Sheets, or another source that outputs one item per row. Use column `destinationUrl` (required, https://) and optional `label`. You can also replace the manual trigger. Connect the new source after **Config**.\n",
        "height": 320,
        "width": 1580,
        "color": 1
      },
      "id": "795c964a-adf9-4532-86a4-50bbd61f703d",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "content": "## Set up the rows\nThe trigger starts the workflow. **Config** sets `mode` (`test` by default, or `live`) and the image format. **Enter sample URLs** holds placeholder links; swap it for Google Sheets when you want rows from a sheet.\n",
        "height": 280,
        "width": 860,
        "color": 7
      },
      "id": "dc2d2494-2141-45eb-a7b1-e14df98c4ce9",
      "name": "Set up the rows",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        20,
        350
      ]
    },
    {
      "parameters": {
        "content": "## Run the Actor\n**Run the One Tap QR Actor** sends the built input to Apify and waits until the run finishes. It uses TEST mode unless you change **Config**.\n",
        "height": 280,
        "width": 280,
        "color": 7
      },
      "id": "f8d7656c-84b4-4bbb-a79b-77b79cee93a6",
      "name": "Run the Actor",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        900,
        350
      ]
    },
    {
      "parameters": {
        "content": "## Collect the results\n**Get created code results** reads the Actor dataset. **Map code ID and links** returns targetUrl, codeId, scanUrl and imageUrl for each row, plus ok and error.\n",
        "height": 280,
        "width": 400,
        "color": 7
      },
      "id": "ef9c55d7-e62a-4001-adb6-5bc9d950f5a9",
      "name": "Collect the results",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1200,
        350
      ]
    },
    {
      "parameters": {
        "content": "## Paid mode warning\nDefault is TEST (free). Setting Config.mode to `live` bills $10 per successfully created code, and those codes persist. $0.50 per later link change.\n",
        "height": 180,
        "width": 280,
        "color": 3
      },
      "id": "d5d787f0-b33a-48bb-8866-4c128f7184f3",
      "name": "Paid mode warning",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        900,
        650
      ]
    },
    {
      "parameters": {},
      "id": "8d8a0900-76c7-4399-bd86-305f3cf0e0f5",
      "name": "When clicking Execute workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        40,
        480
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "2112e6d0-33e8-4600-8432-377cb3c8bc63",
              "name": "mode",
              "value": "test",
              "type": "string"
            },
            {
              "id": "9acaa462-63ba-47b8-bf2e-3648dd177dfb",
              "name": "format",
              "value": "svg",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "69d839a1-349d-4b0d-a260-79634b266e15",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        260,
        480
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "// Placeholder rows. Replace this node with Google Sheets (Read) or another\n// source that outputs one item per row with:\n//   destinationUrl  (required, must start with https://)\n//   label           (optional text drawn under the code)\nreturn [\n  { json: { destinationUrl: 'https://example.com/otqr-rows-in/menu', label: 'Spring menu' } },\n  { json: { destinationUrl: 'https://example.com/otqr-rows-in/hours', label: 'Opening hours' } },\n  { json: { destinationUrl: 'https://example.com/otqr-rows-in/contact', label: 'Contact' } },\n];\n"
      },
      "id": "8f8ba177-3712-4c14-9275-773bda9ee614",
      "name": "Enter sample URLs",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        480
      ]
    },
    {
      "parameters": {
        "mode": "runOnceForAllItems",
        "jsCode": "const cfg = $('Config').first().json;\nconst mode = cfg.mode || 'test';\nconst format = cfg.format || 'svg';\nconst creates = $input.all()\n  .map((i) => i.json)\n  .filter((row) => row && row.destinationUrl)\n  .map((row) => {\n    const item = { destinationUrl: row.destinationUrl, format: row.format || format };\n    if (row.label) item.label = row.label;\n    return item;\n  });\nif (!creates.length) {\n  throw new Error('No rows with destinationUrl. Add at least one URL, or connect Google Sheets with a destinationUrl column.');\n}\nreturn [{ json: { action: 'create_dynamic_qr', mode, creates } }];\n"
      },
      "id": "c4f8e17d-2ad7-4a75-a7eb-e61962c4d69f",
      "name": "Build Actor input from rows",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        700,
        480
      ]
    },
    {
      "parameters": {
        "authentication": "apifyApi",
        "resource": "Actors",
        "operation": "Run actor",
        "actorId": {
          "__rl": true,
          "mode": "id",
          "value": "ERfhoylX8E5z1xPSg"
        },
        "actorInputMode": "json",
        "customBody": "={{ JSON.stringify($json) }}",
        "waitForFinish": true,
        "timeout": 180,
        "memory": 256,
        "build": "latest"
      },
      "id": "f0b82d6e-54ee-4e94-913c-f17112078c48",
      "name": "Run the One Tap QR Actor",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 2,
      "position": [
        940,
        480
      ],
      "credentials": {
        "apifyApi": {
          "id": "",
          "name": "Apify account"
        }
      }
    },
    {
      "parameters": {
        "authentication": "apifyApi",
        "resource": "Datasets",
        "operation": "Get items",
        "datasetId": "={{ $json.defaultDatasetId }}"
      },
      "id": "7a85778d-4008-4ff8-ac8b-b0a996cb7fbe",
      "name": "Get created code results",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 2,
      "position": [
        1220,
        480
      ],
      "credentials": {
        "apifyApi": {
          "id": "",
          "name": "Apify account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0d4a6472-f509-42a6-b792-dd9f5329feb2",
              "name": "targetUrl",
              "value": "={{ $json.destinationUrl }}",
              "type": "string"
            },
            {
              "id": "7070ee9d-a818-45be-bd81-8dc86751d09d",
              "name": "codeId",
              "value": "={{ $json.id }}",
              "type": "string"
            },
            {
              "id": "48cb8090-ed25-45e6-b8ca-98521e67f64e",
              "name": "scanUrl",
              "value": "={{ $json.scanUrl }}",
              "type": "string"
            },
            {
              "id": "173b9e9e-8495-4859-90d5-7e1cdb6527d1",
              "name": "imageUrl",
              "value": "={{ $json.qrImageUrl }}",
              "type": "string"
            },
            {
              "id": "a75e761e-1285-403a-b4eb-b6d61c410ce0",
              "name": "ok",
              "value": "={{ $json.ok }}",
              "type": "boolean"
            },
            {
              "id": "14a4a3ce-e92e-481c-8d1b-1436ceaa3885",
              "name": "error",
              "value": "={{ $json.error }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "e3da12e3-1f26-4d7a-9ab6-1785351dd2e8",
      "name": "Map code ID and links",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        1440,
        480
      ]
    }
  ],
  "connections": {
    "When clicking Execute workflow": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config": {
      "main": [
        [
          {
            "node": "Enter sample URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enter sample URLs": {
      "main": [
        [
          {
            "node": "Build Actor input from rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Actor input from rows": {
      "main": [
        [
          {
            "node": "Run the One Tap QR Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run the One Tap QR Actor": {
      "main": [
        [
          {
            "node": "Get created code results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get created code results": {
      "main": [
        [
          {
            "node": "Map code ID and links",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false,
    "executionTimeout": 300
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
