AutomationFlowsData & Sheets › Supabase Data Aggregation Workflow

Supabase Data Aggregation Workflow

Original n8n title: Database Include

database_include. Uses executeWorkflowTrigger, supabase. Event-driven trigger; 5 nodes.

Event trigger★★★★☆ complexity5 nodesExecute Workflow TriggerSupabase
Data & Sheets Trigger: Event Nodes: 5 Complexity: ★★★★☆ Added:

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 →

Download .json
{
  "name": "database_include",
  "nodes": [
    {
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "nombre_normalizado"
            },
            {
              "fieldToAggregate": "Principio activo"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        384,
        -32
      ],
      "id": "08241427-f37c-444d-afa6-20b0e02f409c",
      "name": "Aggregate"
    },
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "Execution"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1.1,
      "position": [
        -64,
        -32
      ],
      "id": "742f6352-b873-481a-81e0-b1f4851cbac5",
      "name": "When Executed by Another Workflow"
    },
    {
      "parameters": {
        "content": "## Extracci\u00f3n de nombre y datos normalizados\nHace un includes y devuelve todos los datos con los que hace match. ",
        "height": 320,
        "width": 1000
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -144,
        -128
      ],
      "id": "a4bb44b9-dbbb-4adc-95d2-8e7a6cc39110",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "jsCode": "const input = $('When Executed by Another Workflow').first().json.Execution ?? \"__no__matches__\"\nconst nombres = $input.first().json.nombre_normalizado;\nconst principios = $input.first().json['Principio activo'];\n\nfunction get_nombres (input, nombres) {\n  let nombre_normalizado = [];\n  for (const nombre of nombres) {\n    if (input != null && nombre.includes(input)) {\n      nombre_normalizado.push(nombre) \n    }\n  }\n  if ( nombre_normalizado.length > 0){\n    return [...new Set(nombre_normalizado)];\n  }\n  else {\n    return [\"no matches found\"]\n  }\n}\n\nfunction get_principios(input, principios) {\n  let principio_activo = [];\n  for (const principio of principios) {\n    if (input != null && principio.toLowerCase().includes(input)) {\n      principio_activo.push(principio)\n    }\n  }\n  if (principio_activo.length > 0) {\n    return [...new Set(principio_activo)];\n  }\n  else {\n    return [\"no matches found\"]\n  }\n}\n\nreturn {nombres_normalizados: get_nombres(input, nombres), principio_activo: get_principios(input, principios)}\n\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        592,
        -32
      ],
      "id": "c255df8c-9232-4611-837a-154424eff5e1",
      "name": "Code1"
    },
    {
      "parameters": {
        "operation": "getAll",
        "tableId": "dummy_table_products",
        "returnAll": true
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        192,
        -32
      ],
      "id": "0bad35a8-9346-4da4-86e3-ef11925ef9da",
      "name": "Get many rows",
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Aggregate": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Get many rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many rows": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "be4deedc-a01f-4c56-bb40-1ce7862f8c32",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "cKdVGvO88p5I1Szd",
  "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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

database_include. Uses executeWorkflowTrigger, supabase. Event-driven trigger; 5 nodes.

Source: https://github.com/Btike/Cloud_Automations_portfolio/blob/3c10a42a30b099a761b16e494f4fcbc8c9ff401b/flows/Pharmacy_customer_asistant/data_flows/database_include.json — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

This enables webhooks for nearly realtime updates (every 5 seconds) from Notion Databases.

Notion, Supabase, Execute Workflow Trigger +1
Data & Sheets

Create centralized, structured logs directly from your n8n workflows, using Supabase as your scalable log database.

Execute Workflow Trigger, Supabase, Error Trigger
Data & Sheets

Register_Transaction. Uses executeWorkflowTrigger, supabase, stopAndError. Event-driven trigger; 10 nodes.

Execute Workflow Trigger, Supabase, Stop And Error
Data & Sheets

batch_get_tool. Uses executeWorkflowTrigger, supabase. Event-driven trigger; 4 nodes.

Execute Workflow Trigger, Supabase
Data & Sheets

Pricing. Uses executeWorkflowTrigger, supabase. Event-driven trigger; 3 nodes.

Execute Workflow Trigger, Supabase