Workflow: Calendar_scheduling
Integrations: executeWorkflowTrigger, filter, gmail, gmailTrigger, googleCalendar, if, itemLists, noOp, set, stickyNote, stopAndError

{"id": "slP122GjD9meGkS6", "meta": {"instanceId": "workflow-5fd43dba", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:45.294163", "updatedAt": "2025-09-29T07:07:45.294178", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "name": "Calendar_scheduling", "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "nodes": [{"id": "bd1dae81-daea-4539-bf1d-38eb9a2bd2f0", "name": "Gmail Trigger", "type": "n8n-nodes-base.gmailTrigger", "position": [500, 560], "parameters": {"filters": {"readStatus": "unread", "includeSpamTrash": false}, "pollTimes": {"item": [{"mode": "everyMinute"}]}}, "credentials": {"gmailOAuth2": {"id": "kLFedNEM8Zwkergv", "name": "Gmail account"}}, "typeVersion": 1, "notes": "This gmailTrigger node performs automated tasks as part of the workflow."}, {"id": "a97c3ab1-6fbc-441e-af11-3c746936013b", "name": "Chat OpenAI", "type": "n8n-nodes-base.noOp", "position": [720, 740], "parameters": {"model": "gpt-4", "options": {"temperature": 0.1}}, "credentials": {"openAiApi": {"id": "wJtZwsVKW5v6R2Iy", "name": "OpenAi account"}}, "typeVersion": 1, "notes": "This lmChatOpenAi node performs automated tasks as part of the workflow."}, {"id": "a1205598-7cd4-4278-ad53-0cfc7c7947ff", "name": "Workflow Tool", "type": "n8n-nodes-base.noOp", "position": [1580, 759], "parameters": {"name": "Calendar_Availability", "workflowId": "={{ $workflow.id }}", "description": "Call this tool to get my calendar availability as stringified JSON array."}, "typeVersion": 1, "notes": "This toolWorkflow node performs automated tasks as part of the workflow."}, {"id": "5ba2c2b0-2218-45d2-a417-f86c80643397", "name": "Chat OpenAI1", "type": "n8n-nodes-base.noOp", "position": [1420, 759], "parameters": {"model": "gpt-4", "options": {"temperature": 0}}, "credentials": {"openAiApi": {"id": "wJtZwsVKW5v6R2Iy", "name": "OpenAi account"}}, "typeVersion": 1, "notes": "This lmChatOpenAi node performs automated tasks as part of the workflow."}, {"id": "012835ec-c20a-4b84-bed8-67f6aac30698", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [460, 460], "parameters": {"width": 616.8060552874073, "height": 410.24791575252334, "content": "## Check if incoming email is about appointment\nWe use LLM to check subject and body of the email and determine if it's an appointment request. "}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "ceaa4f77-acc8-437e-9d61-16cf344a7748", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [1340, 460], "parameters": {"width": 676.1951194231482, "height": 241.70645019745504, "content": "## Get calendar availability and compose a response\nMake sure to update the Workflow ID if you are running this as 2 workflows"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "499def23-7dec-4131-91fd-326b1b824762", "name": "Google Calendar", "type": "n8n-nodes-base.googleCalendar", "position": [680, 1120], "parameters": {"options": {"timeMax": "={{ $now.plus(1, 'month').toISO() }}", "timeMin": "={{ $now.minus(1, 'day').toISO() }}", "singleEvents": true}, "calendar": {"__rl": true, "mode": "list", "value": "your_email@gmail.com", "cachedResultName": "your_email@gmail.com"}, "operation": "getAll", "returnAll": true}, "credentials": {"googleCalendarOAuth2Api": {"id": "s95HsHIMB7oK0dAH", "name": "Google Calendar account"}}, "typeVersion": 1, "notes": "This googleCalendar node performs automated tasks as part of the workflow."}, {"id": "0f5f43fa-3386-4682-b620-21db35651d3b", "name": "Execute Workflow Trigger", "type": "n8n-nodes-base.executeWorkflowTrigger", "position": [460, 1120], "parameters": {}, "typeVersion": 1, "notes": "This executeWorkflowTrigger node performs automated tasks as part of the workflow."}, {"id": "8b2b82b9-c11f-4e7f-ab23-16ea5e395e11", "name": "Format response", "type": "n8n-nodes-base.itemLists", "position": [1560, 1120], "parameters": {"include": "allFieldsExcept", "options": {}, "aggregate": "aggregateAllItemData", "operation": "concatenateItems", "fieldsToExclude": "sort", "destinationFieldName": "response"}, "typeVersion": 3, "notes": "This itemLists node performs automated tasks as part of the workflow."}, {"id": "ac363d85-5c6e-4a9f-9cfc-ecc15a325b01", "name": "Stringify Response", "type": "n8n-nodes-base.set", "position": [1780, 1120], "parameters": {"values": {"string": [{"name": "response", "value": "={{ JSON.stringify($json.response) }}"}]}, "options": {}, "keepOnlySet": true}, "typeVersion": 2, "notes": "This set node performs automated tasks as part of the workflow."}, {"id": "399c5bc4-c8bd-4d0b-942a-9889447880a9", "name": "Extract start, end and name", "type": "n8n-nodes-base.set", "position": [1100, 1120], "parameters": {"values": {"string": [{"name": "start", "value": "={{ DateTime.fromISO($json.start.dateTime).toLocaleString(DateTime.DATE_HUGE) }}, {{ DateTime.fromISO($json.start.dateTime).toLocaleString(DateTime.TIME_24_WITH_SHORT_OFFSET) }}"}, {"name": "end", "value": "={{ DateTime.fromISO($json.end.dateTime).toLocaleString(DateTime.DATE_HUGE) }}, {{ DateTime.fromISO($json.end.dateTime).toLocaleString(DateTime.TIME_24_WITH_SHORT_OFFSET) }}"}, {"name": "name", "value": "={{ $json.summary }}"}, {"name": "sort", "value": "={{ $json.start.dateTime }}"}]}, "options": {}, "keepOnlySet": true}, "typeVersion": 2, "notes": "This set node performs automated tasks as part of the workflow."}, {"id": "a39b6c7d-fdcc-452d-9ef5-50b038153330", "name": "Filter only confirmed and with set time", "type": "n8n-nodes-base.filter", "position": [880, 1120], "parameters": {"conditions": {"string": [{"value1": "={{ $json.status }}", "value2": "confirmed"}], "boolean": [{"value1": "={{ $json.start.dateTime }}", "value2": "={{ undefined }}", "operation": "notEqual"}]}}, "typeVersion": 1, "notes": "This filter node performs automated tasks as part of the workflow."}, {"id": "0e0a2be9-cde7-497d-94c5-180128382bb7", "name": "Is appointment request", "type": "n8n-nodes-base.if", "position": [1100, 560], "parameters": {"conditions": {"string": [{"value1": "={{ $json.is_appointment }}", "value2": "true"}], "boolean": [{"value1": "={{ $json.is_appointment }}", "value2": true}]}, "combineOperation": "any"}, "typeVersion": 1, "notes": "This if node performs automated tasks as part of the workflow."}, {"id": "a6e11f63-a56a-4fe0-91c8-0dde2720e905", "name": "Classify appointment", "type": "n8n-nodes-base.noOp", "position": [720, 560], "parameters": {"prompt": "=Please evaluate the following email to determine if it suggests scheduling a meeting or a call:\nSubject: {{ encodeURI($json.Subject) }}\nSnippet: {{ encodeURI($json.snippet) }}\nIndicate your assessment by responding with \"true\" if it suggests a meeting or call, or \"false\" otherwise. Use lowercase for your response.\n"}, "typeVersion": 1, "notes": "This chainLlm node performs automated tasks as part of the workflow."}, {"id": "b6411b14-67f6-4195-a834-60a4dc5e4851", "name": "Structured Output Parser", "type": "n8n-nodes-base.noOp", "position": [880, 740], "parameters": {"jsonSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"is_appointment\": {\n \"type\": \"boolean\"\n }\n }\n}"}, "typeVersion": 1, "notes": "This outputParserStructured node performs automated tasks as part of the workflow."}, {"id": "96248431-290b-4fb1-94a3-714e7c0008d4", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [640, 1058.6115582634225], "parameters": {"width": 810.4923211935056, "height": 224.60561166142082, "content": "### Get all query google events for the next month and extract relevant data"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "48bc7c0c-0b74-418e-8c5c-6a6faf24722c", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [1513, 1060], "parameters": {"width": 444.4130232558142, "height": 220.42397542781927, "content": "### Wrap the result in `response` object and return "}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "a68f7b27-1891-46c7-92b2-650cc17f94d6", "name": "Sort", "type": "n8n-nodes-base.itemLists", "position": [1320, 1120], "parameters": {"options": {}, "operation": "sort", "sortFieldsUi": {"sortField": [{"fieldName": "sort"}]}}, "typeVersion": 3, "notes": "This itemLists node performs automated tasks as part of the workflow."}, {"id": "2b5b5855-6d3f-4405-9f48-5d6c4ee2475b", "name": "Mark as read", "type": "n8n-nodes-base.gmail", "position": [1840, 739], "parameters": {"messageId": "={{ $('Gmail Trigger').item.json.id }}", "operation": "markAsRead"}, "credentials": {"gmailOAuth2": {"id": "kLFedNEM8Zwkergv", "name": "Gmail account"}}, "typeVersion": 2.1, "notes": "This gmail node performs automated tasks as part of the workflow."}, {"id": "accbe2df-367a-4bd3-a383-12ee79062e12", "name": "Send Reply", "type": "n8n-nodes-base.gmail", "position": [1840, 539], "parameters": {"message": "={{ $json.output }}", "options": {"replyToSenderOnly": true}, "messageId": "={{ $('Gmail Trigger').item.json.id }}", "operation": "reply"}, "credentials": {"gmailOAuth2": {"id": "kLFedNEM8Zwkergv", "name": "Gmail account"}}, "typeVersion": 2, "notes": "This gmail node performs automated tasks as part of the workflow."}, {"id": "66d62337-d0c1-4744-b169-8e95c1d1492a", "name": "Agent", "type": "n8n-nodes-base.noOp", "position": [1400, 539], "parameters": {"text": "=Sender: {{ $('Gmail Trigger').item.json.From }}\\nSubject: {{ $('Gmail Trigger').item.json.Subject }}\\nEmail Text: {{ $('Gmail Trigger').item.json.snippet }}", "options": {"systemMessage": "=You are an email scheduling assistant. Based on the received email, check my availability and propose an appropriate response. \nAim to get a specific time, rather than just a day. When checking my availability, make sure that there's enough time in between meetings.\nIf I'm not available, ALWAYS propose a new time based on my availability. When proposing a new time, always leave 15 minutes buffer from previous meeting.\nToday date and time is: {{ $now.toISO() }}."}}, "typeVersion": 1, "notes": "This agent node performs automated tasks as part of the workflow."}, {"id": "error-641efc3f", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [1000, 400], "parameters": {"message": "Workflow execution error", "options": {}}}], "active": false, "pinData": {}, "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "versionId": "0cf0768b-ddc0-42a3-9c84-f93d43c66dc7", "connections": {"a97c3ab1-6fbc-441e-af11-3c746936013b": {"main": [[{"node": "error-handler-a97c3ab1-6fbc-441e-af11-3c746936013b-ab421486", "type": "main", "index": 0}]]}, "5ba2c2b0-2218-45d2-a417-f86c80643397": {"main": [[{"node": "error-handler-5ba2c2b0-2218-45d2-a417-f86c80643397-dabdb048", "type": "main", "index": 0}]]}, "499def23-7dec-4131-91fd-326b1b824762": {"main": [[{"node": "error-handler-499def23-7dec-4131-91fd-326b1b824762-25116f3a", "type": "main", "index": 0}]]}}, "description": "Automated workflow: Calendar_scheduling. This workflow integrates 15 different services: stickyNote, itemLists, filter, gmailTrigger, agent. It contains 24 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Calendar_scheduling. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}