{ "nodes": [ { "id": "yesterday-hubspot-contacts-to-mailchimp-cron", "name": "Every day at 07:00", "type": "n8n-nodes-base.cron", "position": [ 480, 300 ], "parameters": { "triggerTimes": { "item": [ { "hour": 7 } ] } }, "typeVersion": 1 }, { "id": "yesterday-hubspot-contacts-to-mailchimp-read", "name": "Get new contacts", "type": "n8n-nodes-base.hubspot", "position": [ 700, 300 ], "parameters": { "resource": "contact", "operation": "search", "authentication": "oAuth2", "filterGroupsUi": { "filterGroupsValues": [ { "filtersUi": { "filterValues": [ { "value": "={{$today.minus({day:1}).toMillis()}}", "operator": "GTE", "propertyName": "createdate" }, { "value": "={{$today.toMillis()}}", "operator": "LT", "propertyName": "createdate" } ] } } ] }, "additionalFields": {}, "returnAll": false, "limit": 100 }, "typeVersion": 1 }, { "id": "yesterday-hubspot-contacts-to-mailchimp-validate", "name": "Validate contacts", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "const items=$input.all();for(const item of items){const p=item.json.properties;if(!p || typeof p.email !== 'string' || !p.email.trim() || typeof p.firstname !== 'string' || typeof p.lastname !== 'string') throw new Error('Each HubSpot contact needs email, first name and last name text');}return items;" } }, { "id": "yesterday-hubspot-contacts-to-mailchimp-send", "name": "Create member", "type": "n8n-nodes-base.mailchimp", "position": [ 920, 300 ], "parameters": { "list": "YOUR_MAILCHIMP_AUDIENCE_ID", "email": "={{ $json[\"properties\"].email }}", "status": "subscribed", "options": {}, "mergeFieldsUi": { "mergeFieldsValues": [ { "name": "FNAME", "value": "={{ $json[\"properties\"].firstname }}" }, { "name": "LNAME", "value": "={{ $json[\"properties\"].lastname }}" } ] }, "authentication": "oAuth2", "resource": "member", "operation": "create" }, "typeVersion": 1 } ], "connections": { "Every day at 07:00": { "main": [ [ { "node": "Get new contacts", "type": "main", "index": 0 } ] ] }, "Get new contacts": { "main": [ [ { "node": "Validate contacts", "type": "main", "index": 0 } ] ] }, "Validate contacts": { "main": [ [ { "node": "Create member", "type": "main", "index": 0 } ] ] } }, "name": "Yesterday’s HubSpot Contacts to Mailchimp", "active": false, "settings": { "executionOrder": "v1", "timezone": "UTC" }, "pinData": {} }