{
  "id": "euNcUWf1whsZrDX1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Automated AI Proposal Generator Using PDFMonkey",
  "tags": [],
  "nodes": [
    {
      "id": "b52bc6b1-1954-43b8-b168-bc3905af2512",
      "name": "0. Form Trigger (Client Data Input)",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        640,
        260
      ],
      "parameters": {},
      "description": "Triggers the workflow when a new form submission is received. Use this form to input client details.",
      "typeVersion": 1
    },
    {
      "id": "2b5fbdd1-83d7-4186-87f2-cceb4e4848d7",
      "name": "1. Prepare AI Prompt & Client Info1",
      "type": "n8n-nodes-base.function",
      "position": [
        860,
        260
      ],
      "parameters": {},
      "description": "Formats client input data into a structured prompt for the AI and extracts key client details for later use.",
      "typeVersion": 1
    },
    {
      "id": "79a411b6-ba29-4f6b-b3ab-af1418ef62b2",
      "name": "2. Generate Proposal Content (AI)1",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1080,
        260
      ],
      "parameters": {},
      "description": "Uses OpenAI (GPT-4o) to generate detailed proposal content in a JSON format based on the prepared prompt.",
      "typeVersion": 1.6
    },
    {
      "id": "daefa688-f8b2-4aae-ab62-17e0e4fd39a4",
      "name": "3. Generate Proposal PDF (PDFmonkey)1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1456,
        260
      ],
      "parameters": {},
      "description": "Sends the AI-generated content to PDFmonkey to create a professional PDF proposal using a predefined template.",
      "typeVersion": 4.2
    },
    {
      "id": "ae6fe8f0-46cf-455f-b503-3a0200244b13",
      "name": "5. Download Generated PDF1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1896,
        260
      ],
      "parameters": {},
      "description": "Fetches the newly generated PDF document from PDFmonkey's API.",
      "typeVersion": 4.2
    },
    {
      "id": "49947f2c-3b14-453d-b33f-f70b262ff94b",
      "name": "6. Prepare Email Data1",
      "type": "n8n-nodes-base.function",
      "position": [
        2116,
        260
      ],
      "parameters": {},
      "description": "Prepares all necessary data for sending the email, including client details and the downloaded PDF binary data.",
      "typeVersion": 1
    },
    {
      "id": "15be0928-b52c-4d07-b33f-156c619a836f",
      "name": "4. Wait (for PDFmonkey Webhook)1",
      "type": "n8n-nodes-base.wait",
      "position": [
        1676,
        260
      ],
      "parameters": {},
      "description": "Pauses the workflow, waiting for a webhook callback from PDFmonkey indicating the PDF generation is complete. This is crucial for reliability.",
      "typeVersion": 1.1
    },
    {
      "id": "42f78e62-2dba-4c2b-8af9-47de67fcfec9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        200
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b44f9758-d36f-4fb7-8ce1-07d10094a3b6",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        520
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "345f66f7-84cf-4b96-b70a-d7c6e6d882fc",
      "name": "7. Send Proposal Email to Client1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2340,
        260
      ],
      "parameters": {},
      "description": "Sends the final proposal PDF as an email attachment to the client.",
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a5d113a8-9bda-4721-a4f2-eeecb78edf72",
  "connections": {
    "6. Prepare Email Data1": {
      "main": [
        [
          {
            "node": "7. Send Proposal Email to Client1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5. Download Generated PDF1": {
      "main": [
        [
          {
            "node": "6. Prepare Email Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. Wait (for PDFmonkey Webhook)1": {
      "main": [
        [
          {
            "node": "5. Download Generated PDF1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Generate Proposal Content (AI)1": {
      "main": [
        [
          {
            "node": "3. Generate Proposal PDF (PDFmonkey)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0. Form Trigger (Client Data Input)": {
      "main": [
        [
          {
            "node": "1. Prepare AI Prompt & Client Info1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Prepare AI Prompt & Client Info1": {
      "main": [
        [
          {
            "node": "2. Generate Proposal Content (AI)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3. Generate Proposal PDF (PDFmonkey)1": {
      "main": [
        [
          {
            "node": "4. Wait (for PDFmonkey Webhook)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}