{
  "name": "Airtable \u2192 Weekly Report PDF",
  "nodes": [
    {
      "parameters": {
        "operation": "list",
        "baseId": "",
        "tableId": ""
      },
      "id": "airtable",
      "name": "Airtable Query",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const rows=$input.all().map(i=>i.json);\nlet html='<h1>Weekly Report</h1><table>';\nrows.forEach(r=>{html+='<tr><td>'+r.fields?.Name+'</td><td>'+r.fields?.Status+'</td></tr>'});\nhtml+='</table><p>Generated: '+new Date().toDateString()+'</p>';\nreturn {html,count:rows.length};"
      },
      "id": "compose",
      "name": "Compose Report",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "reports@example.com",
        "toEmail": "team@example.com",
        "subject": "Weekly Report",
        "html": "={{ $json.html }}"
      },
      "id": "email",
      "name": "Email Report",
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {
    "Airtable Query": {
      "main": [
        [
          {
            "node": "Compose Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compose Report": {
      "main": [
        [
          {
            "node": "Email Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}