{
  "name": "Proposal Generator",
  "nodes": [
    {
      "parameters": {
        "formTitle": "Proposal Generator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "First Name",
              "requiredField": true
            },
            {
              "fieldLabel": "Last Name"
            },
            {
              "fieldLabel": "Email",
              "fieldType": "email"
            },
            {
              "fieldLabel": "Company Name"
            },
            {
              "fieldLabel": "Transcript URL"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.3,
      "position": [
        48,
        0
      ],
      "id": "01541d51-cd21-49d4-92b2-3ec5d61b5302",
      "name": "On form submission",
      "webhookId": "317eb00f-43ff-43a3-a748-52f0270f0d78"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        144,
        224
      ],
      "id": "e1080169-2b76-4a7e-b2fd-145e7fbc29a6",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "MzIepidaRw9ZqcPB",
          "name": "OpenAi account Credentials"
        }
      }
    },
    {
      "parameters": {
        "operation": "get",
        "documentURL": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Doc_ID_or_URL', ``, 'string') }}"
      },
      "type": "n8n-nodes-base.googleDocsTool",
      "typeVersion": 2,
      "position": [
        288,
        224
      ],
      "id": "8c02a123-6a9e-4bce-9c34-3b130b600148",
      "name": "Get a document in Google Docs",
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "qziHwPuC4VDliHwf",
          "name": "Google Docs account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "documentURL": "={{ $json.id }}",
        "simple": false,
        "actionsUi": {
          "actionFields": [
            {
              "action": "replaceAll",
              "text": "{{prospectFirstName}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.prospectFirstName }}"
            },
            {
              "action": "replaceAll",
              "text": "{{prospectLastName}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.prospectLastName }}"
            },
            {
              "action": "replaceAll",
              "text": "{{companyName}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.companyName }}"
            },
            {
              "action": "replaceAll",
              "text": "{{problemStatement1}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.problemStatement1 }}"
            },
            {
              "action": "replaceAll",
              "text": "{{problemStatement2}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.problemStatement2 }}"
            },
            {
              "action": "replaceAll",
              "text": "{{problemStatement3}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.problemStatement3 }}"
            },
            {
              "action": "replaceAll",
              "text": "{{solutionStatement}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.solutionStatement }}"
            },
            {
              "action": "replaceAll",
              "text": "{{whyThisWorks}}",
              "replaceText": "={{ $('Proposal Writer AI Agent').item.json.output.whyThisWorks }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.googleDocs",
      "typeVersion": 2,
      "position": [
        656,
        0
      ],
      "id": "c7ea14d5-bfae-41f5-8dc3-4cca7b009103",
      "name": "Update a document",
      "credentials": {
        "googleDocsOAuth2Api": {
          "id": "qziHwPuC4VDliHwf",
          "name": "Google Docs account"
        }
      }
    },
    {
      "parameters": {
        "jsonSchemaExample": "{\n  \"prospectFirstName\": \"{{ $json['First Name'] }}\",\n  \"prospectLastName\": \"{{ $json['Last Name'] }}\",\n  \"companyName\": \"{{ $json['Company Name'] }}\",\n  \"problemStatement1\": \"\",\n  \"problemStatement2\": \"\",\n  \"problemStatement3\": \"\",\n  \"solutionStatement\": \"\",\n  \"whyThisWorks\": \"\"\n}"
      },
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1.3,
      "position": [
        448,
        224
      ],
      "id": "00b98666-8795-4490-b164-bcb7300f3cbd",
      "name": "Structured Output Parser"
    },
    {
      "parameters": {
        "operation": "copy",
        "fileId": {
          "__rl": true,
          "value": "1BvhV_BG3SC6zb8Zhpi0cKSxWhTkYzXf7FwZcqtKOw1s",
          "mode": "list",
          "cachedResultName": "Proposal Template",
          "cachedResultUrl": "https://docs.google.com/document/d/1BvhV_BG3SC6zb8Zhpi0cKSxWhTkYzXf7FwZcqtKOw1s/edit?usp=drivesdk"
        },
        "name": "=Proposal - {{ $json.output.prospectFirstName }} {{ $json.output.prospectLastName }} - {{ $json.output.companyName }}",
        "sameFolder": false,
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "1lYrpM8pL1l8eWIpfTdmDLVoSQSpX-3nU",
          "mode": "list",
          "cachedResultName": "Proposals",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1lYrpM8pL1l8eWIpfTdmDLVoSQSpX-3nU"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        496,
        0
      ],
      "id": "76f46eeb-a57f-4098-9176-e83e4c782ba1",
      "name": "Copy file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "VqZzm5YeRMOeGO9B",
          "name": "Google Drive account (kris)"
        }
      }
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json.documentId }}",
          "mode": "id"
        },
        "options": {
          "binaryPropertyName": "data",
          "googleFileConversion": {
            "conversion": {
              "docsToFormat": "application/pdf",
              "drawingsToFormat": "application/pdf",
              "slidesToFormat": "application/pdf",
              "sheetsToFormat": "application/pdf"
            }
          }
        }
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        816,
        0
      ],
      "id": "99f92a07-14d6-4715-aa70-aaa7d13e89f8",
      "name": "Download file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "VqZzm5YeRMOeGO9B",
          "name": "Google Drive account (kris)"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json.Email }}",
        "subject": "=Proposal for {{ $('On form submission').item.json[\"First Name\"] }} {{ $('On form submission').item.json[\"Last Name\"] }} - {{ $('On form submission').item.json[\"Company Name\"] }}",
        "emailType": "text",
        "message": "=Hi {{ $('On form submission').item.json[\"First Name\"] }},  \n\nThanks for your time. I’ve put together a one-page proposal outlining {{ $('On form submission').item.json[\"Company Name\"] }}’s key challenges and how our AI services can help solve them. \n\nYou’ll find the document attached. \n\nLet’s book a quick technical consultation if it looks like a fit.  \n\nBest, Kris",
        "options": {
          "appendAttribution": false,
          "attachmentsUi": {
            "attachmentsBinary": [
              {}
            ]
          }
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        960,
        0
      ],
      "id": "112c6b4d-b730-40a0-8ab2-82aebcacc3ac",
      "name": "Send a message",
      "webhookId": "3f05abba-2103-4181-8d90-c4e4cef51fbc",
      "credentials": {
        "gmailOAuth2": {
          "id": "xmp6P6qtAw4JgOCe",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=First Name: {{ $json[\"First Name\"] }}\nLast Name: {{ $json[\"Last Name\"] }}\nEmail: {{ $json.Email }}\nCompany Name: {{ $json[\"Company Name\"] }}\n\nSales Call Transcript Link: {{ $json[\"Transcript URL\"] }}",
        "hasOutputParser": true,
        "options": {
          "systemMessage": "Use the Get Google Docs Tool to retrieve the meeting transcript.\n\nClient Information:\nFirst Name: {{ $json[\"First Name\"] }}\nLast Name: {{ $json[\"Last Name\"] }}\nEmail: {{ $json.Email }}\nCompany Name: {{ $json[\"Company Name\"] }}\n\nSales Call Transcript: {{ $json[\"Transcript URL\"] }}\n\nTask:\n1. Identify up to three clear pain points from the transcript.\n2. Write a concise “solutionStatement” describing how our AI services address those problems.\n3. Write a concise “whyThisWorks” explanation focused on business benefits.\n\nOutput strictly in this JSON format:\n\n{\n  \"prospectFirstName\": \"{{ $json['First Name'] }}\",\n  \"prospectLastName\": \"{{ $json['Last Name'] }}\",\n  \"companyName\": \"{{ $json['Company Name'] }}\",\n  \"problemStatement1\": \"\",\n  \"problemStatement2\": \"\",\n  \"problemStatement3\": \"\",\n  \"solutionStatement\": \"\",\n  \"whyThisWorks\": \"\"\n}\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        208,
        0
      ],
      "id": "e5f44b1e-0465-46a5-b4a0-efb632144d91",
      "name": "Proposal Writer AI Agent"
    }
  ],
  "pinData": {},
  "connections": {
    "On form submission": {
      "main": [
        [
          {
            "node": "Proposal Writer AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Proposal Writer AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get a document in Google Docs": {
      "ai_tool": [
        [
          {
            "node": "Proposal Writer AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Proposal Writer AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Copy file": {
      "main": [
        [
          {
            "node": "Update a document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update a document": {
      "main": [
        [
          {
            "node": "Download file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download file": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Proposal Writer AI Agent": {
      "main": [
        [
          {
            "node": "Copy file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5fea69a9-8407-454a-9d7d-f6135511da39",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "4aabc0aa2e160dafa4f9d9bcedde563b5af29598cd16960f637ae2fb99aea720"
  },
  "id": "YfNF6p8spB7E3rJp",
  "tags": []
}