⚑n8n Workflow
Advanced

TwentyCRM Event Notifications for Slack & Gmail

Automate real-time TwentyCRM event notifications. Trigger workflows on new events, log them in Google Sheets, and route alerts to Slack or Gmail based on the event type (e.g., delete events to email).

Overview

Receive instant notifications in Slack or Gmail for specific events in TwentyCRM, such as record creation, updates, or deletions, and maintain a log in Google Sheets.

🧠 Description & Use Case

This workflow provides real-time notifications for events happening in your TwentyCRM instance. It listens for any activity (like creating, updating, or deleting a record), logs the event for auditing purposes, and sends a customized alert to a specific messaging channelβ€”Gmail for critical delete events and Slack for all other updates.

πŸ”„ How It Works:

  1. Trigger on TwentyCRM Event

    • The Webhook node listens for incoming events from TwentyCRM. You need to configure this webhook URL in your TwentyCRM settings to start receiving data.
  2. Filter and Structure Data

    • The Set node extracts key information from the webhook payload, such as the eventName, record.id, and objectMetadata.id, making the data easier to use in subsequent steps.
  3. Log Every Event

    • The Google Sheets node appends a new row for every event triggered, creating a comprehensive audit log of all activities within TwentyCRM.
  4. Conditional Routing

    • The If node evaluates the eventName to determine the appropriate notification channel.
    • If the event is a delete action, the workflow proceeds to the Gmail branch.
    • For all other events (e.g., create, update), it routes the data to the Slack branch.
  5. Send Notifications

    • Gmail Channel: For delete events, an email is sent with the subject "Record Deleted in TwentyCRM," providing details of the deleted record.
    • Slack Channel: For all other events, a message is posted to a designated Slack channel with the event details.

βœ… Real-World Use Cases:

  • Sales Team Alerts: Instantly notify your sales channel in Slack whenever a new lead is created or a deal stage is updated in TwentyCRM.
  • Data Integrity Monitoring: Receive immediate email alerts when a contact, company, or deal is deleted, allowing you to quickly verify accidental deletions.
  • Customer Support Workflow: Alert the support team on Slack when a new task or note is added to a customer's record.
  • Auditing and Compliance: Maintain a complete, timestamped log of all CRM activities in a Google Sheet for reporting and compliance checks.

Instructions

Basic steps

  1. Download workflow JSON
  2. Import into n8n
  3. Configure node parameters as needed
  4. Test and enable the workflow

πŸ’‘ Tips

After importing, verify all connectors and credentials match your environment.

Preview

Workflow Visualization

11 nodes
100%
Sticky Note1stickyNotefilter required data #eventType mandatorysetevents loggoogleSheetsmessage channel evaluationifSticky Note2stickyNoteSticky NotestickyNoteSticky Note3stickyNoteSticky Note4stickyNoteon new twentycrm eventwebhookemail channel for delete eventTypegmailmessage channel for all other eventTypesslack

Nodes

1

Sticky Note1

stickyNote

v1
2

filter required data #eventType mandatory

set

v3.4
3

events log

googleSheets

v4.5
4

message channel evaluation

if

v2.2
5

Sticky Note2

stickyNote

v1
6

Sticky Note

stickyNote

v1
7

Sticky Note3

stickyNote

v1
8

Sticky Note4

stickyNote

v1
9

on new twentycrm event

webhook

v2
10

email channel for delete eventType

gmail

v2.1
11

message channel for all other eventTypes

slack

v2.2

Statistics

