Workflow: Scheduletrigger Workflow
Integrations: gmail, httpRequest, hubspot, if, scheduleTrigger, set, stickyNote

{"nodes": [{"id": "3a0ba7f4-ac41-49b0-a055-b993c82f2680", "name": "Every day at 9 am", "type": "n8n-nodes-base.scheduleTrigger", "position": [340, 1280], "parameters": {"rule": {"interval": [{"triggerAtHour": 9}]}}, "typeVersion": 1.1, "notes": "This scheduleTrigger node performs automated tasks as part of the workflow."}, {"id": "5fa47f36-3206-44b9-965a-0d27b10acc21", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [740, 980], "parameters": {"width": 348.2877732355713, "height": 595.2986206729652, "content": "## Search for all contacts that last contact date for is known\n\n1. Setup Oauth2 creds using n8n docs\n{{ $env.WEBHOOK_URL }}\n\n### Be careful with scopes. Scopes must be exactly as defined in the n8n docs\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### To make this more effective, we sort ascending by last contact date."}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "16b6fadf-ff1d-4670-b148-151cfbd242d5", "name": "Send outreach email", "type": "n8n-nodes-base.gmail", "position": [2040, 1060], "parameters": {"sendTo": "={{ $json.to }}", "message": "={{ $json.html }}", "options": {"senderName": "Mutasem from n8n", "appendAttribution": false}, "subject": "={{ $json.subject }}"}, "credentials": {"gmailOAuth2": {"id": "rd2agqPeJBD2377h", "name": "Work Gmail"}}, "typeVersion": 2.1, "notes": "This gmail node performs automated tasks as part of the workflow."}, {"id": "a89ec3bd-7bb0-4dde-a9eb-800842073fc9", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [2000, 1300], "parameters": {"color": 3, "width": 289.74216745960825, "height": 402.1775107197669, "content": "## Record engagement in Hubspot\n\nOnce engagement is added, last contact date is updated and won't show up in search results for another month.\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "687509ed-4d25-4597-bade-1802348e42c9", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [260, 980], "parameters": {"color": 5, "width": 407.25356360335365, "height": 242.51175804432177, "content": "## Send followup email using Gmail to Hubspot contacts \n\nFollowing up at the right time is one of the most important parts of sales. This workflow uses Gmail to send outreach emails to Hubspot contacts that have already been contacted only once more than a month ago, and records the engagement in Hubspot. "}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "e66f48c9-0e19-4089-a4a4-d9e87b56898a", "name": "Record engagement in HubSpot", "type": "n8n-nodes-base.hubspot", "position": [2080, 1500], "parameters": {"type": "email", "metadata": {"html": "={{ $json.html }}", "subject": "={{ $json.subject }}", "toEmail": ["={{ $json.to }}"], "firstName": "Mutasem", "fromEmail": "mutasem@n8n.io"}, "resource": "engagement", "authentication": "{{ $credentials.oAuth2 }}", "additionalFields": {"associations": {"contactIds": "={{ $json.id }}"}}}, "credentials": {"hubspotOAuth2Api": {"id": "Gxwfj6z9NwaEC3P5", "name": "HubSpot account 3"}}, "typeVersion": 2, "notes": "This hubspot node performs automated tasks as part of the workflow."}, {"id": "f90770cf-aa6c-4148-b471-2b28ed978f72", "name": "Get previously HubSpot contacts", "type": "n8n-nodes-base.hubspot", "position": [840, 1280], "parameters": {"operation": "search", "authentication": "{{ $credentials.oAuth2 }}", "filterGroupsUi": {"filterGroupsValues": [{"filtersUi": {"filterValues": [{"operator": "HAS_PROPERTY", "propertyName": "notes_last_contacted|datetime"}]}}]}, "additionalFields": {"sortBy": "notes_last_contacted", "direction": "ASCENDING", "properties": ["firstname", "lastname", "email", "notes_last_contacted"]}}, "credentials": {"hubspotOAuth2Api": {"id": "Gxwfj6z9NwaEC3P5", "name": "HubSpot account 3"}}, "typeVersion": 2, "notes": "This hubspot node performs automated tasks as part of the workflow."}, {"id": "751fd345-9fec-4c7c-b20b-1db86ce6df10", "name": "if last contacted before a month", "type": "n8n-nodes-base.if", "position": [1120, 1280], "parameters": {"options": {}, "conditions": {"options": {"leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "combinator": "and", "conditions": [{"id": "8d9ad7ef-6e1a-486c-9fac-419ad2660ace", "operator": {"type": "dateTime", "operation": "before"}, "leftValue": "={{ $json.properties.notes_last_contacted }}", "rightValue": "={{ DateTime.now().minus({days: 30}) }}"}]}}, "typeVersion": 2, "notes": "This if node performs automated tasks as part of the workflow."}, {"id": "52596987-ef7f-4dd7-98e7-6c3aaf6c2853", "name": "Get Hubspot Contact to engagement", "type": "n8n-nodes-base.httpRequest", "position": [1340, 1280], "parameters": {"url": "{{ $env.BASE_URL }}", "options": {}, "authentication": "{{ $credentials.predefinedCredentialType }}", "nodeCredentialType": "YOUR_CREDENTIAL_HERE"}, "credentials": {"hubspotOAuth2Api": {"id": "Gxwfj6z9NwaEC3P5", "name": "HubSpot account 3"}}, "typeVersion": 4.1, "notes": "This httpRequest node performs automated tasks as part of the workflow."}, {"id": "fe0bc120-8bee-41fa-a896-3c9ff8cf3a29", "name": "if there has been only one engagement", "type": "n8n-nodes-base.if", "position": [1560, 1280], "parameters": {"options": {}, "conditions": {"options": {"leftValue": "", "caseSensitive": true, "typeValidation": "strict"}, "combinator": "and", "conditions": [{"id": "07c7e29c-eed1-4872-a9f7-b833bb0cafca", "operator": {"type": "number", "operation": "equals"}, "leftValue": "={{ $json.results.length }}", "rightValue": 1}]}}, "typeVersion": 2, "notes": "This if node performs automated tasks as part of the workflow."}, {"id": "512909c7-104b-4507-b91e-aa5b5a9410e5", "name": "Set email keys", "type": "n8n-nodes-base.set", "position": [1820, 1280], "parameters": {"options": {}, "assignments": {"assignments": [{"id": "f3ecc873-2d60-4f2d-bc40-81f9379c725b", "name": "html", "type": "string", "value": "=Hey {{ $json.properties.firstname }},\n\nJust want to follow up on my previous email, since I have not \n heard from you. Have you had the chance to consider n8n? \n\nCheers,\n\nMutasem"}, {"id": "9f4f5b68-984b-415e-a110-a35ded22dd41", "name": "subject", "type": "string", "value": "Follow up on n8n"}, {"id": "5362aa67-f3fa-4a6e-b6e8-4c50cc7a3192", "name": "to", "type": "string", "value": "={{ $('Get previously HubSpot contacts').item.json.properties.email }}"}, {"id": "5b11e503-868d-4fca-bb44-59bb44d597a8", "name": "id", "type": "string", "value": "={{ $('Get previously HubSpot contacts').item.json.id }}"}]}}, "typeVersion": 3.3, "notes": "This set node performs automated tasks as part of the workflow."}, {"id": "c0e5472d-5208-4df7-89e8-380c2dab9642", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [1300, 1060], "parameters": {"color": 4, "width": 490.3275896931988, "height": 496.3776986502359, "content": "## Get pervious engagements. Avoid sending follow ups if first eng\n\n### Here we simply follow up if there has only been outreach email before.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### We could the engagements here and their types and perform more advanced filtering. "}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}], "pinData": {}, "connections": {"52596987-ef7f-4dd7-98e7-6c3aaf6c2853": {"main": [[{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-0ef5d0ab", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-934253a1", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-b52302a7", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-30d59db9", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-15b0dda6", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-d859d9a4", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-2f06abd5", "type": "main", "index": 0}], [{"node": "error-handler-52596987-ef7f-4dd7-98e7-6c3aaf6c2853-0bd4b567", "type": "main", "index": 0}]]}}, "name": "Scheduletrigger Workflow", "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "description": "Automated workflow: Scheduletrigger Workflow. This workflow integrates 8 different services: stickyNote, httpRequest, hubspot, scheduleTrigger, set. It contains 14 nodes and follows best practices for error handling and security.", "meta": {"instanceId": "workflow-a4ce94c9", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:51.853631", "updatedAt": "2025-09-29T07:07:51.853652", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "notes": "Excellent quality workflow: Scheduletrigger Workflow. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}