N
n8n Store
Workflow Market
AI automation using n8n, Jotform, Attio CRM and Slack

AI automation using n8n, Jotform, Attio CRM and Slack

by appunitsai0 views

Description

Categories

⚙️ Automation

Nodes Used

n8n-nodes-base.ifn8n-nodes-base.setn8n-nodes-base.coden8n-nodes-base.switchn8n-nodes-base.webhookn8n-nodes-base.dataTablen8n-nodes-base.dataTablen8n-nodes-base.dataTablen8n-nodes-base.dataTablen8n-nodes-base.dataTable
PriceGratis
Views0
Last Updated11/28/2025
workflow.json
{
  "id": "iZSCJlsspoezZxqm",
  "meta": {
    "instanceId": "3549451ca835035557d5dc1c3d9e6ba924e7314534a74c901f66b91f9ef6023e",
    "templateCredsSetupCompleted": true
  },
  "name": "AI automation using n8n, Jotform, Attio CRM and Slack",
  "tags": [],
  "nodes": [
    {
      "id": "fe880e8e-e413-4a51-9457-fe93ecc5a367",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        2208,
        192
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Deal exists",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3bc17a85-d99b-4c90-b0fe-d1e3774a819e",
                    "operator": {
                      "type": "boolean",
                      "operation": "true",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.deal.exists }}",
                    "rightValue": 1
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Deal doesn't exist",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7801af09-9bdb-40b6-a8ec-58bce6403236",
                    "operator": {
                      "type": "boolean",
                      "operation": "false",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.deal.exists }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "e0e20813-87ca-44fe-820c-a3d49d700fdb",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        384,
        240
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"data_tables_id\": \"\",\n  \"statuses\": {\n    \"pending\": {\n      \"key\": \"PENDING_STATUS\",\n      \"value\": \"Pending\"\n    },\n    \"urgent\": {\n      \"key\": \"URGENT_STATUS\",\n      \"value\": \"Urgent\"\n    }\n  },\n  \"columns\": {\n    \"message\": {\n      \"key\": \"MESSAGE_COLUMN\",\n      \"value\": \"Message\",\n      \"slug\": \"message\",\n      \"description\": \"the customer message\",\n      \"type\": \"text\",\n      \"is_required\": false,\n      \"is_unique\": false,\n      \"is_multiselect\": false\n    }\n  },\n  \"customer\": {\n    \"name\": \"{{ $json.body.name }}\",\n    \"email\": \"{{ $json.body.email }}\",\n    \"message\": \"{{ $json.body.message }}\"\n  },\n  \"owner_email\": \"\"\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "04af19f6-8344-4422-b171-f6b4975200f5",
      "name": "If pending status does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        656,
        -624
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "={{ $json.statuses.pending.key }}"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fc8dcff2-b4a6-4893-94a2-6eece20be089",
      "name": "If urgent status does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        656,
        -448
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "={{ $json.statuses.urgent.key }}"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "67b00378-756b-4526-afe7-d56f70baa91d",
      "name": "If message column does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        656,
        80
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "={{ $json.columns.message.key }}"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b19143b9-02c1-4a21-9b17-7735ef5d0917",
      "name": "If deals id does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        656,
        -784
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "=DEALS_ID"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "69cd3188-c2af-4de4-9a24-9ce71954c54c",
      "name": "Get the deals id",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        864,
        -624
      ],
      "parameters": {
        "limit": 1,
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "DEALS_ID"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "47d07c63-dbea-4bfe-9c25-de118e480d72",
      "name": "Get the deals id1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        864,
        -448
      ],
      "parameters": {
        "limit": 1,
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "DEALS_ID"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "873afc25-057d-4028-896d-b5bfdc37ddc6",
      "name": "If people id does not exist",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        656,
        -96
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "=PEOPLE_ID"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "rowNotExists",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d2a32e66-d436-4614-931c-939263fe2217",
      "name": "Get the people id",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        864,
        80
      ],
      "parameters": {
        "limit": 1,
        "filters": {
          "conditions": [
            {
              "keyName": "key",
              "keyValue": "PEOPLE_ID"
            }
          ]
        },
        "matchType": "allConditions",
        "operation": "get",
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3cd05fbc-8b71-43f8-a920-046602451f40",
      "name": "Get the deals id (CRM)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        -784
      ],
      "parameters": {
        "url": "https://api.attio.com/v2/objects/deals",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "7694da54-260a-4804-9da4-7469f700945b",
      "name": "Add deals id to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1072,
        -784
      ],
      "parameters": {
        "columns": {
          "value": {
            "key": "DEALS_ID",
            "value": "={{ $json.data.id.object_id }}",
            "is_done": true
          },
          "schema": [
            {
              "id": "key",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "key",
              "defaultMatch": false
            },
            {
              "id": "value",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "value",
              "defaultMatch": false
            },
            {
              "id": "is_done",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "is_done",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ed38bef7-fe3e-43d1-8dde-2a9d96569898",
      "name": "Add pending status to CRM",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        -624
      ],
      "parameters": {
        "url": "=https://api.attio.com/v2/objects/{{ $json.value }}/attributes/stage/statuses",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"data\": {\n    \"title\": \"{{ $('Edit Fields').item.json.statuses.pending.value }}\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5161a0fb-4f9c-4af1-9d1b-de4ca1fdab99",
      "name": "Add pending status to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1264,
        -624
      ],
      "parameters": {
        "columns": {
          "value": {
            "key": "={{ $('Edit Fields').item.json.statuses.pending.key }}",
            "value": "={{ $('Edit Fields').item.json.statuses.pending.value }}",
            "is_done": true
          },
          "schema": [
            {
              "id": "key",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "key",
              "defaultMatch": false
            },
            {
              "id": "value",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "value",
              "defaultMatch": false
            },
            {
              "id": "is_done",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "is_done",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7e17c9b2-f94e-463d-b912-759fa36730cf",
      "name": "Add urgent status to CRM",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        -448
      ],
      "parameters": {
        "url": "=https://api.attio.com/v2/objects/{{ $json.value }}/attributes/stage/statuses",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"data\": {\n    \"title\": \"{{ $('Edit Fields').item.json.statuses.urgent.value }}\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "bff00017-a618-4d68-8aad-c449a8f90828",
      "name": "Add urgent status to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1264,
        -448
      ],
      "parameters": {
        "columns": {
          "value": {
            "key": "={{ $('Edit Fields').item.json.statuses.urgent.key }}",
            "value": "={{ $('Edit Fields').item.json.statuses.urgent.value }}",
            "is_done": true
          },
          "schema": [
            {
              "id": "key",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "key",
              "defaultMatch": false
            },
            {
              "id": "value",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "value",
              "defaultMatch": false
            },
            {
              "id": "is_done",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "is_done",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f73ab352-1baa-46ae-b26a-738e12f89ef5",
      "name": "Get the people id (CRM)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        -96
      ],
      "parameters": {
        "url": "https://api.attio.com/v2/objects/people",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c2753928-4722-45a5-914f-5424858c81dd",
      "name": "Add people id to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1072,
        -96
      ],
      "parameters": {
        "columns": {
          "value": {
            "key": "PEOPLE_ID",
            "value": "={{ $json.data.id.object_id }}",
            "is_done": true
          },
          "schema": [
            {
              "id": "key",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "key",
              "defaultMatch": false
            },
            {
              "id": "value",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "value",
              "defaultMatch": false
            },
            {
              "id": "is_done",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "is_done",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "30783791-940a-4042-922c-5b98741c7622",
      "name": "Add message column to CRM",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1072,
        80
      ],
      "parameters": {
        "url": "=https://api.attio.com/v2/objects/{{ $json.value }}/attributes",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"data\": {\n    \"title\": \"{{ $('Edit Fields').item.json.columns.message.value }}\",\n    \"description\": \"{{ $('Edit Fields').item.json.columns.message.description }}\",\n    \"api_slug\": \"{{ $('Edit Fields').item.json.columns.message.slug }}\",\n    \"type\": \"{{ $('Edit Fields').item.json.columns.message.type }}\",\n    \"is_required\": {{ $('Edit Fields').item.json.columns.message.is_required }},\n    \"is_unique\": {{ $('Edit Fields').item.json.columns.message.is_unique }},\n    \"is_multiselect\": {{ $('Edit Fields').item.json.columns.message.is_multiselect }},\n    \"config\": {}\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b31c71a2-820c-47d3-95a7-146fb2abb6f3",
      "name": "Add message column to DB",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1264,
        80
      ],
      "parameters": {
        "columns": {
          "value": {
            "key": "={{ $('Edit Fields').item.json.columns.message.key }}",
            "value": "={{ $('Edit Fields').item.json.columns.message.value }}",
            "is_done": true
          },
          "schema": [
            {
              "id": "key",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "key",
              "defaultMatch": false
            },
            {
              "id": "value",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "value",
              "defaultMatch": false
            },
            {
              "id": "is_done",
              "type": "boolean",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "is_done",
              "defaultMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "dataTableId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Edit Fields').item.json.data_tables_id }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c57c56c7-4cd7-47d8-9eed-b50c8d5a2353",
      "name": "Get customer by email",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1584,
        368
      ],
      "parameters": {
        "url": "https://api.attio.com/v2/objects/people/records/query",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"filter\": {\n    \"email_addresses\": \"{{ $('Edit Fields').item.json.customer.email }}\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f8a86ea0-cc20-43d9-b399-e6dc518fadad",
      "name": "Prepare customer data",
      "type": "n8n-nodes-base.code",
      "position": [
        1792,
        368
      ],
      "parameters": {
        "jsCode": "let customer = {\n  exists: $input.first().json.data.length > 0,\n  name: \"\",\n  email: \"\",\n  deal: {\n    exists: false,\n    details: {}\n  }\n}\n\nif (customer.exists) {\n  customer = {\n    ...customer,\n    name: $input.first().json.data[0].values.name[0].full_name,\n    email: $input.first().json.data[0].values.email_addresses[0].email_address,\n  }\n\n  if ($input.first().json.data[0].values.associated_deals.length > 0) {\n    customer = {\n      ...customer,\n      deal: {\n        exists: true,\n        details: $input.first().json.data[0].values.associated_deals[0]\n      }\n    }\n  }\n}\n\nreturn customer;"
      },
      "typeVersion": 2
    },
    {
      "id": "a5ff511b-3fa9-4ad3-bfb7-d30fdcde9250",
      "name": "Check if the customer is in the CRM",
      "type": "n8n-nodes-base.if",
      "position": [
        2000,
        368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "2e5c01e8-6cad-4f20-866b-303a1c102357",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.exists }}",
              "rightValue": 0
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "75c2705a-fcac-423a-8672-feab8f746e8a",
      "name": "Update the deal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2432,
        96
      ],
      "parameters": {
        "url": "=https://api.attio.com/v2/objects/deals/records/{{ $json.deal.details.target_record_id }}",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={\n  \"data\": {\n    \"values\": {\n        \"stage\": \"{{ $('Edit Fields').item.json.statuses.urgent.value }}\"\n    }\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "716adc16-bb05-432d-9a7d-daa7ee6f6280",
      "name": "Create a new deal",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2432,
        336
      ],
      "parameters": {
        "url": "https://api.attio.com/v2/objects/deals/records",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"data\": {\n    \"values\": {\n        \"name\": \"Deal for {{ $('Edit Fields').item.json.customer.name }}\",\n        \"stage\": \"{{ $('Edit Fields').item.json.statuses.pending.value }}\",\n        \"owner\": \"{{ $('Edit Fields').item.json.owner_email }}\",\n    \"associated_people\": [\n      {\n        \"target_object\": \"people\",\n        \"email_addresses\": [{ \"email_address\": \"{{ $('Edit Fields').item.json.customer.email }}\" }]\n      }\n    ]\n    }\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "63822a02-c29e-477e-a6e7-e38da9081613",
      "name": "Send slack message",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2624,
        208
      ],
      "parameters": {
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"text\": \"<!channel> Data has been {{ $('Prepare customer data').item.json.deal.exists ? \"updated\": \"created\" }} for this <{{ $json.data.web_url }}|deal>\"\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    },
    {
      "id": "f7b22128-bdc9-49c2-9971-129096648e79",
      "name": "Add the customer to the CRM",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2208,
        512
      ],
      "parameters": {
        "url": "https://api.attio.com/v2/objects/people/records",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"data\": {\n    \"values\": {\n        \"name\": \"{{ $('Edit Fields').item.json.customer.name }}\",\n        \"email_addresses\": [{ \"email_address\": \"{{ $('Edit Fields').item.json.customer.email }}\" }],\n        \"{{ $('Edit Fields').item.json.columns.message.slug }}\": \"{{ $('Edit Fields').item.json.customer.message }}\"\n    }\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "uKJuCeJVKdLmBykS",
          "name": "Attio Access Token"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "179b8917-24a8-487c-9bdf-b745f21d51fe",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        -912
      ],
      "parameters": {
        "width": 880,
        "height": 640,
        "content": "## Step 1\nMake sure that **Pending** and **Urgent** stages are correctly added to the **Deals**"
      },
      "typeVersion": 1
    },
    {
      "id": "a5aa04ae-42c0-4060-aae9-c53fa075fb00",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        -224
      ],
      "parameters": {
        "width": 864,
        "height": 464,
        "content": "## Step 2\nMake sure that **Message** attribute column is correctly added to the **People**"
      },
      "typeVersion": 1
    },
    {
      "id": "0638fa28-110a-4bc1-8a2a-08ea9267e658",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -96
      ],
      "parameters": {
        "width": 1328,
        "height": 800,
        "content": "## Step 3\n* Make sure that the **customer is added** if not in the CRM and **add a deal** for the customer\n* If the customer is already in the CRM and doesn't have a deal, **Create a deal for the customer**\n* If the customer is already in the CRM and does have a deal, Change the stage for that deal and make it in the **Urgent** stage\n* If any of the above happens, a **Slack message** will be sent, so **sales team for example** will be **notified**\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e30d3a87-d21c-481a-831f-f248f0477d78",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -912
      ],
      "parameters": {
        "color": 4,
        "width": 1328,
        "height": 800,
        "content": "## [Video: How to use the template](https://www.youtube.com/watch?v=FCGmVZsGYWk)\n@[youtube](FCGmVZsGYWk)"
      },
      "typeVersion": 1
    },
    {
      "id": "6b9d9817-ba3a-4973-8e5d-d41b54c9c77f",
      "name": "Receive form submissions",
      "type": "n8n-nodes-base.webhook",
      "position": [
        128,
        240
      ],
      "webhookId": "be4f4224-34e7-4534-a6d9-716f5808dc91",
      "parameters": {
        "path": "events",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "957bc517-d047-40da-b5bf-b5f29acb1b62",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -912
      ],
      "parameters": {
        "color": 2,
        "width": 768,
        "height": 1040,
        "content": "This workflow streamlines your lead management process by automatically capturing form submissions from **Jotform**, updating **Attio CRM**, and notifying your **team (sales team for example) via Slack** — all without manual work.\n\n## How it works\n### Receive Lead:\n- A new submission is captured from Jotform (name, email, message).\n\n### Prepare CRM:\n- Checks if the `Pending` and `Urgent` deal stages exist in Attio CRM and creates them if they don’t exist (refer to **Step 1**).\n- Checks if the `Message` column exists in Attio CRM and creates it if it doesn't exist (refer to **Step 2**).\n\n### Lead Handling (refer to Step 3):\n- If the lead **doesn't exist** in Attio CRM, the contact is created, a new deal is added to the `Pending` stage, and a Slack notification is sent.\n- If the lead **exists but has no deal**, a new deal is added to `Pending`, and Slack is notified.\n- If the **lead exists with a deal**, the deal is moved to the `Urgent` stage, and Slack is notified.\n\n### Slack Notification:\n- Your team (sales team for example) receives an instant Slack message whenever a new or existing lead is processed, so they can act fast (this is the last node in **Step 3** which has this title: `Send slack message`).\n\n## [Video: Demo video showing the whole workflow in action](https://www.youtube.com/watch?v=uccGQWvLhkA)\n@[youtube](uccGQWvLhkA)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e914c08f-39d7-433e-a24b-84add6bb8f5d",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Update the deal",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create a new deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "If pending status does not exist",
            "type": "main",
            "index": 0
          },
          {
            "node": "If urgent status does not exist",
            "type": "main",
            "index": 0
          },
          {
            "node": "If message column does not exist",
            "type": "main",
            "index": 0
          },
          {
            "node": "If deals id does not exist",
            "type": "main",
            "index": 0
          },
          {
            "node": "If people id does not exist",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get customer by email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update the deal": {
      "main": [
        [
          {
            "node": "Send slack message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the deals id": {
      "main": [
        [
          {
            "node": "Add pending status to CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a new deal": {
      "main": [
        [
          {
            "node": "Send slack message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the deals id1": {
      "main": [
        [
          {
            "node": "Add urgent status to CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the people id": {
      "main": [
        [
          {
            "node": "Add message column to CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get customer by email": {
      "main": [
        [
          {
            "node": "Prepare customer data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare customer data": {
      "main": [
        [
          {
            "node": "Check if the customer is in the CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the deals id (CRM)": {
      "main": [
        [
          {
            "node": "Add deals id to DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add urgent status to DB": {
      "main": [
        []
      ]
    },
    "Get the people id (CRM)": {
      "main": [
        [
          {
            "node": "Add people id to DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add message column to DB": {
      "main": [
        []
      ]
    },
    "Add pending status to DB": {
      "main": [
        []
      ]
    },
    "Add urgent status to CRM": {
      "main": [
        [
          {
            "node": "Add urgent status to DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive form submissions": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add message column to CRM": {
      "main": [
        [
          {
            "node": "Add message column to DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add pending status to CRM": {
      "main": [
        [
          {
            "node": "Add pending status to DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If deals id does not exist": {
      "main": [
        [
          {
            "node": "Get the deals id (CRM)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add the customer to the CRM": {
      "main": [
        [
          {
            "node": "Create a new deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If people id does not exist": {
      "main": [
        [
          {
            "node": "Get the people id (CRM)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If urgent status does not exist": {
      "main": [
        [
          {
            "node": "Get the deals id1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If message column does not exist": {
      "main": [
        [
          {
            "node": "Get the people id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If pending status does not exist": {
      "main": [
        [
          {
            "node": "Get the deals id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if the customer is in the CRM": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add the customer to the CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流