Total nodes:11
Disabled nodes:0
Node types:7
Connections:4
View full JSON structure
{
  "nodes": [
    {
      "id": "5e823dd0-f50a-49ad-9e9a-7d0aee656b9c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        620,
        580
      ],
      "parameters": {
        "color": 7,
        "width": 239.3644067541545,
        "height": 80,
        "content": "**1. ☝️ Set up `On new TwentyCRM event` Trigger's url at webhook in TwentyCRM**"
      },
      "typeVersion": 1
    },
    {
      "id": "0eb98b9a-2f47-4199-a7e5-fe1f9c112721",
      "name": "filter required data #eventType mandatory",
      "type": "n8n-nodes-base.set",
      "position": [
        860,
        380
      ],
      "parameters": {
        "options": {
          "dotNotation": true,
          "ignoreConversionErrors": true
        },
        "assignments": {
          "assignments": [
            {
              "id": "9e24e3f4-e750-4b50-b467-24612717f6a0",
              "name": "eventName",
              "type": "string",
              "value": "={{ $json.body.eventName }}"
            },
            {
              "id": "b6aa9813-39bf-4b3d-9df0-aa93fbf4dc73",
              "name": "objectMetadata.id",
              "type": "string",
              "value": "={{ $json.body.objectMetadata.id }}"
            },
            {
              "id": "8bdff15a-a98a-41ad-89d0-e793c3edb14c",
              "name": "objectMetadata.nameSingular",
              "type": "string",
              "value": "={{ $json.body.objectMetadata.nameSingular }}"
            },
            {
              "id": "0b81e0e6-e9c6-4c03-9b08-f27d1e36b56e",
              "name": "record.id",
              "type": "string",
              "value": "={{ $json.body.record.id }}"
            },
            {
              "id": "71e164f5-d8a2-4ac2-b898-71221b26d92d",
              "name": "record.__typename",
              "type": "string",
              "value": "={{ $json.body.record.__typename }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2cf5a0df-17ff-43c8-a885-7e4657c8b912",
      "name": "events log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1160,
        540
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "ade9d73e-109b-47a2-9d57-2c8a3c031a4c",
      "name": "message channel evaluation",
      "type": "n8n-nodes-base.if",
      "position": [
        1440,
        380
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "effea083-18d0-4b56-8b77-8ca461a371b6",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.eventName.split(\".\")[1] }}",
              "rightValue": "delete"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "37ab5d83-9112-470a-894f-bf508e4612b7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        220
      ],
      "parameters": {
        "color": 7,
        "width": 242.3473830323225,
        "height": 131.4798719116814,
        "content": "**Filter Data πŸ‘‡**\nChange filter criteria here to determine what values are required for you but don't forget to include eventType as it is a functional requirement"
      },
      "typeVersion": 1
    },
    {
      "id": "be669d56-0323-48cf-a474-8d22b04148e0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        580
      ],
      "parameters": {
        "color": 7,
        "width": 200.3243983123301,
        "height": 95.26139957883888,
        "content": "**πŸ‘ˆ event loggin**\nAll events are logged in the sheet with one entry per row"
      },
      "typeVersion": 1
    },
    {
      "id": "7db1418e-5eb1-4bdb-afa0-e9cb268af187",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1340,
        240
      ],
      "parameters": {
        "color": 7,
        "width": 194,
        "height": 101,
        "content": "**Evaluation πŸ‘‡**\nBased on the conditions proper channel for messaging is selected"
      },
      "typeVersion": 1
    },
    {
      "id": "77a06749-e901-44d0-8b45-06bf90715ed2",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        220
      ],
      "parameters": {
        "color": 6,
        "width": 226.6407428938614,
        "height": 128.5891278583819,
        "content": "### Get event triggered notifications / updates on preferred messaging channels with TwentyCRM ### \n"
      },
      "typeVersion": 1
    },
    {
      "id": "1a1854bb-84c3-48a7-99ac-cc2245b2fafa",
      "name": "on new twentycrm event",
      "type": "n8n-nodes-base.webhook",
      "position": [
        600,
        380
      ],
      "webhookId": "8118bda9-0e4f-44cd-bf64-31020b6d5ab5",
      "parameters": {
        "path": "8118bda9-0e4f-44cd-bf64-31020b6d5ab5",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "09e33fe9-e9cf-4370-9141-a74868447eff",
      "name": "email channel for delete eventType",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1740,
        200
      ],
      "webhookId": "45e4872f-0723-416c-854d-769901010bf4",
      "parameters": {
        "message": "=<h2>Please find below the attached record details</h2><br/><br/> \n<ul>\n<li>\nobjectMetadata_id: {{ $json.objectMetadata.id }}\n</li>\n<li>\nrecord_id: {{ $json.record.id }}\n</li>\n</ul>",
        "options": {},
        "subject": "Record Deleted in TwentyCRM"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f732e7e9-8378-44e9-a4ba-ec509ae210f6",
      "name": "message channel for all other eventTypes",
      "type": "n8n-nodes-base.slack",
      "position": [
        1740,
        540
      ],
      "webhookId": "4ff4d697-aaeb-4092-8e4e-d7c1c3a9b3ff",
      "parameters": {
        "text": "=event: {{ $json.eventName }}\nevent_id: {{ $json.objectMetadata.id }}\nrecord_id: {{ $json.record.id }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "events log": {
      "main": [
        [
          {
            "node": "message channel evaluation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "on new twentycrm event": {
      "main": [
        [
          {
            "node": "filter required data #eventType mandatory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "message channel evaluation": {
      "main": [
        [
          {
            "node": "email channel for delete eventType",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "message channel for all other eventTypes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter required data #eventType mandatory": {
      "main": [
        [
          {
            "node": "events log",
            "type": "main",
            "index": 0
          },
          {
            "node": "message channel evaluation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Actions

Share
Categories:
Tags:
ifsetgmailslackwebhookgooglesheetsstickynote

Technical Specs

Complexity:
Advanced
Node Count:
11 nodes
Published:11 months ago
Updated:3 days ago

Compatibility

Platform:
N8N Cloud & Self-hosted
Min Version:
N8N v1.0.0+
Supports cloud and self-hosted deployment

License

This workflow template follows MIT license, you can freely use, modify and distribute.

Please comply with relevant third-party service terms when using.

Related Workflows