This workflow follows the Execute Workflow Trigger → OpenAI recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"active": false,
"connections": {
"Execute Workflow Trigger": {
"main": [
[
{
"node": "Notion",
"type": "main",
"index": 0
}
]
]
},
"Notion": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Date & Time",
"type": "main",
"index": 0
}
]
]
},
"Date & Time": {
"main": [
[
{
"node": "Date & Time2",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "OpenAI",
"type": "main",
"index": 0
}
]
]
},
"OpenAI": {
"main": [
[
{
"node": "Notion1",
"type": "main",
"index": 0
}
]
]
},
"Notion1": {
"main": [
[
{
"node": "Notion2",
"type": "main",
"index": 0
}
]
]
},
"Notion2": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Date & Time2": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2024-02-13T21:26:37.130Z",
"id": "g0VoeC7g7LSTtOn8",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "get_Schedule",
"nodes": [
{
"parameters": {},
"id": "d3f7cb71-cce4-4218-b7c7-59be3b8c4592",
"name": "Execute Workflow Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"typeVersion": 1,
"position": [
560,
300
]
},
{
"parameters": {
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"value": "f90abc5d-ca8b-4274-b54b-67e7c1d82729",
"mode": "list",
"cachedResultName": "AGENDA",
"cachedResultUrl": "https://www.notion.so/f90abc5dca8b4274b54b67e7c1d82729"
},
"filterType": "manual",
"filters": {
"conditions": [
{
"key": "Date de Avalia\u00e7\u00e3o|date",
"condition": "next_week"
}
]
},
"options": {}
},
"id": "02f84ba5-cdec-4166-bbd9-41ee89d00147",
"name": "Notion",
"type": "n8n-nodes-base.notion",
"typeVersion": 2.1,
"position": [
740,
300
],
"alwaysOutputData": true,
"credentials": {
"notionApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "property_date_de_avalia_o.start",
"renameField": true,
"outputFieldName": "dateAvaliation"
}
]
},
"options": {}
},
"id": "c7ef89d1-5201-4216-b19d-9344d6c2d7d0",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
920,
300
],
"alwaysOutputData": true
},
{
"parameters": {
"operation": "formatDate",
"date": "={{ new Date() }}",
"format": "yyyy-MM-dd",
"outputFieldName": "today",
"options": {
"timezone": true
}
},
"id": "766199c6-e67d-42b4-b006-9334f260bb00",
"name": "Date & Time",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 2,
"position": [
1100,
300
]
},
{
"parameters": {
"resource": "chat",
"chatModel": "gpt-4",
"prompt": {
"messages": [
{
"content": "=Hoje \u00e9: {{ $('Date & Time').item.json[\"today\"] }}\nHorario \u00e9: {{ $('Date & Time2').item.json[\"today\"] }}\nHoje \u00e9: {{ $json[\"dayOfWeek\"] }}\n\nEsse s\u00e3o os horario ocuparados:\n {{ $('Aggregate').item.json.dateAvaliation }}\n\ninput do usuario: {{ $('Execute Workflow Trigger').item.json[\"query\"] }}\n\nInstru\u00e7\u00e3o:\n- De acordo com informa\u00e7\u00f5es, recomende um horario disponivel Nesse Formato: YYYY-MM-DD HH-MM. Antes verifique: as datas ocupadas, pode ser no mesmo dia que ja esteja ocupado, apenas verifique se tem hora disponivel entre 7 da manh\u00e3 e as 17 da tarde. ex: se ja tiver 20/02/2024 as 08:00 pode marca as 20/02/2024 09:00 e assim por diante. agora se naquele dia ja tiver todos horarios das 7 as 17 da manh\u00e3, marque para o proximo dia e horario disponivel.\n\nN\u00c3O ATENDEMOS NO SABADO E NO DOMINGO, N\u00c3O MARQUE NESSES DIAS.\n\nretorne apenas a data sem complemento:YYYY-MM-DD HH-MM"
}
]
},
"options": {}
},
"id": "8d89f786-2b5d-4f3e-b626-1022960e8c34",
"name": "OpenAI",
"type": "n8n-nodes-base.openAi",
"typeVersion": 1.1,
"position": [
1600,
300
],
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "runOnceForEachItem",
"jsCode": "// Obtenha a data atual\nconst todayDate = $('Date & Time').item.json.today\nconst today = new Date(todayDate)\n\n// Obtenha o dia da semana (0 a 6)\nconst dayOfWeek = today.getDay();\n\n// Mapeie o n\u00famero do dia da semana para o nome do dia\nconst weekdays = ['Domingo', 'Segunda-feira', 'Ter\u00e7a-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'S\u00e1bado'];\nconst dayName = weekdays[dayOfWeek];\n\n// Adicione o nome do dia da semana ao item JSON\n$input.item.json.dayOfWeek = dayName;\n\n// Retorne o item atualizado\nreturn $input.item;\n"
},
"id": "92acb3de-7b78-4822-a7e6-3f39f191e1a2",
"name": "Code",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
1440,
300
]
},
{
"parameters": {
"fields": {
"values": [
{
"name": "response",
"stringValue": "=Horario disponivel: {{ $('OpenAI').item.json.message.content }}.\n\npara o bot: n\u00e3o agende ainda, fico no aguardo para confirma\u00e7\u00e3o. "
}
]
},
"options": {}
},
"id": "85088d0b-8131-4f1c-a063-c01fb656136e",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"typeVersion": 3.2,
"position": [
2160,
300
]
},
{
"parameters": {
"resource": "databasePage",
"operation": "getAll",
"databaseId": {
"__rl": true,
"value": "ca15ab7c-783f-404e-a5a3-c19991af4a89",
"mode": "list",
"cachedResultName": "Leads CRM",
"cachedResultUrl": "https://www.notion.so/ca15ab7c783f404ea5a3c19991af4a89"
},
"filterType": "manual",
"filters": {
"conditions": [
{
"key": "Whatsapp|rich_text",
"condition": "equals",
"richTextValue": "={{ $('Execute Workflow Trigger').item.json.cel }}"
}
]
},
"options": {}
},
"id": "33e63818-4b14-44e8-b1d8-fdcbd4c79724",
"name": "Notion1",
"type": "n8n-nodes-base.notion",
"typeVersion": 2.1,
"position": [
1760,
300
],
"alwaysOutputData": true,
"credentials": {
"notionApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "databasePage",
"operation": "update",
"pageId": {
"__rl": true,
"value": "={{ $json.id }}",
"mode": "id"
},
"propertiesUi": {
"propertyValues": [
{
"key": "data recomendada|rich_text",
"textContent": "={{ $('OpenAI').item.json.message.content }}"
}
]
},
"options": {}
},
"id": "c1b7e705-44dc-4661-a79d-58f10889863e",
"name": "Notion2",
"type": "n8n-nodes-base.notion",
"typeVersion": 2.1,
"position": [
1960,
300
],
"alwaysOutputData": true,
"credentials": {
"notionApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "formatDate",
"date": "={{ new Date() }}",
"format": "custom",
"customFormat": "HH-mm",
"outputFieldName": "today",
"options": {
"timezone": true
}
},
"id": "7f0e0a53-3054-4e4e-add9-d030b6714b57",
"name": "Date & Time2",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 2,
"position": [
1280,
300
]
}
],
"settings": {
"executionOrder": "v1",
"timezone": "America/Cuiaba",
"saveManualExecutions": true,
"callerPolicy": "workflowsFromSameOwner"
},
"staticData": null,
"tags": [
{
"createdAt": "2024-02-21T18:21:30.526Z",
"updatedAt": "2024-02-21T18:21:30.526Z",
"id": "4wLFcM3QYEjAsdBn",
"name": "ai_Agenda"
},
{
"createdAt": "2023-10-10T01:40:35.294Z",
"updatedAt": "2023-10-10T01:40:35.294Z",
"id": "YeXFRAnvLXlIp4mp",
"name": "OdontoVida"
}
],
"triggerCount": 2,
"updatedAt": "2024-02-26T04:19:13.944Z",
"versionId": "77b5090f-4f2c-4250-9d54-2c6047647e0f"
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
notionApiopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
get_Schedule. Uses executeWorkflowTrigger, notion, openAi. Event-driven trigger; 10 nodes.
Source: https://github.com/Katacha1537/n8n-backups/blob/f5da374c62167042d90e54a61035db8b1d0ea35c/workflows/get_Schedule.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow is perfect for creators, solopreneurs, and personal brands who want to consistently publish bold, high-performing content on X (Twitter) — without writing a single line themselves. After
This n8n template automatically creates and publishes high-quality LinkedIn posts using your brand brief, AI-generated ideas, and structured feedback loops — all powered by OpenAI. Perfect for solo cr
This workflow creates a powerful AI assistant in Telegram that helps you manage your tasks in Notion. The assistant leverages OpenAI's language models to understand natural language commands, process
This template attempts to replicate OpenAI's DeepResearch feature which, at time of writing, is only available to their pro subscribers.
How it Works