{
  "name": "Repairing Service booking",
  "nodes": [
    {
      "parameters": {
        "modelId": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": "",
          "cachedResultUrl": ""
        },
        "messages": {
          "values": [
            {
              "content": "=You are an AI assistant for VexFab.\n\nYour task is to write a professional email for the VexFab service team whenever a new service request is received.\n\nYou will receive booking details from Airtable.\n\nWrite a clear and well-structured email using the information provided.\n\nInclude the following details if available:\n- Customer Name:{{ $json.fields['Customer Name'] }}\n- Email:{{ $json.fields.Email }}\n- Phone Number:{{ $json.fields['Phone Number'] }}\n- Service Type:{{ $json.fields['Service Type'] }}\n- Preferred Date:{{ $json.fields['Preferred Date'] }}\n- Preferred Time:{{ $json.fields['Preferred Time'] }}\n- Address:{{ $json.fields.Address }}\n- Additional Notes:{{ $json.fields['Additional Notes'] }}\n\nRequirements:\n- Write a professional subject line.\n- Start with a friendly greeting.\n- Present the booking details in a clean, easy-to-read format.\n- End the email by asking the team to review the request and assign a technician.\n- Do not invent or assume any missing information.\n- If a field is empty, simply omit it.\n- Return only the email subject and email body.\n- Do not use Markdown."
            }
          ]
        },
        "jsonOutput": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [
        112,
        160
      ],
      "id": "2357110d-3b5c-433c-854d-d610bf9112c8",
      "name": "Message a model"
    },
    {
      "parameters": {
        "subject": "={{ $json.message.content.subject }}",
        "emailType": "text",
        "message": "={{ $json.message.content.body }}",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        448,
        160
      ],
      "id": "54dbc7a1-f0fa-4c85-a3fa-937422e13f94",
      "name": "Send a message",
      "webhookId": "eb125598-e414-40a2-abcc-d1dec4a49a39"
    },
    {
      "parameters": {
        "formTitle": "Book a Home Service",
        "formDescription": "Need a home service? Fill out the form below and our VexFab team will contact you shortly to confirm your booking.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Customer Name",
              "placeholder": "Enter your full name",
              "requiredField": true
            },
            {
              "fieldLabel": "Email",
              "fieldType": "email",
              "placeholder": "Enter your email address",
              "requiredField": true
            },
            {
              "fieldLabel": "Phone Number",
              "fieldType": "number",
              "placeholder": "Enter your phone number",
              "requiredField": true
            },
            {
              "fieldLabel": "Service Type",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "AC Repair"
                  },
                  {
                    "option": "AC Installation"
                  },
                  {
                    "option": "Plumbing"
                  },
                  {
                    "option": "Electrical Repair"
                  },
                  {
                    "option": "Home Cleaning"
                  },
                  {
                    "option": "Painting"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Preferred Date",
              "fieldType": "date",
              "requiredField": true
            },
            {
              "fieldLabel": "Preferred Time",
              "fieldType": "dropdown",
              "fieldOptions": {
                "values": [
                  {
                    "option": "09:00 AM"
                  },
                  {
                    "option": "11:00 AM"
                  },
                  {
                    "option": "01:00 PM"
                  },
                  {
                    "option": "03:00 PM"
                  },
                  {
                    "option": "05:00 PM"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldLabel": "Address",
              "placeholder": "Enter your full address",
              "requiredField": true
            },
            {
              "fieldLabel": "Additional Notes",
              "placeholder": "Describe your issue or add any special instructions.",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -208,
        -16
      ],
      "id": "5f9e3414-f54e-4c10-be24-a27a85cfec30",
      "name": "On form submission",
      "webhookId": "76dbeaef-d3e2-464f-8b82-b795571a3e22"
    },
    {
      "parameters": {
        "operation": "create",
        "base": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": "",
          "cachedResultUrl": ""
        },
        "table": {
          "__rl": true,
          "value": "",
          "mode": "list",
          "cachedResultName": "",
          "cachedResultUrl": ""
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "Pending",
            "Additional Notes": "={{ $json['Additional Notes'] }}",
            "Address": "={{ $json.Address }}",
            "Preferred Time": "={{ $json['Preferred Time'] }}",
            "Preferred Date": "={{ $json['Preferred Date'] }}",
            "Service Type": "={{ $json['Service Type'] }}",
            "Phone Number": "={{ $json['Phone Number'] }}",
            "Email": "={{ $json.Email }}",
            "Customer Name": "={{ $json['Customer Name'] }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "Customer Name",
              "displayName": "Customer Name",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Phone Number",
              "displayName": "Phone Number",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Service Type",
              "displayName": "Service Type",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Preferred Date",
              "displayName": "Preferred Date",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Preferred Time",
              "displayName": "Preferred Time",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Address",
              "displayName": "Address",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Additional Notes",
              "displayName": "Additional Notes",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "Pending",
                  "value": "Pending"
                },
                {
                  "name": "Done",
                  "value": "Done"
                },
                {
                  "name": "Processing",
                  "value": "Processing"
                }
              ],
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        128,
        -16
      ],
      "id": "1f720d91-7495-4dc1-9bf9-738b2fd23cbf",
      "name": "Create a record",
      "retryOnFail": true,
      "waitBetweenTries": 10,
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 1
            },
            {}
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        -480,
        160
      ],
      "id": "cab7e547-641f-4da6-8fe5-df4aef1d9c44",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "appqy3uEqBWoAG9Px",
          "mode": "list",
          "cachedResultName": "VexFab Service Bookings",
          "cachedResultUrl": "https://airtable.com/appqy3uEqBWoAG9Px"
        },
        "table": {
          "__rl": true,
          "value": "tblvH3SBGgnc7FR47",
          "mode": "list",
          "cachedResultName": "Service Requests",
          "cachedResultUrl": "https://airtable.com/appqy3uEqBWoAG9Px/tblvH3SBGgnc7FR47"
        },
        "filterByFormula": "{Status} = \"Pending\"",
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.2,
      "position": [
        -256,
        160
      ],
      "id": "3a49b484-b4b3-48e2-9128-99fed6cfcf5d",
      "name": "Search records",
      "credentials": {
        "airtableTokenApi": {
          "id": "kdP4Rn1hTuMyWaKO",
          "name": "Airtable Personal Access Token account 2"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "base": {
          "__rl": true,
          "value": "appqy3uEqBWoAG9Px",
          "mode": "list",
          "cachedResultName": "VexFab Service Bookings",
          "cachedResultUrl": "https://airtable.com/appqy3uEqBWoAG9Px"
        },
        "table": {
          "__rl": true,
          "value": "tblvH3SBGgnc7FR47",
          "mode": "list",
          "cachedResultName": "Service Requests",
          "cachedResultUrl": "https://airtable.com/appqy3uEqBWoAG9Px/tblvH3SBGgnc7FR47"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Phone Number": "={{ $json.fields['Phone Number'] }}",
            "status": "Processing",
            "Preferred Date": "={{ $json.fields['Preferred Date'] }}",
            "Preferred Time": "={{ $json.fields['Preferred Time'] }}",
            "Service Type": "={{ $json.fields['Service Type'] }}",
            "Email": "={{ $json.fields.Email }}",
            "Customer Name": "={{ $json.fields['Customer Name'] }}",
            "Address": "={{ $json.fields.Address }}",
            "Additional Notes": "={{ $json.fields['Additional Notes'] }}",
            "id": "={{$json.id}}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "Customer Name",
              "displayName": "Customer Name",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Phone Number",
              "displayName": "Phone Number",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Service Type",
              "displayName": "Service Type",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Preferred Date",
              "displayName": "Preferred Date",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Preferred Time",
              "displayName": "Preferred Time",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Address",
              "displayName": "Address",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Additional Notes",
              "displayName": "Additional Notes",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "Pending",
                  "value": "Pending"
                },
                {
                  "name": "Done",
                  "value": "Done"
                },
                {
                  "name": "Processing",
                  "value": "Processing"
                }
              ],
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.2,
      "position": [
        -48,
        160
      ],
      "id": "eb00b113-ff89-40db-9035-00de1baf4798",
      "name": "Update record",
      "credentials": {
        "airtableTokenApi": {
          "id": "kdP4Rn1hTuMyWaKO",
          "name": "Airtable Personal Access Token account 2"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "Message a model": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Create a record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Search records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search records": {
      "main": [
        [
          {
            "node": "Update record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update record": {
      "main": [
        [
          {
            "node": "Message a model",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "versionId": "043c4848-87bf-4ee4-908c-3b6ba8fd9452",
  "meta": {
    "instanceId": "86aab0dd2884c5408cdd8ef4ae4dd5326507e4e2737474234ce6146dafc3d8f1"
  },
  "nodeGroups": [],
  "id": "tHpd9qFAtKGyklFM",
  "tags": []
}