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 →
{
"name": "notification alert",
"nodes": [
{
"parameters": {
"operation": "executeQuery",
"query": "SELECT u.name AS user_name, u.email AS user_email, ulm.match_score, ulm.recommendation_strength, lp.product_name AS loan_name, lp.interest_rate, lp.max_amount, lp.min_amount, ulm.user_id, ulm.product_id FROM user_loan_matches ulm JOIN users u ON ulm.user_id = u.user_id JOIN loan_products lp ON ulm.product_id = lp.id -- Optional: Add a WHERE clause to filter only matches that haven't been notified yet (if using this query for Workflow C) \nWHERE ulm.is_notified = FALSE;",
"options": {}
},
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.6,
"position": [
224,
0
],
"id": "503ce09a-857b-4a76-8ece-d96f19377a15",
"name": "Execute a SQL query",
"credentials": {
"postgres": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "// Group all products by user\nconst users = {};\n\nitems.forEach(item => {\n const row = item.json;\n const uid = row.user_id;\n\n if (!users[uid]) {\n users[uid] = {\n name: row.user_name,\n email: row.user_email,\n products: []\n };\n }\n\n users[uid].products.push({\n loan_name: row.loan_name,\n interest_rate: row.interest_rate,\n min_amount: row.min_amount,\n max_amount: row.max_amount,\n match_score: row.match_score,\n recommendation_strength: row.recommendation_strength\n });\n});\n\n// Convert grouped data into email items for SES\nreturn Object.values(users).map(user => {\n // Build loan recommendation section\n const listText = user.products\n .map(p => \n `\u2022 ${p.loan_name}\n - Interest Rate: ${p.interest_rate}%\n - Amount Range: ${p.min_amount} to ${p.max_amount}\n - Match Score: ${p.match_score}\n - Strength: ${p.recommendation_strength}\\n`\n )\n .join(\"\\n\");\n\n return {\n json: {\n to: user.email,\n subject: `Your Personalized Loan Recommendations`,\n body: `\nHello ${user.name},\n\nBased on your profile, we found the following loan options for you:\n\n${listText}\n\nYou can explore these offers and choose the best one.\n\nRegards,\nLoan Engine Team\n`\n }\n };\n});\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
480,
0
],
"id": "ba93e0fe-eb6d-4ebe-b5d6-dd613f5a8fde",
"name": "Code in JavaScript"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-128,
0
],
"id": "9ddbd5d1-c848-4ae4-9de1-eb3dcfda6cd6",
"name": "When clicking \u2018Execute workflow\u2019"
}
],
"connections": {
"Execute a SQL query": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Execute a SQL query",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "1638e77b-76ed-4948-89a3-41b0bd287afd",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "Z49V1WgZwnbNUmqK",
"tags": []
}
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.
postgres
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
notification alert. Uses postgres. Event-driven trigger; 3 nodes.
Source: https://github.com/Phemon420/loan_eligbility_check/blob/0b7b555a63ca78b3ed4bbc62514715743257d6b0/n8n/notification_alert.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.
Reagendamiento_v2. Uses executeWorkflowTrigger, redis, httpRequest, n8n-nodes-evolution-api. Event-driven trigger; 89 nodes.
This workflow acts as a junior finance research analyst for a UK boutique M&A or corporate finance team. It listens for Slack messages, classifies the request, gathers company or market data, and prod
Agendamiento_v2. Uses n8n-nodes-evolution-api, redis, httpRequest, executeWorkflowTrigger. Event-driven trigger; 59 nodes.
Cancelacion_v2. Uses executeWorkflowTrigger, redis, httpRequest, n8n-nodes-evolution-api. Event-driven trigger; 46 nodes.
Components. Uses postgres, readWriteFile. Event-driven trigger; 42 nodes.