{
  "name": "Track contract signatures and onboard clients with Airtable, Groq, Gmail, Trello and Slack",
  "nodes": [
    {
      "id": "1cd7897b-52d2-4c2e-a430-561b06fd839e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 480,
        "height": 912,
        "content": "## Track contract e-signatures, generate onboarding checklists, and catch stalled deals\n\n### How it works\n\nThis workflow tracks contract e-signature events from a webhook, validates the request, and updates Airtable records when contracts are completed. It uses an LLM to generate an onboarding checklist, then sends follow-up emails, Trello tasks, and Slack notifications, including escalation for high-value contracts. A separate scheduled branch runs daily to find contracts that have stalled and alerts sales in Slack.\n\n### Setup steps\n\n- Configure the contract-signing webhook URL in the e-signature platform and set the matching shared secret token in the configuration node.\n- Connect Airtable credentials and set the correct base ID, table name, and field mappings for contract lookup, status logging, and CRM updates.\n- Configure the Groq chat model credentials and verify the structured checklist parser matches the expected onboarding checklist format.\n- Connect Gmail, Trello, and Slack credentials, then set the destination email settings, Trello list ID, and Slack channel/user targets.\n- Set the daily schedule and stale-days threshold for the stalled contract monitoring branch.\n\n### Customization\n\nAdjust the high-value contract condition, onboarding checklist prompt/output schema, stale contract threshold, and notification destinations to match your sales and onboarding process."
      },
      "typeVersion": 1
    },
    {
      "id": "c200a153-016f-456d-bd87-b2bf5a00b895",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 384,
        "content": "## Webhook validation intake\n\nReceives contract signature webhook events, loads shared configuration, verifies the shared secret, and gates invalid requests before any CRM changes occur."
      },
      "typeVersion": 1
    },
    {
      "id": "7976890c-1955-427a-8e2f-e447e5f6e5f1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 704,
        "height": 688,
        "content": "## Contract status handling\n\nChecks whether the incoming contract event represents a completed signature, then either finds and updates the matching Airtable CRM record or logs a non-completion status update."
      },
      "typeVersion": 1
    },
    {
      "id": "d72cc194-88e7-4480-80ef-dbbaa27dcdfe",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2272,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 448,
        "height": 576,
        "content": "## Generate onboarding checklist\n\nUses an LLM chain, chat model, and structured output parser to create a checklist tailored to the newly signed contract."
      },
      "typeVersion": 1
    },
    {
      "id": "263c7a42-1081-43db-93fb-2ed105e13735",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2752,
        0
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 432,
        "content": "## High-value escalation\n\nEvaluates whether the signed contract is high value and notifies a senior manager in Slack when escalation is needed."
      },
      "typeVersion": 1
    },
    {
      "id": "439dfd85-39fb-45cf-82d1-795ce6a66567",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2896,
        464
      ],
      "parameters": {
        "color": 7,
        "width": 608,
        "height": 816,
        "content": "## Onboarding follow-ups\n\nDelivers the generated onboarding checklist through customer email, creates an onboarding task in Trello, and notifies the sales team in Slack."
      },
      "typeVersion": 1
    },
    {
      "id": "a08b55dc-1677-4eb3-973e-c966dd4e1f09",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        1136
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 352,
        "content": "## Stale check setup\n\nStarts the daily stalled-contract monitoring branch and loads its Airtable, Slack, and threshold configuration."
      },
      "typeVersion": 1
    },
    {
      "id": "becd57b0-e861-498d-b67e-00f0c9aac893",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        1104
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 384,
        "content": "## Find stale contracts\n\nQueries Airtable for potentially stale contracts and applies custom filtering logic to keep only deals that are truly overdue."
      },
      "typeVersion": 1
    },
    {
      "id": "333e8c33-ea4e-49b7-8fe9-d52106786957",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        1104
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 384,
        "content": "## Alert cold deals\n\nSends the final Slack alert to sales for contracts that appear to be going cold."
      },
      "typeVersion": 1
    },
    {
      "id": "423f7a36-34cc-4791-b4d0-edf26763fa19",
      "name": "When Contract Signed",
      "type": "n8n-nodes-base.webhook",
      "position": [
        608,
        368
      ],
      "parameters": {
        "path": "contract-webhook",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "1173d67b-fa8d-41ee-9849-2bbd17844828",
      "name": "Set Initial Configurations",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-1",
              "name": "shared_secret_token",
              "type": "string",
              "value": "REPLACE_WITH_SHARED_SECRET"
            },
            {
              "id": "cfg-2",
              "name": "airtable_base_id",
              "type": "string",
              "value": "REPLACE_WITH_AIRTABLE_BASE_ID"
            },
            {
              "id": "cfg-3",
              "name": "airtable_table_name",
              "type": "string",
              "value": "Contracts"
            },
            {
              "id": "cfg-4",
              "name": "trello_list_id",
              "type": "string",
              "value": "REPLACE_WITH_TRELLO_LIST_ID"
            },
            {
              "id": "cfg-5",
              "name": "slack_channel_id",
              "type": "string",
              "value": "REPLACE_WITH_SLACK_CHANNEL_ID"
            },
            {
              "id": "cfg-6",
              "name": "manager_slack_channel_id",
              "type": "string",
              "value": "REPLACE_WITH_MANAGER_SLACK_CHANNEL_ID"
            },
            {
              "id": "cfg-7",
              "name": "high_value_threshold",
              "type": "number",
              "value": 100000
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "95990aec-a026-4a52-880a-a17a731111d7",
      "name": "Verify Webhook Shared Secret",
      "type": "n8n-nodes-base.code",
      "position": [
        1072,
        368
      ],
      "parameters": {
        "jsCode": "const webhookData = $('When Contract Signed').first().json;\nconst config = $('Set Initial Configurations').first().json;\n\nconst receivedToken = webhookData.headers['x-webhook-secret'] || webhookData.query.token;\nconst isValid = receivedToken === config.shared_secret_token;\n\nconst event = Array.isArray(webhookData.body) ? webhookData.body[0] : webhookData.body;\nconst data = event && event.data ? event.data : {};\nconst recipient = (data.recipients && data.recipients[0]) || {};\n\nreturn [{\n  json: {\n    is_valid: isValid,\n    document_id: data.id || '',\n    contract_status: data.status || '',\n    client_name: recipient.first_name || '',\n    client_email: recipient.email || '',\n    contract_amount: Number(data.pricing && data.pricing.total ? data.pricing.total : 0),\n    service_details: data.name || ''\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "d17d6ff3-b282-4a5f-84c7-aa43e1665f22",
      "name": "Check Request Validity",
      "type": "n8n-nodes-base.if",
      "position": [
        1280,
        368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3e370c72-cab6-4793-bf78-ae491764b54b",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.is_valid }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "30773107-ef77-412e-bee1-0d69f3d426b4",
      "name": "Check Contract Completion",
      "type": "n8n-nodes-base.if",
      "position": [
        1584,
        384
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.contract_status }}",
              "rightValue": "document.completed"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "b243271c-e4c7-4fff-bf98-e00bdfbae4b7",
      "name": "Log Airtable Status Update",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1920,
        592
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.airtable_base_id }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.airtable_table_name }}"
        },
        "columns": {
          "value": {
            "status": "={{ $json.contract_status }}",
            "document_id": "={{ $json.document_id }}",
            "last_status_update": "={{ $now.toISO() }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "document_id"
          ]
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.2
    },
    {
      "id": "803aa1ce-8404-440e-bac1-d86a2e02be23",
      "name": "Find Contract in Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1904,
        304
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.airtable_base_id }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.airtable_table_name }}"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "={{ \"{document_id} = '\" + $json.document_id + \"'\" }}"
      },
      "typeVersion": 2.2
    },
    {
      "id": "fd266314-f73a-47ea-958c-8a46009831a8",
      "name": "Onboarding Checklist Generator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2400,
        304
      ],
      "parameters": {
        "text": "=A contract was just signed. Based on the service details below, write a specific onboarding checklist (4-6 concrete steps, not generic filler) and a short one-sentence summary of the engagement.\n\nService details: {{ $('Verify Webhook Shared Secret').item.json.service_details }}\nContract amount: \u20b9{{ $('Verify Webhook Shared Secret').item.json.contract_amount }}",
        "batching": {},
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "d7dbb1a4-3cef-40c4-bb46-88364c630ede",
      "name": "AI Checklist Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "position": [
        2400,
        512
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "e0c54b3e-495f-4c96-975c-efa1fb3d5cc8",
      "name": "Parse Checklist Data",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2592,
        512
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"checklist_items\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"engagement_summary\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"checklist_items\",\n    \"engagement_summary\"\n  ]\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "e8a48f72-4195-484f-a0e2-349d521ce871",
      "name": "Check High-Value Contract",
      "type": "n8n-nodes-base.if",
      "position": [
        2800,
        240
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "c8a15ef7-1ac4-4cc8-97a0-f7bee2ef57a9",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $('Verify Webhook Shared Secret').item.json.contract_amount }}",
              "rightValue": "={{ $('Set Initial Configurations').item.json.high_value_threshold }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "49dbdb87-ae00-46c5-b08b-d54cb9c69cd8",
      "name": "Notify Manager via Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        3072,
        160
      ],
      "parameters": {
        "text": "=High-value contract signed: {{ $('Verify Webhook Shared Secret').item.json.client_name }}, \u20b9{{ $('Verify Webhook Shared Secret').item.json.contract_amount }}. {{ $json.output.engagement_summary }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.manager_slack_channel_id }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "728e6f2e-47e0-4102-9fe5-fd5f6a2e8565",
      "name": "Dispatch Onboarding Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3056,
        672
      ],
      "parameters": {
        "sendTo": "={{ $('Verify Webhook Shared Secret').item.json.client_email }}",
        "message": "=Hi {{ $('Verify Webhook Shared Secret').item.json.client_name }},\n\n{{ $json.output.engagement_summary }}\n\nHere's what happens next:\n{{ $json.output.checklist_items.map((item, i) => (i+1) + '. ' + item).join('\\n') }}\n\nSomeone from our team will be in touch shortly.",
        "options": {},
        "subject": "Welcome aboard!"
      },
      "typeVersion": 2.2
    },
    {
      "id": "8bf61211-5db8-4199-af05-7155c7484155",
      "name": "Add Task to Trello",
      "type": "n8n-nodes-base.trello",
      "position": [
        3152,
        880
      ],
      "parameters": {
        "name": "=Onboard {{ $('Verify Webhook Shared Secret').item.json.client_name }}",
        "listId": "={{ $('Set Initial Configurations').item.json.trello_list_id }}",
        "description": "={{ $json.output.engagement_summary }}\n\nChecklist:\n{{ $json.output.checklist_items.map((item, i) => (i+1) + '. ' + item).join('\\n') }}",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "a9e4c386-e024-4ccb-acc0-5b208eed5c6f",
      "name": "Inform Sales Team",
      "type": "n8n-nodes-base.slack",
      "position": [
        3040,
        1088
      ],
      "parameters": {
        "text": "=Contract signed: {{ $('Verify Webhook Shared Secret').item.json.client_name }} ({{ $('Verify Webhook Shared Secret').item.json.client_email }}). {{ $json.output.engagement_summary }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.slack_channel_id }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "1e5bc283-b991-43d8-a327-02973437e859",
      "name": "Daily 9am Stale Contract Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        608,
        1296
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "32be6121-824c-4258-a591-4b3db8297800",
      "name": "Set Stale Contract Configs",
      "type": "n8n-nodes-base.set",
      "position": [
        848,
        1296
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfgB-1",
              "name": "airtable_base_id",
              "type": "string",
              "value": "REPLACE_WITH_AIRTABLE_BASE_ID"
            },
            {
              "id": "cfgB-2",
              "name": "airtable_table_name",
              "type": "string",
              "value": "Contracts"
            },
            {
              "id": "cfgB-3",
              "name": "slack_channel_id",
              "type": "string",
              "value": "REPLACE_WITH_SLACK_CHANNEL_ID"
            },
            {
              "id": "cfgB-4",
              "name": "stale_days_threshold",
              "type": "number",
              "value": 5
            },
            {
              "id": "cfgB-5",
              "name": "cutoff_date",
              "type": "string",
              "value": "={{ $now.minus({ days: 5 }).toISO() }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5a433b2a-3d49-4d81-962f-0386cec11209",
      "name": "Retrieve Stale Contracts",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1088,
        1296
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Stale Contract Configs').item.json.airtable_base_id }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Stale Contract Configs').item.json.airtable_table_name }}"
        },
        "options": {},
        "operation": "search",
        "filterByFormula": "=OR({status} = 'document.sent', {status} = 'document.viewed')"
      },
      "typeVersion": 2.2
    },
    {
      "id": "a34dccde-0538-4a38-adcf-ff2e1bb994d3",
      "name": "Identify Truly Stale Contracts",
      "type": "n8n-nodes-base.code",
      "position": [
        1328,
        1296
      ],
      "parameters": {
        "jsCode": "const cutoff = new Date($('Set Stale Contract Configs').first().json.cutoff_date);\n\nreturn $input.all().filter(item => {\n  const lastUpdate = new Date(item.json.last_status_update);\n  return lastUpdate < cutoff;\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "0e448fe3-698e-4597-89b2-5a1255aae94a",
      "name": "Alert Cold Contract to Sales",
      "type": "n8n-nodes-base.slack",
      "position": [
        1568,
        1296
      ],
      "parameters": {
        "text": "={{ $json.client_name }}'s contract has been stuck at \"{{ $json.status }}\" for over {{ $('Set Stale Contract Configs').item.json.stale_days_threshold }} days. Might be worth a follow-up call.",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Stale Contract Configs').item.json.slack_channel_id }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "a332cda5-4224-41e1-ae3e-40a3ecc9788d",
      "name": "Update CRM Status to Signed",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2096,
        304
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.airtable_base_id }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Set Initial Configurations').item.json.airtable_table_name }}"
        },
        "columns": {
          "value": {
            "id": "={{ $json.id }}",
            "status": "signed",
            "signed_date": "={{ $now.toISO() }}"
          },
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ]
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.2
    }
  ],
  "connections": {
    "Parse Checklist Data": {
      "ai_outputParser": [
        [
          {
            "node": "Onboarding Checklist Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When Contract Signed": {
      "main": [
        [
          {
            "node": "Set Initial Configurations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Request Validity": {
      "main": [
        [
          {
            "node": "Check Contract Completion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Checklist Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Onboarding Checklist Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Stale Contracts": {
      "main": [
        [
          {
            "node": "Identify Truly Stale Contracts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Contract Completion": {
      "main": [
        [
          {
            "node": "Find Contract in Airtable",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Airtable Status Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check High-Value Contract": {
      "main": [
        [
          {
            "node": "Notify Manager via Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Contract in Airtable": {
      "main": [
        [
          {
            "node": "Update CRM Status to Signed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Initial Configurations": {
      "main": [
        [
          {
            "node": "Verify Webhook Shared Secret",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Stale Contract Configs": {
      "main": [
        [
          {
            "node": "Retrieve Stale Contracts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CRM Status to Signed": {
      "main": [
        [
          {
            "node": "Onboarding Checklist Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Webhook Shared Secret": {
      "main": [
        [
          {
            "node": "Check Request Validity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily 9am Stale Contract Check": {
      "main": [
        [
          {
            "node": "Set Stale Contract Configs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Identify Truly Stale Contracts": {
      "main": [
        [
          {
            "node": "Alert Cold Contract to Sales",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Onboarding Checklist Generator": {
      "main": [
        [
          {
            "node": "Check High-Value Contract",
            "type": "main",
            "index": 0
          },
          {
            "node": "Dispatch Onboarding Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add Task to Trello",
            "type": "main",
            "index": 0
          },
          {
            "node": "Inform Sales Team",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "instanceId": null
  },
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  }
}