{
  "nodes": [
    {
      "id": "a3d6e0d3-3f5a-44de-8518-590601a362d6",
      "name": "JotForm Trigger",
      "type": "n8n-nodes-base.jotFormTrigger",
      "position": [
        432,
        432
      ],
      "parameters": {
        "form": "251206359432049"
      },
      "typeVersion": 1
    },
    {
      "id": "1bf8d979-0f2c-4123-af8b-75dda886a372",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        656,
        432
      ],
      "parameters": {
        "name": "={ { $json['Company Name'] } } | Ai Proposal",
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "1DSHUhq_DoM80cM7LZ5iZs6UGoFb3ZHsLpU3mZDuQwuQ"
        },
        "options": {},
        "operation": "copy"
      },
      "executeOnce": true,
      "typeVersion": 3
    },
    {
      "id": "15b2e0d6-4435-426e-9c5f-27e1dad04f95",
      "name": "Google Drive1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        880,
        432
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "url",
          "value": "={ { $('JotForm Trigger').item.json['Call Link'] } }"
        },
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "0242ce1e-f983-4be8-aecc-ae2aaae1541d",
      "name": "OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        528,
        656
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "typeVersion": 1.8
    },
    {
      "id": "56e8e15a-97aa-4fcb-af03-4b7a4c929a79",
      "name": "OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        736,
        656
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "GPT-4.1-MINI"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Bitte analysiere die folgenden Daten.\n\nProspect Details\nFirst Name:{ { $('JotForm Trigger').item.json['First Name'] } }\nLast Name:{ { $('JotForm Trigger').item.json['Last Name'] } }\nCompany Name: { { $('JotForm Trigger').item.json['Company Name'] } }\n\nSales Call Transcript: { { $json.text } }"
            },
            {
              "role": "system",
              "content": "# Übersicht\nDu bist ein KI-Agent, der maßgeschneiderte Angebotskomponenten in JSON-Format basierend auf einem Sales-Call-Transkript und grundlegenden Prospektinformationen generiert."
            }
          ]
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "41062aa1-859b-46ac-ac19-09faccdf05e3",
      "name": "Google Docs",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        480,
        928
      ],
      "parameters": {
        "actionsUi": {
          "actionFields": [
            {
              "text": "{ {prospectFirstName} }",
              "action": "replaceAll",
              "replaceText": "={ { $('JotForm Trigger').item.json['First Name'] } }"
            },
            {
              "text": "{ {companyName} }",
              "action": "replaceAll",
              "replaceText": "={ { $('JotForm Trigger').item.json['Company Name'] } }"
            },
            {
              "text": "{ {problemStatement} }",
              "action": "replaceAll",
              "replaceText": "={ { $json.choices[0].message.content.problemStatement } }"
            },
            {
              "text": "{ {solutionStatement} }",
              "action": "replaceAll",
              "replaceText": "={ { $json.choices[0].message.content.solutionStatement } }"
            },
            {
              "text": "{ {date} }",
              "action": "replaceAll",
              "replaceText": "={ { $now } }"
            }
          ]
        },
        "operation": "update",
        "documentURL": "={ { $('Google Drive').item.json.id } }"
      },
      "typeVersion": 2
    },
    {
      "id": "05732cb6-7abb-4429-8fc7-c25306151095",
      "name": "Google Drive2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        704,
        928
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={ { $json.documentId } }"
        },
        "options": {
          "fileName": "proposal.pdf",
          "binaryPropertyName": "proposal",
          "googleFileConversion": {
            "conversion": {
              "docsToFormat": "application/pdf"
            }
          }
        },
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "e2e330b7-7741-411e-9c75-5b376d723a2f",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        912,
        928
      ],
      "parameters": {
        "message": "=Hallo { { $('JotForm Trigger').item.json['First Name'] } } - wie besprochen, hier ist das Angebot für den { { $('OpenAI1').item.json.choices[0].message.content.aiSystem } } Build. Lass mich wissen, wenn du Fragen hast.\n\nFreue mich auf dein Feedback.\n\n- Nolan",
        "options": {
          "sendTo": "={ { $('JotForm Trigger').item.json.Email } }",
          "attachmentsUi": {
            "attachmentsBinary": [
              {
                "property": "proposal"
              }
            ]
          }
        },
        "subject": "={ { $('JotForm Trigger').item.json['Company Name'] } } | { { $('OpenAI1').item.json.choices[0].message.content.aiSystem } } Angebot",
        "resource": "draft"
      },
      "typeVersion": 2.1
    }
  ],
  "connections": {
    "OpenAI": {
      "main": [
        [
          {
            "node": "OpenAI1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI1": {
      "main": [
        [
          {
            "node": "Google Docs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Docs": {
      "main": [
        [
          {
            "node": "Google Drive2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive1": {
      "main": [
        [
          {
            "node": "OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive2": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JotForm Trigger": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}