This workflow corresponds to n8n.io template #12963 — we link there as the canonical source.
This workflow follows the Emailsend → Postgres 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 →
{
"nodes": [
{
"id": "7fad3e81-6eb0-413d-b6e4-2635ea4ef486",
"name": "Webhook1",
"type": "n8n-nodes-base.webhook",
"position": [
-1664,
624
],
"parameters": {},
"typeVersion": 2
},
{
"id": "bde28bbb-aca2-4dc0-bb37-caffc19cc202",
"name": "Send Email seek chart wtith overall",
"type": "n8n-nodes-base.emailSend",
"position": [
1280,
528
],
"parameters": {},
"executeOnce": false,
"typeVersion": 2.1
},
{
"id": "17e46bc4-2330-4538-8128-79785f0d8185",
"name": "Calculate & Generate Charts",
"type": "n8n-nodes-base.code",
"notes": "import csv\nfrom io import StringIO\n\ndef process_input(input_data):\n organization = input_data[0]\n scores = [int(x) for x in input_data[1:]]\n\n dimensions = [\n (\"Data Strategy & Governance\", 4),\n (\"Data Quality & Integrity\", 3),\n (\"Data-Driven Decision Intelligence\", 4),\n (\"Data Management & Operations\", 4),\n (\"Data Ethics & Privacy\", 4),\n (\"AI Maturity Assessment\", 6)\n ]\n\n dimension_avgs = {}\n start_index = 0\n for dim, count in dimensions:\n dim_scores = scores[start_index:start_index+count]\n dimension_avgs[dim] = sum(dim_scores) / count\n start_index += count\n\n overall_avg = sum(dimension_avgs.values()) / len(dimension_avgs)\n\n html_chart = '''\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse: collapse; margin: 20px 0;\">\n <tr><td>\n '''\n\n for dim, avg in dimension_avgs.items():\n bar_width = avg * 20\n if avg >= 4:\n bar_color = \"#28a745\"\n elif avg >= 3:\n bar_color = \"#ffc107\"\n else:\n bar_color = \"#dc3545\"\n\n html_chart += f'''\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin-bottom: 15px; border-collapse: collapse;\">\n <tr>\n <td width=\"40%\" style=\"padding: 5px; text-align: right; vertical-align: middle; font-weight: bold;\">{dim}</td>\n <td width=\"50%\" style=\"padding: 5px; vertical-align: middle;\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color: #e9ecef; border-radius: 4px; height: 20px;\">\n <tr>\n <td width=\"{bar_width}%\" style=\"background-color: {bar_color}; border-radius: 4px;\"></td>\n <td></td>\n </tr>\n </table>\n </td>\n <td width=\"10%\" style=\"padding: 5px; text-align: center; vertical-align: middle; font-weight: bold;\">{avg:.2f}</td>\n </tr>\n </table>\n '''\n\n html_chart += '</td></tr></table>'\n\n return {\n 'organization': organization,\n 'html_chart': html_chart,\n 'dimension_avgs': dimension_avgs,\n 'overall_avg': overall_avg\n }\n\n# Read input string from previous node\nraw_string = items[0][\"json\"][\"CollectedData\"]\n\n# Parse CSV-style string into list\nf = StringIO(raw_string)\nreader = csv.reader(f)\ninput_data = next(reader)\n\n# Run the function\nresult = process_input(input_data)\n\n# Return for n8n\nreturn [{\"json\": result}]\n",
"position": [
-1200,
416
],
"parameters": {},
"typeVersion": 2
},
{
"id": "60068da3-f65c-4ea0-bd63-a85ae08083ea",
"name": "Save Results",
"type": "n8n-nodes-base.postgres",
"position": [
-976,
416
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "2e30993d-c828-44d6-b87d-1288767a2f24",
"name": "Save Form Details",
"type": "n8n-nodes-base.postgres",
"position": [
-976,
624
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "6fe7e2a4-2c91-4f9a-b868-c0ed9970050a",
"name": "Collect Step",
"type": "n8n-nodes-base.merge",
"position": [
-528,
528
],
"parameters": {},
"typeVersion": 3.1
},
{
"id": "02358eee-6d69-4a88-b0b0-c37fa1c3964c",
"name": "Collect Ranks",
"type": "n8n-nodes-base.merge",
"position": [
-96,
432
],
"parameters": {},
"typeVersion": 3.1
},
{
"id": "449e403a-30b2-44a9-8037-c3e980f3cc94",
"name": "Rank_Data_Strategy_Governance",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
-80
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "53a75890-7c52-43d8-b104-7b09706f115f",
"name": "Rank_Data_Quality_Integrity",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
128
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "33997417-fe52-4cd7-bd4e-f7cd0608d15e",
"name": "Rank_Data_DrivenDecision_Intelligence",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
320
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "d19d55bc-15f9-4b37-b37c-9f4e3f2ed5ea",
"name": "Rank_Data_Management_Operations",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
528
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "b5d808ec-4b65-4a7f-ac70-428874167c4d",
"name": "Rank_Data_Ethics_Privacy",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
720
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "faf58e8b-72ff-4ea5-96a0-5cfea277843d",
"name": "Rank_AI_Maturity_Assessment",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
928
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "ad931f70-e76d-49ac-a250-aa701c5726c7",
"name": "Rank_Overall_Avg",
"type": "n8n-nodes-base.postgres",
"position": [
-320,
1120
],
"parameters": {},
"typeVersion": 2.6
},
{
"id": "7779a41f-751b-4a5d-b333-2a11226042eb",
"name": "Create HTML FIle",
"type": "n8n-nodes-base.convertToFile",
"position": [
752,
704
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "c14f89ce-d21e-4ac4-9cd8-e889496d55de",
"name": "HTML Body",
"type": "n8n-nodes-base.set",
"position": [
480,
704
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "d9354e92-40f6-4726-ac81-1614e99d0e96",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
1008,
528
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "e87f9428-db7b-4eea-9481-24ca542adecc",
"name": "DataCollector",
"type": "n8n-nodes-base.set",
"position": [
-1424,
416
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "3eb7c2d2-d26f-4217-b994-9b13cdccc3e4",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1664,
320
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "57765c3c-ac6e-4432-ae17-ecf716b66f4f",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1280,
304
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "01a8b966-1aa6-4062-8a7c-090a35520273",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-400,
-208
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "09ac49de-9496-4e24-af46-7d49eccb1161",
"name": "Generate Email styling and Formats",
"type": "n8n-nodes-base.code",
"notes": "def get_maturity_assessment(score, dimension):\n \"\"\"\n Evaluates a score and returns complete maturity assessment with descriptions\n Args:\n score (float): Score from 0-5\n dimension (str): One of the 6 assessment dimensions or 'Overall'\n Returns:\n dict: Complete assessment with level, styling, and description\n \"\"\"\n # Dimension descriptions\n dimension_descriptions = {\n \"Data_Strategy_Governance\": {\n \"Excellent\": \"Your data strategy is perfectly aligned with business objectives with robust governance frameworks that set industry standards.\",\n \"Good\": \"Your data strategy shows good alignment with business goals, but governance processes could be more comprehensive.\",\n \"Needs_Improvement\": \"Data strategy lacks clear alignment with business objectives and governance frameworks need significant development.\"\n },\n \"Data_Quality_Integrity\": {\n \"Excellent\": \"Exceptional data quality with rigorous validation processes and near-perfect accuracy across all systems.\",\n \"Good\": \"Data quality is generally reliable but could benefit from more frequent validation and error detection mechanisms.\",\n \"Needs_Improvement\": \"Data quality issues are impacting operations; immediate improvement in validation and cleaning processes needed.\"\n },\n \"Data_Driven_Decision_Intelligence\": {\n \"Excellent\": \"Data-driven decision making is deeply embedded in all business processes with advanced predictive analytics.\",\n \"Good\": \"Decisions are often informed by data, but predictive and prescriptive analytics could be more widely adopted.\",\n \"Needs_Improvement\": \"Decisions are still primarily based on intuition rather than data insights; basic analytics implementation needed.\"\n },\n \"Data_Management_Operations\": {\n \"Excellent\": \"Flawless data operations with optimal resource allocation and seamless integration across all processes.\",\n \"Good\": \"Data operations function well but could benefit from better resource optimization and process automation.\",\n \"Needs_Improvement\": \"Inefficient data operations are causing bottlenecks; urgent process redesign and automation required.\"\n },\n \"Data_Ethics_Privacy\": {\n \"Excellent\": \"Industry-leading ethical standards and privacy protections with comprehensive employee training programs.\",\n \"Good\": \"Solid ethical guidelines and privacy protections in place, but could benefit from more frequent compliance audits.\",\n \"Needs_Improvement\": \"Significant gaps in ethical guidelines and privacy protections pose compliance risks; immediate action needed.\"\n },\n \"AI_Maturity_Assessment\": {\n \"Excellent\": \"AI is strategically integrated across all business functions with continuous model monitoring and optimization.\",\n \"Good\": \"AI is being successfully piloted in some areas but needs broader adoption and better governance frameworks.\",\n \"Needs_Improvement\": \"AI adoption is minimal; basic workforce training and use case identification are needed to begin maturity journey.\"\n },\n \"Overall\": {\n \"Excellent\": \"Your organization demonstrates industry-leading data maturity across all key dimensions.\",\n \"Good\": \"Your organization shows solid data capabilities with some areas for improvement.\",\n \"Needs_Improvement\": \"Your organization has significant opportunities to improve data practices across multiple dimensions.\"\n }\n }\n\n # Determine maturity level\n if score >= 4.0:\n level = \"Excellent\"\n elif score >= 3.0:\n level = \"Good\"\n else:\n level = \"Needs_Improvement\"\n\n # Get gradient colors\n gradients = {\n \"Excellent\": (\"#d4fddd\", \"#067820\"),\n \"Good\": (\"#fff3cd\", \"#fd7e14\"),\n \"Needs_Improvement\": (\"#f8d7da\", \"#dc3545\")\n }\n\n return {\n \"dimension\": dimension,\n \"score\": score,\n \"level\": level,\n \"description\": dimension_descriptions[dimension][level],\n \"css_class\": level.lower().replace(\"_\", \"-\"),\n \"gradient\": f\"linear-gradient(90deg, {gradients[level][0]} 0%, {gradients[level][1]} 100%)\",\n \"color_start\": gradients[level][0],\n \"color_end\": gradients[level][1]\n }\n\n# Get input from n8n (example structure)\ninput_data = { \n \"Data_Strategy_Governance\": items[0][\"json\"][\"Data_Strategy_Governance\"],\n \"Data_Quality_Integrity\": items[1][\"json\"][\"Data_Quality_Integrity\"],\n \"Data_Driven_Decision_Intelligence\": items[2][\"json\"][\"Data_DrivenDecision_Intelligence\"],\n \"Data_Management_Operations\": items[3][\"json\"][\"Data_Management_Operations\"],\n \"Data_Ethics_Privacy\": items[4][\"json\"][\"Data_Ethics_Privacy\"],\n \"AI_Maturity_Assessment\": items[5][\"json\"][\"AI_Maturity_Assessment\"]\n}\n\n# Validate input scores\nfor dimension, score in input_data.items():\n if not isinstance(score, (int, float)) or score < 0 or score > 5:\n raise ValueError(f\"Invalid score ({score}) for {dimension}. Must be number between 0-5\")\n\n# Process all dimensions\nresults = []\nfor dimension, score in input_data.items():\n results.append(get_maturity_assessment(score, dimension))\n\n# Calculate overall maturity\noverall_score = sum(item['score'] for item in results) / len(results)\noverall_assessment = get_maturity_assessment(overall_score, \"Overall\")\n\n# Return in n8n format\nreturn [{\n \"json\": {\n \"overall\": overall_assessment,\n \"dimensions\": results\n }\n}]",
"position": [
192,
512
],
"parameters": {},
"typeVersion": 2
},
{
"id": "29762eb5-d28c-4328-9541-fd4a337fa5c2",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
96,
704
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "45961cdf-09e4-4c43-a40b-16951365cd62",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
416,
880
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "88a51184-8b6f-426f-8723-5e55ba00ebef",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1744,
-352
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "f5d7b7f5-18f7-4435-9bcd-421ab72434f4",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
-256
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "b745a9e9-a5c6-4c48-8dc3-0feed0fc7f3d",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
-112
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "1d4bc79c-1f4a-42a6-8e74-88f1f0a9ceb7",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
16
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "c5c3f24b-4c00-4291-82a4-c667e144b3d5",
"name": "Sticky Note9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
160
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "ddda747d-4843-4eee-8bcb-21ebbb31ebc0",
"name": "Sticky Note10",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
-256
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "7e3d7f21-fd54-405d-a43a-06e081bce16b",
"name": "Sticky Note11",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
-96
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "e8007a8d-b8d1-48fa-acf6-1d484faa22fe",
"name": "Sticky Note12",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-336
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "13547bc0-b178-4fd9-9216-cf5449d02dc8",
"name": "Sticky Note13",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
96
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "d99af876-71ec-4ae9-b8cf-527b5e4a8296",
"name": "Sticky Note14",
"type": "n8n-nodes-base.stickyNote",
"position": [
1168,
112
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "ec867ea6-793e-4afe-b55f-126aee4f280c",
"name": "Sticky Note15",
"type": "n8n-nodes-base.stickyNote",
"position": [
-816,
240
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "f816f0b6-ff41-4a23-b9ae-a75fdee36a4f",
"name": "Wait Save Form Details",
"type": "n8n-nodes-base.wait",
"position": [
-752,
624
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "c92e2172-edc4-4d3c-95c0-8cd6c05edc47",
"name": "Wait Save Results",
"type": "n8n-nodes-base.wait",
"position": [
-752,
416
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "9cd414f1-8f74-4cd7-ac6e-554dfe49957a",
"name": "Sticky Note16",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1744,
-192
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "63ceeeeb-db14-4c7c-a00f-0edf668b2074",
"name": "Sticky Note18",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1744,
16
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "70a1aa00-435e-4489-8d18-881ae9a39efe",
"name": "Sticky Note17",
"type": "n8n-nodes-base.stickyNote",
"position": [
1184,
-288
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "1baa9fd0-3e77-469c-90cf-9f6c591c93c7",
"name": "Sticky Note20",
"type": "n8n-nodes-base.stickyNote",
"position": [
1168,
-336
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "6661016b-c444-439c-b94b-46d3bbe94c6b",
"name": "Sticky Note19",
"type": "n8n-nodes-base.stickyNote",
"position": [
1408,
-288
],
"parameters": {
"content": ""
},
"typeVersion": 1
}
],
"connections": {
"Merge": {
"main": [
[
{
"node": "Send Email seek chart wtith overall",
"type": "main",
"index": 0
}
]
]
},
"Webhook1": {
"main": [
[
{
"node": "DataCollector",
"type": "main",
"index": 0
},
{
"node": "Save Form Details",
"type": "main",
"index": 0
}
]
]
},
"HTML Body": {
"main": [
[
{
"node": "Create HTML FIle",
"type": "main",
"index": 0
}
]
]
},
"Collect Step": {
"main": [
[
{
"node": "Rank_Data_Strategy_Governance",
"type": "main",
"index": 0
},
{
"node": "Rank_Data_Quality_Integrity",
"type": "main",
"index": 0
},
{
"node": "Rank_Data_DrivenDecision_Intelligence",
"type": "main",
"index": 0
},
{
"node": "Rank_Data_Management_Operations",
"type": "main",
"index": 0
},
{
"node": "Rank_Data_Ethics_Privacy",
"type": "main",
"index": 0
},
{
"node": "Rank_AI_Maturity_Assessment",
"type": "main",
"index": 0
},
{
"node": "Rank_Overall_Avg",
"type": "main",
"index": 0
}
]
]
},
"Save Results": {
"main": [
[
{
"node": "Wait Save Results",
"type": "main",
"index": 0
}
]
]
},
"Collect Ranks": {
"main": [
[
{
"node": "Generate Email styling and Formats",
"type": "main",
"index": 0
}
]
]
},
"DataCollector": {
"main": [
[
{
"node": "Calculate & Generate Charts",
"type": "main",
"index": 0
}
]
]
},
"Create HTML FIle": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Rank_Overall_Avg": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 6
}
]
]
},
"Save Form Details": {
"main": [
[
{
"node": "Wait Save Form Details",
"type": "main",
"index": 0
}
]
]
},
"Wait Save Results": {
"main": [
[
{
"node": "Collect Step",
"type": "main",
"index": 0
}
]
]
},
"Wait Save Form Details": {
"main": [
[
{
"node": "Collect Step",
"type": "main",
"index": 1
}
]
]
},
"Rank_Data_Ethics_Privacy": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 4
}
]
]
},
"Calculate & Generate Charts": {
"main": [
[
{
"node": "Save Results",
"type": "main",
"index": 0
}
]
]
},
"Rank_AI_Maturity_Assessment": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 5
}
]
]
},
"Rank_Data_Quality_Integrity": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 1
}
]
]
},
"Rank_Data_Strategy_Governance": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 0
}
]
]
},
"Rank_Data_Management_Operations": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 3
}
]
]
},
"Generate Email styling and Formats": {
"main": [
[
{
"node": "HTML Body",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Rank_Data_DrivenDecision_Intelligence": {
"main": [
[
{
"node": "Collect Ranks",
"type": "main",
"index": 2
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates data maturity evaluation to measure how well an organization uses data to create value by capturing assessment data through forms or APIs, processing and scoring responses using n8n logic and transformation nodes, and evaluating six critical data maturity…
Source: https://n8n.io/workflows/12963/ — 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 n8n workflow automates the transformation of raw text ideas into structured visual diagrams and content assets using NapkinAI.
Receive request via webhook with customer question Analyze sentiment and detect urgency using JavaScript Send urgent alerts to Slack for critical cases Search knowledge base and fetch conversation his
PURPOSE: Automatically send professional appointment reminders via email and SMS to reduce no-shows and improve patient experience.
Enviador de Feedback - Adeptify.es. Uses emailSend, postgres. Webhook trigger; 7 nodes.