Agentrix212AI commited on
Commit
003886e
·
verified ·
1 Parent(s): 1610c8e

Upload Calendar_AI_agent.json

Browse files
Workflows/N8N_Workflows/Calendar_AIAgent/Calendar_AI_agent.json ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Calendar_AI_agent",
3
+ "nodes": [
4
+ {
5
+ "parameters": {
6
+ "options": {}
7
+ },
8
+ "type": "@n8n/n8n-nodes-langchain.chatTrigger",
9
+ "typeVersion": 1.3,
10
+ "position": [
11
+ 48,
12
+ 176
13
+ ],
14
+ "id": "74f7c041-044d-4c33-bed4-17b61060102c",
15
+ "name": "When chat message received",
16
+ "webhookId": "102a3b10-8837-499c-b76d-b5b3488e2f55"
17
+ },
18
+ {
19
+ "parameters": {
20
+ "content": "🚀 **CHAT TRIGGER SETUP**\n\n**Essential Configuration:**\n• No additional setup required\n• Auto-generates webhook URL\n• Handles chat message input\n\n**Usage:**\n• Test via chat interface\n• Webhook URL: Auto-generated\n• Supports text input only\n\n**Best Practice:**\n• Keep this as entry point\n• Connect directly to AI Agent",
21
+ "height": 320,
22
+ "width": 376,
23
+ "color": 4
24
+ },
25
+ "type": "n8n-nodes-base.stickyNote",
26
+ "position": [
27
+ -464,
28
+ 48
29
+ ],
30
+ "typeVersion": 1,
31
+ "id": "9324bf01-a1ae-4829-bd2c-28f9d59a06ac",
32
+ "name": "Chat Trigger Config"
33
+ },
34
+ {
35
+ "parameters": {
36
+ "options": {
37
+ "systemMessage": "=<agent_identity>\nYou are a Calendar Assistant specializing in schedule management, appointment coordination, and time organization. You help users efficiently manage their time and commitments.\n</agent_identity>\n\n<agent_capabilities>\n- Schedule appointment suggestions and conflict detection\n- Time zone conversion and meeting coordination \n- Calendar event planning and organization\n- Availability analysis and optimization\n- Meeting preparation and follow-up reminders\n</agent_capabilities>\n\n<response_framework>\nALWAYS follow this order:\n1. Check current availability first (use Current Date {{ $now.format('yyyy-MM-dd') }} as reference)\n2. Identify available time slots before requesting details\n3. Present clear scheduling options with specific dates/times\n4. Only ask for additional details after confirming availability\n5. Provide alternative options when conflicts exist\n</response_framework>\n\n<agent_behavior>\n- Start every interaction by checking availability\n- Communicate in professional, time-conscious manner\n- Prioritize user's existing commitments\n- Suggest efficient scheduling solutions based on open slots\n- Provide structured, easy-to-follow scheduling information\n</agent_behavior>\n\n<guardrails>\n- Never overbook or suggest conflicting appointments\n- Always confirm timezone assumptions\n- Respect work-life balance boundaries\n- Escalate complex multi-party scheduling to human coordination\n</guardrails>"
38
+ }
39
+ },
40
+ "type": "@n8n/n8n-nodes-langchain.agent",
41
+ "typeVersion": 2.2,
42
+ "position": [
43
+ 400,
44
+ 176
45
+ ],
46
+ "id": "013c2a0e-4ae1-4128-be68-bca241e3fc5c",
47
+ "name": "AI Agent"
48
+ },
49
+ {
50
+ "parameters": {
51
+ "content": "🤖 **AI AGENT CONFIGURATION**\n\n**System Message Setup:**\n• Agent Identity: Calendar Assistant\n• Capabilities: Schedule management\n• Response Framework: 5-step process\n• Behavior Rules: Professional tone\n\n**Key Settings:**\n• Agent Type: OpenAI Functions\n• Max Iterations: 10 (recommended)\n• Tool Selection: Auto\n\n**Requirements:**\n• Must connect to LLM model\n• Must connect to memory\n• Must connect to tools\n\n**Pro Tips:**\n• Use {{ $now.format() }} for current time\n• Test system message thoroughly",
52
+ "height": 492,
53
+ "width": 300,
54
+ "color": 2
55
+ },
56
+ "type": "n8n-nodes-base.stickyNote",
57
+ "position": [
58
+ 704,
59
+ -224
60
+ ],
61
+ "typeVersion": 1,
62
+ "id": "6e467041-2816-451d-9d8a-faa89c82cb7a",
63
+ "name": "AI Agent Config"
64
+ },
65
+ {
66
+ "parameters": {
67
+ "model": "anthropic/claude-3.7-sonnet",
68
+ "options": {}
69
+ },
70
+ "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
71
+ "typeVersion": 1,
72
+ "position": [
73
+ 256,
74
+ 384
75
+ ],
76
+ "id": "dbd393e2-91e6-4ac5-ad5e-59176314b6d2",
77
+ "name": "OpenRouter Chat Model",
78
+ "credentials": {
79
+ "openRouterApi": {
80
+ "id": "Uh6EhUnlPGQ0AEYw",
81
+ "name": "OpenRouter account"
82
+ }
83
+ }
84
+ },
85
+ {
86
+ "parameters": {
87
+ "content": "🔑 **OPENROUTER SETUP**\n\n**Credentials Required:**\n• OpenRouter API Key\n• Get from: openrouter.ai\n• Add to n8n credentials\n\n**Model Configuration:**\n• Current: claude-3.7-sonnet\n• Alternative: gpt-4o\n• Cost: Check OpenRouter pricing\n\n**Settings:**\n• Temperature: 0.1 (precise)\n• Max Tokens: 4000\n• Top P: 0.9\n\n**Troubleshooting:**\n• Verify API key validity\n• Check model availability\n• Monitor usage limits",
88
+ "height": 560,
89
+ "width": 280
90
+ },
91
+ "type": "n8n-nodes-base.stickyNote",
92
+ "position": [
93
+ -96,
94
+ 416
95
+ ],
96
+ "typeVersion": 1,
97
+ "id": "1f6f0c69-5858-4954-bb08-8ea43733ac5e",
98
+ "name": "OpenRouter Config"
99
+ },
100
+ {
101
+ "parameters": {},
102
+ "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
103
+ "typeVersion": 1.3,
104
+ "position": [
105
+ 416,
106
+ 384
107
+ ],
108
+ "id": "acb13bd1-aa5b-4b97-bd44-46e20608f9b1",
109
+ "name": "Simple Memory"
110
+ },
111
+ {
112
+ "parameters": {
113
+ "content": "🧠 **MEMORY CONFIGURATION**\n\n**Buffer Window Settings:**\n• Window Size: 10 messages\n• Type: Conversation Buffer\n• Auto-cleanup: Enabled\n\n**Memory Behavior:**\n• Stores recent conversation\n• Maintains context\n• Automatic token management\n\n**Performance:**\n• Low memory usage\n• Fast retrieval\n• Session-based\n\n**Usage:**\n• No additional config needed\n• Connects to AI Agent\n• Resets per session",
114
+ "height": 552,
115
+ "width": 260,
116
+ "color": 5
117
+ },
118
+ "type": "n8n-nodes-base.stickyNote",
119
+ "position": [
120
+ 224,
121
+ 528
122
+ ],
123
+ "typeVersion": 1,
124
+ "id": "cefaafca-5325-4819-befc-8a34d66e36c6",
125
+ "name": "Memory Config"
126
+ },
127
+ {
128
+ "parameters": {
129
+ "operation": "getAll",
130
+ "calendar": {
131
+ "__rl": true,
132
+ "value": "mouad.hero01@gmail.com",
133
+ "mode": "list",
134
+ "cachedResultName": "My Calendar"
135
+ },
136
+ "returnAll": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Return_All', ``, 'boolean') }}",
137
+ "timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}",
138
+ "timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}",
139
+ "options": {
140
+ "timeZone": {
141
+ "__rl": true,
142
+ "value": "Africa/Casablanca",
143
+ "mode": "list",
144
+ "cachedResultName": "Africa/Casablanca"
145
+ }
146
+ }
147
+ },
148
+ "type": "n8n-nodes-base.googleCalendarTool",
149
+ "typeVersion": 1.3,
150
+ "position": [
151
+ 768,
152
+ 368
153
+ ],
154
+ "id": "ed7f647d-e7c1-4680-96bb-2b5aaf0fe3c5",
155
+ "name": "Availability",
156
+ "credentials": {
157
+ "googleCalendarOAuth2Api": {
158
+ "id": "EQIGmazJnAOmj5av",
159
+ "name": "Google Calendar account"
160
+ }
161
+ }
162
+ },
163
+ {
164
+ "parameters": {
165
+ "content": "📅 **AVAILABILITY CHECKER**\n\n**🔑 Credentials Setup:**\n• Google Calendar OAuth2 API\n• Enable Google Calendar API\n• Create OAuth 2.0 credentials\n• Add redirect URI: your-n8n-url/rest/oauth2-credential/callback\n\n**⚙️ Configuration:**\n• Operation: Get All Events\n• Calendar: Select your calendar\n• Time Zone: Africa/Casablanca\n• Return All: AI-controlled\n• Time Min/Max: AI-controlled\n\n**🎯 AI Override Parameters:**\n• $fromAI('Return_All', '', 'boolean')\n• $fromAI('After', '', 'string')\n• $fromAI('Before', '', 'string')\n\n**✅ Testing:**\n• Test with date ranges\n• Verify timezone handling\n• Check calendar permissions",
166
+ "height": 516,
167
+ "width": 320,
168
+ "color": 3
169
+ },
170
+ "type": "n8n-nodes-base.stickyNote",
171
+ "position": [
172
+ 880,
173
+ 368
174
+ ],
175
+ "typeVersion": 1,
176
+ "id": "19406780-3911-4f81-bb09-deee23ad3cb2",
177
+ "name": "Availability Config"
178
+ },
179
+ {
180
+ "parameters": {
181
+ "calendar": {
182
+ "__rl": true,
183
+ "value": "mouad.hero01@gmail.com",
184
+ "mode": "list",
185
+ "cachedResultName": "My Calendar"
186
+ },
187
+ "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
188
+ "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
189
+ "additionalFields": {
190
+ "attendees": [
191
+ "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('attendees0_Attendees', ``, 'string') }}"
192
+ ],
193
+ "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}"
194
+ }
195
+ },
196
+ "type": "n8n-nodes-base.googleCalendarTool",
197
+ "typeVersion": 1.3,
198
+ "position": [
199
+ 608,
200
+ 400
201
+ ],
202
+ "id": "99fd5eaa-6ef5-4e75-8e4f-536a9ce26481",
203
+ "name": "Booking",
204
+ "credentials": {
205
+ "googleCalendarOAuth2Api": {
206
+ "id": "EQIGmazJnAOmj5av",
207
+ "name": "Google Calendar account"
208
+ }
209
+ }
210
+ },
211
+ {
212
+ "parameters": {
213
+ "content": "📝 **BOOKING CONFIGURATION**\n\n**🔑 Same Credentials as Availability:**\n• Use same Google Calendar OAuth2\n• Ensure write permissions\n\n**⚙️ Required Parameters:**\n• Calendar: Same as availability\n• Start: AI-controlled datetime\n• End: AI-controlled datetime\n• Summary: AI-controlled title\n\n**👥 Optional Fields:**\n• Attendees: AI-controlled emails\n• Description: Event details\n• Location: Meeting location\n• Reminders: Notification settings\n\n**🎯 AI Override Format:**\n• Start/End: ISO datetime format\n• Summary: Event title string\n• Attendees: Email addresses\n\n**⚠️ Important:**\n• Test with simple booking first\n• Verify timezone handling\n• Check conflict detection",
214
+ "height": 504,
215
+ "width": 320
216
+ },
217
+ "type": "n8n-nodes-base.stickyNote",
218
+ "position": [
219
+ 496,
220
+ 592
221
+ ],
222
+ "typeVersion": 1,
223
+ "id": "92cbec91-bdf9-4a2c-bf40-9495b656bc24",
224
+ "name": "Booking Config"
225
+ },
226
+ {
227
+ "parameters": {
228
+ "content": "🔧 **GOOGLE CALENDAR API SETUP GUIDE**\n\n**1. Enable Google Calendar API:**\n• Go to Google Cloud Console\n• Create/select project\n• Enable Calendar API\n• Create OAuth 2.0 credentials\n\n**2. OAuth Configuration:**\n• Authorized redirect URIs:\n https://your-n8n-domain/rest/oauth2-credential/callback\n• Scopes needed:\n - https://www.googleapis.com/auth/calendar\n - https://www.googleapis.com/auth/calendar.events\n\n**3. n8n Credential Setup:**\n• Add new credential\n• Choose Google Calendar OAuth2 API\n• Enter Client ID & Secret\n• Complete OAuth flow\n\n**4. Calendar Selection:**\n• Primary: your-email@gmail.com\n• Secondary: Select from dropdown\n• Permissions: Read/Write required\n\n**⚠️ Common Issues:**\n• Invalid redirect URI\n• Insufficient scopes\n• Calendar not shared\n• Timezone mismatches",
229
+ "height": 804,
230
+ "width": 340,
231
+ "color": 2
232
+ },
233
+ "type": "n8n-nodes-base.stickyNote",
234
+ "position": [
235
+ 1328,
236
+ 192
237
+ ],
238
+ "typeVersion": 1,
239
+ "id": "2e4f4119-ae08-4ab8-84e1-0038d763713f",
240
+ "name": "Google API Setup"
241
+ },
242
+ {
243
+ "parameters": {
244
+ "content": "🎯 **AI TOOL INTEGRATION TIPS**\n\n**$fromAI Parameters Explained:**\n• Return_All: Boolean for pagination\n• After/Before: Date range strings\n• Start/End: Event datetime (ISO format)\n• Summary: Event title\n• Attendees: Email array\n\n**Best Practices:**\n• Use clear parameter names\n• Provide default values\n• Handle timezone conversions\n• Validate datetime formats\n\n**Testing Strategy:**\n1. Test availability check first\n2. Verify date parsing\n3. Test booking creation\n4. Check conflict handling\n5. Validate attendee emails\n\n**Monitoring:**\n• Check execution logs\n• Monitor API rate limits\n• Verify event creation\n• Test error handling",
245
+ "height": 624,
246
+ "width": 300,
247
+ "color": 6
248
+ },
249
+ "type": "n8n-nodes-base.stickyNote",
250
+ "position": [
251
+ 1680,
252
+ 288
253
+ ],
254
+ "typeVersion": 1,
255
+ "id": "699cdf95-6063-4bef-aed9-792828eb74ba",
256
+ "name": "AI Integration Tips"
257
+ }
258
+ ],
259
+ "pinData": {},
260
+ "connections": {
261
+ "When chat message received": {
262
+ "main": [
263
+ [
264
+ {
265
+ "node": "AI Agent",
266
+ "type": "main",
267
+ "index": 0
268
+ }
269
+ ]
270
+ ]
271
+ },
272
+ "OpenRouter Chat Model": {
273
+ "ai_languageModel": [
274
+ [
275
+ {
276
+ "node": "AI Agent",
277
+ "type": "ai_languageModel",
278
+ "index": 0
279
+ }
280
+ ]
281
+ ]
282
+ },
283
+ "Simple Memory": {
284
+ "ai_memory": [
285
+ [
286
+ {
287
+ "node": "AI Agent",
288
+ "type": "ai_memory",
289
+ "index": 0
290
+ }
291
+ ]
292
+ ]
293
+ },
294
+ "Availability": {
295
+ "ai_tool": [
296
+ [
297
+ {
298
+ "node": "AI Agent",
299
+ "type": "ai_tool",
300
+ "index": 0
301
+ }
302
+ ]
303
+ ]
304
+ },
305
+ "Booking": {
306
+ "ai_tool": [
307
+ [
308
+ {
309
+ "node": "AI Agent",
310
+ "type": "ai_tool",
311
+ "index": 0
312
+ }
313
+ ]
314
+ ]
315
+ }
316
+ },
317
+ "active": false,
318
+ "settings": {
319
+ "executionOrder": "v1"
320
+ },
321
+ "versionId": "f22897ce-7811-4399-a3da-0ba8532b00d2",
322
+ "meta": {
323
+ "templateId": "calendar_agent_with_gcal",
324
+ "templateCredsSetupCompleted": true,
325
+ "instanceId": "66c58b798d3adbdaf64a47b3041d335e10015ca13cec5104fbf9f568a82eba73"
326
+ },
327
+ "id": "u4JXdH2VVdQtghYG",
328
+ "tags": []
329
+ }