Describe the problem/error/question
I am unable to save my workflow as there is an error on unable to parse minute
What is the error message (if any)?
Problem saving workflow
There was a problem activating the workflow: “Field (minute) cannot be parsed”
Please share your workflow
{
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "minutes",
"minutesInterval": 30
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.2,
"position": [
-448,
48
],
"id": "5c5b8616-73e1-411c-9c2d-6a44f7aacf69",
"name": "Schedule Trigger",
"notesInFlow": false
},
{
"parameters": {
"jsCode": "const now = new Date();\nconst thirtyMinutesAgo = new Date(now);\nthirtyMinutesAgo.setMinutes(now.getMinutes() - 30);\n\nconst isodate = (d) => d.toISOString().split('.')[0] + 'Z';\nreturn [\n {\n json: {\n now: isodate(now),\n past: isodate(thirtyMinutesAgo)\n }\n }\n];\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-256,
144
],
"id": "de169bdd-7309-46a7-a9d9-3d6081b4366c",
"name": "Code1"
},
{
"parameters": {
"operation": "getAll",
"limit": 25,
"simple": false,
"filters": {
"q": "from:([email protected] OR [email protected])",
"receivedAfter": "={{ $json.past }}",
"receivedBefore": "={{ $json.now }}"
},
"options": {}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.1,
"position": [
-16,
160
],
"id": "973849ba-5470-452f-8e66-fcd7c2188b0c",
"name": "Get many messages",
"webhookId": "96902569-cc9b-44f4-8bd7-38b17198a5df",
"credentials": {
"gmailOAuth2": {
"id": "v5DvYRViC2X5ibVR",
"name": "Gmail account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "86901638-2c7f-4c95-8386-4946b096205d",
"name": "subject",
"value": "={{ $json.subject }}",
"type": "string"
},
{
"id": "3b906fbf-6b34-4e13-a7fb-d9f9ef8d06ed",
"name": "text",
"value": "={{ $json.text }}",
"type": "string"
},
{
"id": "0c5d752a-48bd-4ad4-a6d3-bfba20fde3b7",
"name": "from.value[0].address",
"value": "={{ $json.from.value[0].address }}",
"type": "string"
},
{
"id": "69d24228-1a45-4e7b-bf30-234daaf19e6d",
"name": "from.value[0].name",
"value": "={{ $json.from.value[0].name }}",
"type": "string"
},
{
"id": "0aa44975-f6e5-4459-91c7-70e284015820",
"name": "date",
"value": "={{ $json.date }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
208,
272
],
"id": "831f3e5c-2643-44a1-a5ce-708dc656df9c",
"name": "Edit Fields"
},
{
"parameters": {
"jsCode": "const stock_list = [""];\n\nconst finance_list = ["" ];\n\nconst news_list = [\"[email protected]\",\"[email protected]\" ];\n\n\nfor (const item of $input.all()) {\n const date = new Date(item.json.date);\n item.json.date = String(date.getTime());\n if (stock_list.includes(item.json.from.value[0].address)){\n \n item.json.label = \"stock\";\n } else if (finance_list.includes(item.json.from.value[0].address)){\n item.json.label = \"finance\";\n } else if (news_list.includes(item.json.from.value[0].address)){\n item.json.label =\"news\";\n } else {\n }\n\n}\n\nreturn $input.all();"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
416,
272
],
"id": "41e3318c-b177-43c9-8d2b-277f909b17db",
"name": "Code"
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $json.label }}",
"rightValue": "=stock",
"operator": {
"type": "string",
"operation": "equals"
},
"id": "4370f3b2-64ad-4774-9f7e-5160f20fce87"
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "c1937cd2-0c07-48d4-9877-c26f809cb0f6",
"leftValue": "={{ $json.label }}",
"rightValue": "finance",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "9615399e-fed8-4184-88c6-303e85737b48",
"leftValue": "={{ $json.label }}",
"rightValue": "news",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
}
}
]
},
"options": {}
},
"type": "n8n-nodes-base.switch",
"typeVersion": 3.2,
"position": [
928,
272
],
"id": "b04e9c5d-233c-433e-80da-d383527746bc",
"name": "Switch",
"alwaysOutputData": false
},
{
"parameters": {
"resource": "message",
"guildId": {
"__rl": true,
"value": "1400903183920005284",
"mode": "list",
"cachedResultName": "Self",
"cachedResultUrl": "https://discord.com/channels/1400903183920005284"
},
"channelId": {
"__rl": true,
"value": "1400903184695824396",
"mode": "list",
"cachedResultName": "一般",
"cachedResultUrl": "https://discord.com/channels/1400903183920005284/1400903184695824396"
},
"content": "={{$json.date}}: {{$json.subject }}",
"options": {}
},
"type": "n8n-nodes-base.discord",
"typeVersion": 2,
"position": [
1472,
176
],
"id": "d0deaa22-934c-4dd2-af91-5e87d650817a",
"name": "Send a message",
"webhookId": "3965014a-22dc-464b-8e33-f2b9aa2f827d",
"credentials": {
"discordBotApi": {
"id": "Gcgudp5hoAQjigbn",
"name": "Discord Bot account"
}
}
},
{
"parameters": {
"sortFieldsUi": {
"sortField": [
{
"fieldName": "date"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.sort",
"typeVersion": 1,
"position": [
624,
272
],
"id": "435681c7-4178-4ddf-b9db-226c9f6279ed",
"name": "Sort"
},
{
"parameters": {
"jsCode": "const targetTimeZone = 'Asia/Hong_Kong'; // Example timezone\n\nconst formatter = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZone: targetTimeZone\n}); // 'en-US' is the locale\n\nfor (const item of $input.all()) {\n const unixTimestampInSeconds = parseInt(item.json.date); \n const dateObject = new Date(unixTimestampInSeconds);\n const local_time = formatter.format(dateObject);\n item.json.date = local_time\n}\n\nreturn $input.all();"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
768,
208
],
"id": "5a19710d-ad86-4fe6-b8d6-57fa1a1cc3d9",
"name": "Code2"
},
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyX",
"value": 0.5,
"unit": "minutes"
}
]
},
"simple": false,
"filters": {
"q": "from:([email protected] OR [email protected])"
},
"options": {}
},
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1.2,
"position": [
-96,
480
],
"id": "f9123330-fea5-4372-9a1b-8f64a91f9406",
"name": "Gmail Trigger",
"credentials": {
"gmailOAuth2": {
"id": "v5DvYRViC2X5ibVR",
"name": "Gmail account"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gpt-4o",
"mode": "list",
"cachedResultName": "GPT-4O"
},
"messages": {
"values": [
{
"content": "Capacity and Role:\nYou are functioning as an Intelligent Transaction Parser. Your capacity is to meticulously analyze the content of emails, identify details related to a financial transaction (like a receipt, invoice, or payment confirmation), and extract this information into a clean, structured format.\nInsight:\nYou will receive one primary input: [Email Content]. The context is that this email is likely a receipt or notification of a payment or purchase. Your task is to act as an automated system that reads this email and pulls out the key transactional data points. You must be able to handle various formats, currencies, and date representations commonly found in emails.\nThe goal is to produce a dual-format output:\nA machine-readable JSON object for reliable database logging, which includes a human-readable name for quick identification.\nA concise, human-readable summary string suitable for sending as a user notification.\nStatement:\nYour primary task is to analyze the [Email Content] and extract the following key pieces of information. If a piece of information cannot be found, you must use null as its value in the JSON output.\nInformation to Extract:\nName (New): A short, descriptive title for the transaction, formatted as [Merchant Name] - [Item/Service Description]. This should be a brief, glanceable summary.\nMerchant Name: The name of the company, service, or person who received the payment (e.g., \"Amazon\", \"Uber\", \"Starbucks Coffee\").\nTransaction Amount: The total amount of the transaction. This should be a numerical value.\nCurrency Code: The three-letter ISO 4217 currency code (e.g., \"USD\", \"EUR\", \"HKD\", \"JPY\").\nTransaction Date: The date the transaction occurred, formatted as YYYY-MM-DD.\nPayment Method: A brief description of the payment method used, if available (e.g., \"Visa ****1234\", \"PayPal\", \"Bank Transfer\").\nItem/Service Description: A brief, high-level description of what was purchased (e.g., \"1x Coffee\", \"Ride fare\", \"Monthly Subscription\"). If there are many items, summarize (e.g., \"Electronics and books\").\nTransaction ID: The unique order number, receipt ID, or transaction reference number, if present.\nStatus: The status of the transaction (e.g., \"Paid\", \"Completed\", \"Refunded\", \"Pending\"). Default to \"Completed\" if not specified.\nOutput Format (CRITICAL):\nYou must generate a single JSON object with two top-level keys: database_entry and notification_summary.\nThe value for database_entry must be a JSON object containing all the extracted information, including the new name field.\nThe value for notification_summary must be a single, concise string summarizing the transaction, formatted as: [Merchant Name]: A transaction of [Currency Code] [Transaction Amount] for '[Item/Service Description]' was confirmed.\nPersonality:\nAdopt a Meticulous, Analytical, and Objective operational mode. Your focus is purely on accurate data extraction and formatting. Avoid making assumptions; if the data isn't explicitly there, mark it as null.\nExperiment (Test Scenarios):\nSimple Receipt: A standard email from an online store with a single item.\nComplex Receipt: An email with multiple items, discounts, and taxes.\nPayment Notification: An email from a service like PayPal or a bank confirming a transfer.\nNon-Transactional Email: An email that is a newsletter or personal message. The model should return a JSON object with null for most database_entry fields and a specific message for the notification_summary (e.g., \"Non-transactional email received.\").\nInternational Email: An email with a different language or currency to test adaptability.\n",
"role": "system"
},
{
"content": "=the email content is {{ $json.text }} and the date of this email is {{ $json.date }} in format of MM/DD/YYYY, HH:MM:SS AM/PM"
}
]
},
"jsonOutput": true,
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 1.8,
"position": [
1136,
304
],
"id": "a3d9989c-c1fb-4e47-bcf9-5d100ce93a4c",
"name": "Messaging the Finance Email Model",
"credentials": {
"openAiApi": {
"id": "GngHQ8gczhPboKRM",
"name": "OpenAi account"
}
}
},
{
"parameters": {
"resource": "databasePage",
"databaseId": {
"__rl": true,
"value": "245ddd6e-1971-803d-be71-e180d37a482b",
"mode": "list",
"cachedResultName": "Expense ",
"cachedResultUrl": "https://www.notion.so/245ddd6e1971803dbe71e180d37a482b"
},
"title": "={{ $json.message.content.database_entry.Name }}",
"propertiesUi": {
"propertyValues": [
{
"key": "Date|rich_text",
"textContent": "={{ $('Code2').item.json.date }}"
},
{
"key": "Merchant|rich_text",
"textContent": "={{ $json.message.content.database_entry['Merchant Name'] }}"
},
{
"key": "Payment Method|rich_text",
"textContent": "={{ $json.message.content.database_entry['Payment Method'] }}"
},
{
"key": "Price|rich_text",
"richText": true,
"text": {
"text": [
{
"text": "={{ $json.message.content.database_entry['Currency Code'] }} ${{ $json.message.content.database_entry['Transaction Amount'] }}",
"annotationUi": {}
}
]
}
}
]
},
"options": {}
},
"type": "n8n-nodes-base.notion",
"typeVersion": 2.2,
"position": [
1472,
448
],
"id": "fe1387da-d2cf-4684-a4a7-4fce48baf4ab",
"name": "Create a database page",
"credentials": {
"notionApi": {
"id": "zB7sQTWKTIaDNT8I",
"name": "Notion account 2"
}
}
},
{
"parameters": {
"resource": "message",
"guildId": {
"__rl": true,
"value": "1400903183920005284",
"mode": "list",
"cachedResultName": "Self",
"cachedResultUrl": "https://discord.com/channels/1400903183920005284"
},
"channelId": {
"__rl": true,
"value": "1400903184695824396",
"mode": "list",
"cachedResultName": "一般",
"cachedResultUrl": "https://discord.com/channels/1400903183920005284/1400903184695824396"
},
"content": "=<@499564610865594378> {{ $('Code2').item.json.date }}: {{ $json.message.content.notification_summary }}",
"options": {}
},
"type": "n8n-nodes-base.discord",
"typeVersion": 2,
"position": [
1472,
304
],
"id": "220fa9cb-52c3-4c09-91ab-24ba4e6bcaf1",
"name": "Send a message1",
"webhookId": "3965014a-22dc-464b-8e33-f2b9aa2f827d",
"credentials": {
"discordBotApi": {
"id": "Gcgudp5hoAQjigbn",
"name": "Discord Bot account"
}
}
},
{
"parameters": {
"resource": "message",
"guildId": {
"__rl": true,
"value": "1400903183920005284",
"mode": "list",
"cachedResultName": "Self",
"cachedResultUrl": "https://discord.com/channels/1400903183920005284"
},
"channelId": {
"__rl": true,
"value": "1400903184695824396",
"mode": "list",
"cachedResultName": "一般",
"cachedResultUrl": "https://discord.com/channels/1400903183920005284/1400903184695824396"
},
"content": "=<@499564610865594378> {{ $('Gmail Trigger').item.json.text }}",
"options": {}
},
"type": "n8n-nodes-base.discord",
"typeVersion": 2,
"position": [
1152,
512
],
"id": "48ff1247-09ca-44d0-9103-4c3ccd018f49",
"name": "Send a message2",
"webhookId": "3965014a-22dc-464b-8e33-f2b9aa2f827d",
"credentials": {
"discordBotApi": {
"id": "Gcgudp5hoAQjigbn",
"name": "Discord Bot account"
}
}
}
],
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Code1",
"type": "main",
"index": 0
}
]
]
},
"Code1": {
"main": [
[
{
"node": "Get many messages",
"type": "main",
"index": 0
}
]
]
},
"Get many messages": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Sort",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
],
[
{
"node": "Messaging the Finance Email Model",
"type": "main",
"index": 0
}
],
[
{
"node": "Send a message2",
"type": "main",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[]
]
},
"Sort": {
"main": [
[
{
"node": "Code2",
"type": "main",
"index": 0
}
]
]
},
"Code2": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Gmail Trigger": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Messaging the Finance Email Model": {
"main": [
[
{
"node": "Send a message1",
"type": "main",
"index": 0
},
{
"node": "Create a database page",
"type": "main",
"index": 0
}
]
]
},
"Send a message1": {
"main": [
[]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "fdba2fe3886a099e6081cc12c53d3290401a418d86f897bfb105c805878de5d7"
}
}```
## Share the output returned by the last node
<!-- If you need help with data transformations, please also share your expected output. -->
It is expected that a message is sent to discord or notion if a email in the category is received
## Information on your n8n setup
- **n8n version:** 1.103.2
- **Database (default: SQLite):**
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):** Self hosting
- **Operating system:**
