{
  "name": "Rendex — Render a List to Images, Email as One Message (Iterator + Aggregator)",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": {
        "hook": 1000101,
        "maxResults": 1
      },
      "mapper": {},
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0,
          "name": "Webhook — receive the list"
        },
        "notes": "On import, create/select a custom webhook. Send it a JSON body like {\"items\":[{\"name\":\"Giulia\",\"role\":\"Speaker\"}, ...]}. Any source that yields an array works — swap this for Google Sheets > Search Rows or a Data store list if you prefer."
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": {
        "array": "{{1.items}}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0,
          "name": "Iterator — one bundle per item"
        },
        "notes": "Splits the incoming array into one bundle per item so the Rendex module runs once each. Point 'array' at whatever field holds your list ({{1.items}})."
      }
    },
    {
      "id": 3,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {
        "handleErrors": false,
        "useNewZLibDeCompress": true
      },
      "mapper": {
        "url": "https://api.rendex.dev/v1/screenshot",
        "method": "post",
        "headers": [
          {
            "name": "Authorization",
            "value": "Bearer rdx_YOUR_API_KEY"
          }
        ],
        "qs": [],
        "bodyType": "raw",
        "contentType": "application/json",
        "data": "{\n  \"html\": \"<div style='width:600px;padding:48px;font-family:system-ui;text-align:center'><h1 style='color:#ea580c'>{{name}}</h1><p style='font-size:20px;color:#475569'>{{role}}</p></div>\",\n  \"data\": {\n    \"name\": \"{{2.name}}\",\n    \"role\": \"{{2.role}}\"\n  },\n  \"format\": \"png\"\n}",
        "serializeUrl": false,
        "shareCookies": false,
        "parseResponse": false,
        "followRedirect": true,
        "useQuerystring": false,
        "followAllRedirects": false,
        "timeout": "",
        "ca": "",
        "rejectUnauthorized": true,
        "gzip": true,
        "useMtls": false
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0,
          "name": "Rendex — Render Item PNG"
        },
        "restore": {
          "expect": {
            "method": { "mode": "chose", "label": "POST" },
            "bodyType": { "label": "Raw" },
            "contentType": { "label": "JSON (application/json)" }
          }
        },
        "notes": "Runs once per iteration. Send EXACTLY ONE source field (html). {{2.name}}/{{2.role}} come from the Iterator so each item renders. parseResponse is OFF so the binary (3.data) is what the aggregator collects. Replace rdx_YOUR_API_KEY with your key."
      }
    },
    {
      "id": 4,
      "module": "builtin:BasicAggregator",
      "version": 1,
      "parameters": {
        "feeder": 2
      },
      "mapper": {
        "value": "{{3.data}}"
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0,
          "name": "Array Aggregator — collect every PNG"
        },
        "notes": "The aggregate-BACK step. 'feeder' MUST point at the Iterator (module 2) so it collects the whole loop into one array. 'value' is the Rendex binary (3.data). Downstream this is {{4.array}} — an array of per-item PNGs."
      }
    },
    {
      "id": 5,
      "module": "email:ActionSendEmail",
      "version": 6,
      "parameters": {
        "__IMTCONN__": 1000102
      },
      "mapper": {
        "to": ["team@example.com"],
        "subject": "Your batch is ready",
        "contentType": "text",
        "html": "Every item in the batch is attached as a PNG.",
        "attachments": [
          {
            "fileName": "render.png",
            "data": "{{item.value}}"
          }
        ],
        "copy": [],
        "blindCopy": []
      },
      "metadata": {
        "designer": {
          "x": 1200,
          "y": 0,
          "name": "Email — one message, all attachments"
        },
        "notes": "On import, select/create your email/SMTP connection. Map the attachment 'data' from the aggregated collection {{4.array}} (each element's value = a rendered PNG). One email is sent AFTER the loop with every render attached. Set your recipient in 'to'."
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "us1.make.com"
  }
}
