{
  "name": "Onboarding System Automation",
  "nodes": [
    {
      "parameters": {
        "formTitle": "Onboarding System",
        "formDescription": "Please fulfill all of the fields",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Name",
              "placeholder": "Enter Your Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Email",
              "placeholder": "Please Enter Your Email",
              "requiredField": true
            },
            {
              "fieldLabel": "Company Industry",
              "placeholder": "e.g. Finances, Health Care",
              "requiredField": true
            },
            {
              "fieldLabel": "What do you want to achieve with us in 5 months",
              "requiredField": true
            }
          ]
        },
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        0,
        0
      ],
      "id": "99698bcb-ffb9-4a71-a88f-d2b50b4e5b20",
      "name": "On form submission"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Can you generate a warm and professional welcome email for a new client based on the information provided? The message should be friendly, brief, and personalized\u2014while still sounding professional. It should reflect the client\u2019s industry and their goals for our collaboration. Below is the client\u2019s information:\n\nName: {{ $json.Name }}\n\nEmail: {{ $json.Email }}\n\nCompany Industry: {{ $json['Company Industry'] }}\n\nGoals for the Partnership: {{ $json['What do you want to achieve with us in 5 months'] }}\n\nMake sure to always end the email with the following sign-off:\n\nBest regards,\nBob Bob\nVP of Internal Relations\nABC Corp\n\nDo not use placeholders like [Your Name] or [Your Contact Information] under any circumstances, even if some information is missing.\n\nReturn the result in 3 separate fields:\n\nSubject: The email\u2019s subject line\n\nBody: The main email content\n\nEmail: {{ $json.Email }}",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        460,
        -220
      ],
      "id": "1423db18-2a1f-4878-9788-70f79428a148",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        500,
        -60
      ],
      "id": "e825406b-07f9-4fc8-93bf-754b96353433",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "GPT-4O"
        },
        "messages": {
          "values": [
            {
              "content": "Parse the JSON query and output the parameters seperately:\n\nSubject\nBody\nEmail",
              "role": "system"
            },
            {
              "content": "={{ $json.output }}"
            }
          ]
        },
        "jsonOutput": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        800,
        -220
      ],
      "id": "755f0249-ac4b-4fec-8742-0a9f72f022dd",
      "name": "OpenAI",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $json.message.content.Email }}",
        "subject": "={{ $json.message.content.Subject }}",
        "message": "={{ $json.message.content.Body }}",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        1160,
        -220
      ],
      "id": "6c0a2099-9d73-4a32-afc3-23ce58ab2ad6",
      "name": "Gmail",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Use the client details below to generate a clear summary of their profile. Here is the information provided:\n\nName: {{ $json.Name }}\n\nCompany Industry: {{ $json['Company Industry'] }}\n\nGoals with Us: {{ $json['What do you want to achieve with us in 5 months'] }}\n\nReturn the following fields separately:\n\nName: {{ $json.Name }}\n\nEmail: {{ $json.Email }}\n\nSummary: A concise overview of the client based on the information provided above\n",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        340,
        160
      ],
      "id": "f0c47110-4dc8-407a-bd71-195c874a9237",
      "name": "AI Agent1"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        280,
        340
      ],
      "id": "3be8c187-396c-4f18-b673-53efeeca0c2b",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "GPT-4O"
        },
        "messages": {
          "values": [
            {
              "content": "Parse the JSON query into 3 fields\n\nName\nEmail\nSummary",
              "role": "system"
            },
            {
              "content": "={{ $json.output }}"
            }
          ]
        },
        "jsonOutput": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        760,
        160
      ],
      "id": "92ff8476-3f8d-4546-851f-5efc4ccba390",
      "name": "OpenAI1",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1Y28XTc7qLq0sOJZrARmBZBpVk7EbklDmm3QoAkjO1z4",
          "mode": "list",
          "cachedResultName": "Client's Onboarding",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Y28XTc7qLq0sOJZrARmBZBpVk7EbklDmm3QoAkjO1z4/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Y28XTc7qLq0sOJZrARmBZBpVk7EbklDmm3QoAkjO1z4/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Name": "={{ $json.message.content.Name }}",
            "Email": "={{ $json.message.content.Email }}",
            "Summary": "={{ $json.message.content.Summary }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Name",
              "displayName": "Name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "displayName": "Summary",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1120,
        160
      ],
      "id": "63024054-0dfd-479a-ab56-aa1a58697c5d",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2cb2480e-e8a1-4de3-9eba-8e8e04026e46",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "1EAu1pNCliAAHhyG",
  "tags": []
}