CRM Contact Data Preparation for Database Loading - n8n Workflow

Use this structured n8n workflow to mock complex CRM data, transform contact properties (Name, Email), and prepare the clean output for insertion into any database or Google Sheet.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Automation engineers needing standardized data input.
Users integrating Hubspot or similar CRM APIs with databases.
Developers looking for robust n8n templates for data transformation.
Anyone needing an example of the n8n Set node for field mapping.

Overview

This n8n workflow provides a clear, essential pattern for data standardization. When retrieving information from sophisticated systems like a CRM, the output JSON can often be deeply nested and contain excessive fields. This n8n template solves the problem of complexity by demonstrating how to extract only the necessary fields (like full Name and primary Email) and structure them simply for reliable storage.

The initial steps utilize a powerful n8n node—the Function node—to mock the incoming data, simulating an actual API response. Following this, the Set n8n node cleans the data, ensuring that the final data sent to a spreadsheet or database is precisely what is needed, minimizing errors and simplifying downstream operations. Using this n8n structure saves significant time when building integrations.

How it Works

This automation follows a standard linear execution path, starting with a manual n8n trigger and proceeding through data processing nodes.


  1. Trigger Execution: The process begins with the 'On clicking 'execute'' n8n trigger. This is designed for testing but could easily be replaced by a scheduled n8n trigger or webhook.

  2. Mock Data Generation: The 'Mock data (CRM Contacts)' Function n8n node runs. This node is critical as it simulates the complex JSON output one would receive from a 'Get Contacts' operation in a CRM like Hubspot, providing realistic data for the subsequent steps in the n8n workflow.

  3. Data Transformation (Set): The workflow moves to the 'Set' n8n node. This is where data cleansing occurs. It uses expressions to combine fields (e.g., first and last name) and locate nested values (the primary email address), creating standardized Name and Email fields. By enabling 'Keep Only Set', all original, messy CRM data is discarded, ensuring the output of this n8n node is clean.

  4. Data Loading Placeholder: Finally, the transformed data is routed to the 'Replace me' n8n node. This is the intended point to integrate a write operation (like 'Add Row' in Google Sheets or 'Append' in a database connector) to complete the n8n workflow.

Installation Guide

To deploy this n8n workflow, follow these simple steps:


  1. Copy the entire provided n8n workflow JSON.

  2. In your n8n instance, go to the Workflows section and select 'New'.

  3. Click the 'Import from JSON' button and paste the copied data.

  4. Set up the Data Sink: Locate the 'Replace me' n8n node. Replace this node with your desired data sink (e.g., Google Sheets, PostgreSQL, or Airtable).

  5. Configure the new data sink n8n node to receive the Name and Email fields generated by the preceding 'Set' node.

  6. Save the n8n workflow. You can test the entire flow by clicking 'Execute Workflow'. No credentials are required for the initial mock data segment of this n8n template.

Node Details

On clicking 'execute' (Manual Trigger n8n trigger):
Function: Starts the n8n workflow manually for testing and demonstration purposes.
Key Configuration: Standard manual activation.
Mock data (CRM Contacts) (Function n8n node):
Function: Simulates the retrieval of two detailed CRM contact records, mimicking a complex API response structure (e.g., Hubspot).
Key Configuration: Contains custom JavaScript to inject two complex contact JSON objects into the n8n flow.
Set (Set n8n node):
Function: Transforms the complex incoming JSON data into a clean, flat structure required for storage. This core n8n node extracts and renames fields.
Key Configuration:
Name: Uses the expression ={{$json["properties"]["firstname"]["value"]}} {{$json["properties"]["lastname"]["value"]}} to concatenate the names.
Email: Uses ={{$json["identity-profiles"][0]["identities"][0]["value"]}} to extract the primary email.
Keep Only Set: Enabled, ensuring only the new Name and Email fields proceed.
Replace me (NoOp n8n node):
Function: A placeholder indicating where the actual data persistence operation should occur (e.g., appending a row to a Google Sheet or database table). This requires replacing this n8n node with a suitable connector.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by

Design @ n8n

Featured*