{
  "name": "Sales Follow-ups",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 15
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "id": "b7568d40-698f-411e-9d91-acedb49dd300",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1LafqvCqoOJSHJRGtsCfedmgK8HEQShLqM5Nvqm3JSQo",
          "mode": "list",
          "cachedResultName": "Sales Follow-ups",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LafqvCqoOJSHJRGtsCfedmgK8HEQShLqM5Nvqm3JSQo/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LafqvCqoOJSHJRGtsCfedmgK8HEQShLqM5Nvqm3JSQo/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        224,
        0
      ],
      "id": "4c1ff352-34e5-45ee-854b-212fca09599e",
      "name": "Get row(s) in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const today = new Date();\ntoday.setHours(0, 0, 0, 0);\n\nreturn items.map(item => {\n  const data = item.json;\n  let followUpStatus = 'missing_date';\n\n  if (data.status === 'completed') {\n    followUpStatus = 'completed';\n  } \n  else if (data.follow_up_date) {\n    const followUpDate = new Date(data.follow_up_date);\n    followUpDate.setHours(0, 0, 0, 0);\n\n    const difference = Math.round(\n      (followUpDate.getTime() - today.getTime()) / 86400000\n    );\n\n    if (difference < 0) {\n      followUpStatus = 'overdue';\n    } \n    else if (difference === 0) {\n      followUpStatus = 'due_today';\n    } \n    else {\n      followUpStatus = 'upcoming';\n    }\n  }\n\n  return {\n    json: {\n      ...data,\n      follow_up_status: followUpStatus\n    }\n  };\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        448,
        0
      ],
      "id": "29af96d4-8e1b-40c6-92d6-1bf83e8b194e",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.follow_up_status }}",
                    "rightValue": "upcoming",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "a46434b7-63c7-4ec7-86f9-f29d39d9597f"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "upcoming"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "576573ca-cf7e-4d52-931c-03b1c9fe7855",
                    "leftValue": "={{ $json.follow_up_status }}",
                    "rightValue": "due_today",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "due_today"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "16b785ba-11de-40a3-b937-cb5d6813b2ce",
                    "leftValue": "={{ $json.follow_up_status }}",
                    "rightValue": "overdue",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "overdue"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "fd3a926d-a423-497d-beac-fda98a92b9f5",
                    "leftValue": "={{ $json.follow_up_status }}",
                    "rightValue": "completed",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "completed"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "a3e27226-969a-4c8b-aa4f-c0c38d2c942e",
                    "leftValue": "={{ $json.follow_up_status }}",
                    "rightValue": "missing_date",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "missing_date"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.4,
      "position": [
        672,
        -48
      ],
      "id": "b97ad048-e28f-48c5-af20-cee157fcfe85",
      "name": "Switch"
    },
    {
      "parameters": {
        "sendTo": "={{ $json.sales_rep_email }}",
        "subject": "=Upcoming Sales Follow-up - {{ $json.client_name }}",
        "emailType": "text",
        "message": "=Hi {{ $json.sales_rep }},  This is a reminder that a sales follow-up is coming up.  Client: {{ $json.client_name }} Contact Person: {{ $json.contact_person }} Follow-up Date: {{ $json.follow_up_date }} Priority: {{ $json.priority }}  Notes: {{ $json.notes }}  Please make sure to follow up with the client on time.  Regards, Sales Follow-up Automation",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        944,
        -304
      ],
      "id": "705874ed-0f3e-4c7f-9df0-14af2311f743",
      "name": "Send a message",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.sales_rep_email }}",
        "subject": "=Follow-up Due Today - {{ $json.client_name }}",
        "emailType": "text",
        "message": "=Hi {{ $json.sales_rep }},\n\nThis is a reminder that a sales follow-up is due today.\n\nClient: {{ $json.client_name }}\nContact Person: {{ $json.contact_person }}\nFollow-up Date: {{ $json.follow_up_date }}\nPriority: {{ $json.priority }}\n\nNotes:\n{{ $json.notes }}\n\nPlease contact the client today and complete the follow-up.\n\nRegards,\nSales Follow-up Automation",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        944,
        -160
      ],
      "id": "73bf30c1-5206-40f7-8812-8f5a2e24f5bb",
      "name": "Send a message1",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.sales_rep_email }}",
        "subject": "=URGENT - Overdue Follow-up - {{ $json.client_name }}",
        "emailType": "text",
        "message": "=Hi {{ $json.sales_rep }},\n\nAn important sales follow-up is overdue and requires your attention.\n\nClient: {{ $json.client_name }}\nContact Person: {{ $json.contact_person }}\nFollow-up Date: {{ $json.follow_up_date }}\nPriority: {{ $json.priority }}\n\nNotes:\n{{ $json.notes }}\n\nPlease follow up with the client as soon as possible.\n\nRegards,\nSales Follow-up Automation",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        944,
        0
      ],
      "id": "b267f60a-dd34-4c73-a769-0a4db11638e0",
      "name": "Send a message2",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.sales_rep_email }}",
        "subject": "=Action Required - Missing Follow-up Date - {{ $json.client_name }}",
        "emailType": "text",
        "message": "=Hi {{ $json.sales_rep }},  The following client does not have a follow-up date assigned.  Client: {{ $json.client_name }} Contact Person: {{ $json.contact_person }} Priority: {{ $json.priority }}  Notes: {{ $json.notes }}  Please update the follow-up date so that future reminders can be sent automatically.  Regards, Sales Follow-up Automation",
        "options": {}
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        944,
        272
      ],
      "id": "40f02864-58a8-41dd-ace8-d6e40ebd0dfd",
      "name": "Send a message3",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM",
          "mode": "list",
          "cachedResultName": "Follow-up Logs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "log_id": "={{ $('Switch').item.json.id }}",
            "client_name": "={{ $('Switch').item.json.client_name }}",
            "sales_rep": "={{ $('Switch').item.json.sales_rep }}",
            "follow_up_status": "={{ $('Switch').item.json.follow_up_status }}",
            "priority": "={{ $('Switch').item.json.priority }}",
            "action_taken": "Reminder email sent",
            "timestamp": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "log_id",
              "displayName": "log_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client_name",
              "displayName": "client_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sales_rep",
              "displayName": "sales_rep",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow_up_status",
              "displayName": "follow_up_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "priority",
              "displayName": "priority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action_taken",
              "displayName": "action_taken",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1136,
        -304
      ],
      "id": "c8c72b93-998c-4183-9075-890d5d4a40ad",
      "name": "Append row in sheet",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "workspace": "1217179342419980",
        "name": "=Follow up with {{ $('Switch').item.json.client_name }}- {{ $('Switch').item.json.contact_person }}",
        "otherProperties": {
          "due_on": "={{ $('Switch').item.json.follow_up_date }}",
          "notes": "=Sales follow-up due today.\n\nClient: {{ $('Switch').item.json.client_name }}\nContact: {{ $('Switch').item.json.contact_person }}\nEmail: {{ $('Switch').item.json.email }}\nSales Representative: {{ $('Switch').item.json.sales_rep }}\nPriority: {{ $('Switch').item.json.priority }}\n\nNotes:\n{{ $('Switch').item.json.notes }}",
          "projects": [
            "1217570188021962"
          ]
        }
      },
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        1136,
        -160
      ],
      "id": "2166b12f-9dce-4c18-9b8b-28e121ab4f55",
      "name": "Create a task",
      "credentials": {
        "asanaOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM",
          "mode": "list",
          "cachedResultName": "Follow-up Logs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "action_taken": "Email reminder + task created",
            "log_id": "={{ $('Switch').item.json.id }}",
            "client_name": "={{ $('Switch').item.json.client_name }}",
            "sales_rep": "={{ $('Switch').item.json.sales_rep }}",
            "follow_up_status": "={{ $('Switch').item.json.follow_up_status }}",
            "priority": "={{ $('Switch').item.json.priority }}",
            "timestamp": "={{ $now }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "log_id",
              "displayName": "log_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client_name",
              "displayName": "client_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sales_rep",
              "displayName": "sales_rep",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow_up_status",
              "displayName": "follow_up_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "priority",
              "displayName": "priority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action_taken",
              "displayName": "action_taken",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1568,
        -160
      ],
      "id": "51610f4d-de81-4254-9001-826e06e3c0c8",
      "name": "Append row in sheet1",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "workspace": "1217179342419980",
        "name": "=URGENT: Follow up with {{ $('Switch').item.json.client_name }}",
        "otherProperties": {
          "due_on": "={{ $now.format('yyyy-MM-dd') }}",
          "notes": "=This sales follow-up is overdue.\n\nClient: {{ $('Switch').item.json.client_name }}\nContact Person: {{ $('Switch').item.json.contact_person }}\nEmail: {{ $('Switch').item.json.email }}\nSales Representative: {{ $('Switch').item.json.sales_rep }}\nOriginal Follow-up Date: {{ $('Switch').item.json.follow_up_date }}\nPriority: {{ $('Switch').item.json.priority }}\n\nNotes:\n{{ $('Switch').item.json.notes }}\n\nAction required: Contact the client and update the follow-up.",
          "projects": [
            "1217570188021962"
          ]
        }
      },
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        1136,
        0
      ],
      "id": "28360d09-04a5-494a-98b7-ed1fca74c85a",
      "name": "Create a task1",
      "credentials": {
        "asanaOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "move",
        "id": "={{ $json.gid }}",
        "projectId": "1217570188021962",
        "section": "1217570188021965"
      },
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        1312,
        0
      ],
      "id": "b53c0918-f980-40e6-96e7-8c7ef2953590",
      "name": "Move a task",
      "credentials": {
        "asanaOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM",
          "mode": "list",
          "cachedResultName": "Follow-up Logs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "log_id": "={{ $('Switch').item.json.id }}",
            "client_name": "={{ $('Switch').item.json.client_name }}",
            "sales_rep": "={{ $('Switch').item.json.sales_rep }}",
            "follow_up_status": "={{ $('Switch').item.json.follow_up_status }}",
            "priority": "={{ $('Switch').item.json.priority }}",
            "timestamp": "={{ $now }}",
            "action_taken": "Urgent email + urgent task created"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "log_id",
              "displayName": "log_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client_name",
              "displayName": "client_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sales_rep",
              "displayName": "sales_rep",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow_up_status",
              "displayName": "follow_up_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "priority",
              "displayName": "priority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action_taken",
              "displayName": "action_taken",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1488,
        0
      ],
      "id": "0864672c-bded-4478-9d1d-9b67a0b7f0e4",
      "name": "Append row in sheet2",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM",
          "mode": "list",
          "cachedResultName": "Follow-up Logs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "action_taken": " Follow-up already completed",
            "timestamp": "={{ $now }}",
            "priority": "={{ $json.priority }}",
            "follow_up_status": "={{ $json.follow_up_status }}",
            "sales_rep": "={{ $json.sales_rep }}",
            "client_name": "={{ $json.client_name }}",
            "log_id": "={{ $json.id }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "log_id",
              "displayName": "log_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client_name",
              "displayName": "client_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sales_rep",
              "displayName": "sales_rep",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow_up_status",
              "displayName": "follow_up_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "priority",
              "displayName": "priority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action_taken",
              "displayName": "action_taken",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        944,
        144
      ],
      "id": "78d005c9-1cd2-41dc-912e-4022fb480447",
      "name": "Append row in sheet3",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM",
          "mode": "list",
          "cachedResultName": "Follow-up Logs",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1K6P9rjJo4q-o16IjRB1hXFzGdUGK4rpLNymVpl8zCCM/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "log_id": "={{ $('Switch').item.json.id }}",
            "client_name": "={{ $('Switch').item.json.client_name }}",
            "sales_rep": "={{ $('Switch').item.json.sales_rep }}",
            "follow_up_status": "={{ $('Switch').item.json.follow_up_status }}",
            "priority": "={{ $('Switch').item.json.priority }}",
            "timestamp": "={{ $now }}",
            "action_taken": "Missing follow-up date alert sent"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "log_id",
              "displayName": "log_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "client_name",
              "displayName": "client_name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "sales_rep",
              "displayName": "sales_rep",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "follow_up_status",
              "displayName": "follow_up_status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "priority",
              "displayName": "priority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action_taken",
              "displayName": "action_taken",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "timestamp",
              "displayName": "timestamp",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1168,
        272
      ],
      "id": "e3b48e5d-eba8-4d86-89c3-df262aa8f202",
      "name": "Append row in sheet4",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "move",
        "id": "={{ $json.gid }}",
        "projectId": "1217570188021962",
        "section": "1217570188021966"
      },
      "type": "n8n-nodes-base.asana",
      "typeVersion": 1,
      "position": [
        1360,
        -160
      ],
      "id": "8c365fbc-2d80-49c5-9885-99aa41aa0fc7",
      "name": "Move a task1",
      "credentials": {
        "asanaOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append row in sheet3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message1": {
      "main": [
        [
          {
            "node": "Create a task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a task": {
      "main": [
        [
          {
            "node": "Move a task1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message2": {
      "main": [
        [
          {
            "node": "Create a task1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a task1": {
      "main": [
        [
          {
            "node": "Move a task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move a task": {
      "main": [
        [
          {
            "node": "Append row in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message3": {
      "main": [
        [
          {
            "node": "Append row in sheet4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move a task1": {
      "main": [
        [
          {
            "node": "Append row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false,
    "timeSavedMode": "fixed",
    "errorWorkflow": "0yQmD6xugHHNFgZq",
    "callerPolicy": "workflowsFromSameOwner"
  },
  "versionId": "cadb17ce-60cc-43e6-8a1f-622e38cfef7d",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodeGroups": [],
  "id": "kwW6Bjtt0xYCH1fD",
  "tags": []
}