DEV Community

Cover image for Automating People Data Sync: n8n Workflow for Twenty CRM and Google Sheets 🚀
Raju Gangitla
Raju Gangitla

Posted on

Automating People Data Sync: n8n Workflow for Twenty CRM and Google Sheets 🚀

Did you know that keeping your data in sync can boost your team's efficiency? In this article, we'll show you how to create an n8n workflow that automatically adds, updates, and deletes people data in Google Sheets whenever changes happen in the Twenty CRM dashboard. Let’s dive in!

TL:DR

1. Set Up n8n: Create an account and configure your n8n environment.
2. Connect to Twenty: Use the Twenty API to integrate with n8n.
3. Configure Google Sheets: Set up your Google Sheets connection in n8n.
4. Create Workflow: Build a workflow to automatically add, update, and delete people data.
5. Test Your Workflow: Ensure it functions correctly with real-time changes from the Twenty dashboard.

Excited gif

Twenty CRM: Your Open-Source CRM Solution 🚀

Meet Twenty CRM! This powerful, open-source tool helps you manage customer relationships with ease, giving you control over your data and customization. If you’re a fan of open-source solutions, give it a try and show some support with a ⭐!


Step 1: Set Up n8n

1.📝Create an n8n Account: Sign up for a free account at n8n.io and choose your hosting option (cloud or self-hosted).

2.🔍Familiarize Yourself with the Interface: Explore the n8n dashboard, focusing on the nodes panel for integrations and the workflow area for building your automation.

After SignIn, you will see the below page.

Image description

Step 2: Create Your Workflow by Adding a Webhook Node

1. Webhook Node in n8n: Showing where to add a Webhook node and set it to POST
Select event
2. Adding Webhook URL in Twenty CRM: Add thr Webhook url in the Twenty CRM dashbaord

3. Testing Webhook Response: Show the successful webhook response in n8n after creating a test entry in Twenty CRM
testing

Step 3: Add Google Sheets and Switch Nodes for CRUD Operations

  • Add a Switch Node: Attach a Switch node to the Webhook node and set up routing rules for Create, Update, and Delete events, using the webhook payload to define conditions for each. switch
  • Add Google Sheets Node:Add a Google Sheets node and connect it to the Create and Update routes from the Switch node. Choose Add or Update Row in Google Sheets and enter your credentials.
  • Map Data to Google Sheets: Select your Google Sheet and map the fields from the webhook data to the sheet’s columns for both Create and Update actions.
    Credentials

  • Handle Delete Events: Add a Google Sheets node for deletions and set it to Get Rows. Configure a filter condition to identify rows for deletion based on a unique field. Pass this output to another Google sheet node where it will delete the row by index (that we got in previous node)
    Delete Events

Step 4: Test your Workflow

  • Activate Listening Mode: In n8n, click Listen for Test Event on the Webhook node to enable real-time data capture.
  • Trigger Events in Twenty CRM: Go to your Twenty CRM dashboard and create, update, or delete a person to trigger events.
  • Verify Data in Google Sheets: After each action in Twenty CRM, check the Google Sheet to confirm that the data has been added, updated, or deleted as expected.

Test your Workflow

Troubleshooting Tips:

  • After completing your testing, switch to the production webhook URL in the Twenty CRM dashboard to ensure live data flows correctly.
  • Once configured, set your workflow to active in n8n to see it in action in real-time!

Troubleshooting


Conclusion

You’ve successfully integrated Twenty CRM with Google Sheets using n8n, automating your data management. Enjoy streamlined processes and improved efficiency as you focus on growing your business!

If you have any doubt or you stuck somewhere feel free to drop a comment

Top comments (0)