( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/../tmpr/../tmpr/..//tmpr/../n8nphp/ProposalX_Webhooks.json
{
  "name": "ProposalX_Webhooks",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "proposal/start",
        "options": {}
      },
      "id": "c96c5860-d0a6-44c7-aae7-7eb19e839b0f",
      "name": "Webhook Start",
      "type": "n8n-nodes-base.webhook",
      "position": [
        0,
        0
      ],
      "webhookId": "proposal-start-webhook",
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "df28b12e-7c20-4ff5-b5b8-dc773aa14d4b",
              "name": "request_id",
              "type": "string",
              "value": "={{ $execution.id }}"
            },
            {
              "id": "9362c1e7-717d-444a-8ea2-6b5f958c9f3f",
              "name": "prompt",
              "type": "string",
              "value": "={{ $json.body.prompt }}"
            },
            {
              "id": "09094be4-7844-4a9e-af82-cc8e39322398",
              "name": "depth",
              "type": "number",
              "value": "={{ $json.body.depth || 1 }}"
            },
            {
              "id": "3fc30a30-7806-4013-835d-97e27ddd7ae1",
              "name": "breadth",
              "type": "number",
              "value": "={{ $json.body.breadth || 2 }}"
            }
          ]
        },
        "options": {}
      },
      "id": "6d0be5e2-6346-48e7-bf00-c8f93ea8653a",
      "name": "Set Variables",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        0
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "o3-mini"
        },
        "options": {}
      },
      "id": "75d2402a-384e-41b5-a638-1abd98d589d8",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        512,
        160
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "id": "RGOApeM8N42iIiHF",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"questions\": {\n      \"type\": \"array\",\n      \"description\": \"Follow up questions to clarify the proposal direction, max of 3.\",\n      \"items\": {\n          \"type\": \"string\"\n      }\n    }\n  }\n}"
      },
      "id": "fe34ab92-030a-4e70-a5e5-d82f10ad2949",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        736,
        160
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=Given the following proposal request from the user, ask up to 4 follow-up questions to clarify the proposal direction. Return a maximum of 4 questions, but feel free to return less if the original query is clear. Only ask necessary questions:\n<query>{{ $json.prompt }}</query>",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "type": "HumanMessagePromptTemplate",
              "message": "=**You are an expert proposal writer. Today is {{ $now.toLocaleString() }}. Follow these instructions when responding:**\n- You may be asked to craft proposals for industries or trends beyond your knowledge cutoff; assume the user's request is accurate when referring to new developments.\n- The user is a highly experienced business development professional—no need to simplify. Be as detailed as possible, ensuring accuracy and strategic depth.\n- Be highly organized.\n- Suggest proposal strategies and angles the user may not have considered.\n- Be proactive and anticipate the user's needs.\n- Treat the user as an expert in all aspects of proposal writing and business strategy.\n- Mistakes erode trust, so be accurate, thorough, and professional.\n- Provide detailed, structured responses—the user values depth and nuance.\n- Prioritize strong arguments and compelling value propositions over conventional wisdom or industry norms.\n- Consider innovative approaches, emerging trends, and unconventional strategies, not just best practices.\n- You may incorporate speculative or predictive elements—just flag them appropriately.\n- Clearly communicate value, align with client needs, and persuade decision-makers.\n- Include key sections that high-converting proposals typically include"
            }
          ]
        }
      },
      "id": "2fec74ed-0196-480a-8f5a-9347b057109a",
      "name": "Clarifying Questions",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        528,
        0
      ],
      "typeVersion": 1.5
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"request_id\": $('Set Variables').first().json.request_id, \"questions\": $json.output.questions } }}",
        "options": {}
      },
      "id": "33415f40-93ef-4b57-b0cb-140e2611848a",
      "name": "Response Questions",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        848,
        0
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "proposal/answers",
        "options": {}
      },
      "id": "1b3cf7d2-9966-44ef-9d65-c7f933e41580",
      "name": "Webhook Answers",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1040,
        0
      ],
      "webhookId": "proposal-answers-webhook",
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "14b77741-c3c3-4bd2-be6e-37bd09fcea2b",
              "name": "query",
              "type": "string",
              "value": "=Initial query: {{ $json.body.prompt }}\nFollow-up Questions and Answers:\n{{ $json.body.answers.map((item, index) => `Question ${index + 1}: ${item.question}\\nAnswer: ${item.answer}`).join('\\n\\n') }}"
            },
            {
              "id": "request-id-2",
              "name": "request_id",
              "type": "string",
              "value": "={{ $json.body.request_id }}"
            },
            {
              "id": "depth-2",
              "name": "depth",
              "type": "number",
              "value": "={{ $json.body.depth || 1 }}"
            },
            {
              "id": "breadth-2",
              "name": "breadth",
              "type": "number",
              "value": "={{ $json.body.breadth || 2 }}"
            }
          ]
        },
        "options": {}
      },
      "id": "638b2299-fb80-4406-a281-9f96cc031035",
      "name": "Format Query",
      "type": "n8n-nodes-base.set",
      "position": [
        1248,
        0
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "o3-mini"
        },
        "options": {}
      },
      "id": "f07a683f-b216-4d2b-bd2b-8a0e216608ae",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1552,
        160
      ],
      "typeVersion": 1.2,
      "credentials": {
        "openAiApi": {
          "id": "RGOApeM8N42iIiHF",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"title\": {\n      \"type\": \"string\",\n      \"description\": \"A short title summarizing the proposal topic\"\n    },\n    \"description\": {\n      \"type\": \"string\",\n      \"description\": \"A short description to summarize the proposal topic\"\n    }\n  }\n}"
      },
      "id": "c0439003-9475-4531-8667-8416d50a3851",
      "name": "Structured Output Parser4",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1728,
        160
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=As an expert proposal writer, create a suitable title for the proposal document based on the user's query.\n<query>{{ $json.query }}</query>",
        "hasOutputParser": true
      },
      "id": "e6b0369b-4548-4ff9-9fe9-55d29bd40994",
      "name": "Report Page Generator",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1552,
        0
      ],
      "typeVersion": 1.5
    },
    {
      "parameters": {
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "value": "1b9448de-bdb2-800d-981d-d87120c4ea6a",
          "mode": "list",
          "cachedResultName": "ProposalX By Brand AI"
        },
        "title": "={{ $json.output.title }}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Description|rich_text",
              "textContent": "={{ $json.output.description }}"
            },
            {
              "key": "Status|status",
              "statusValue": "Not started"
            },
            {
              "key": "Request ID|rich_text",
              "textContent": "={{ $('Format Query').first().json.request_id }}"
            },
            {
              "key": "Name|title",
              "title": "={{ $json.output.title }}"
            }
          ]
        },
        "options": {}
      },
      "id": "aa79d564-9abd-4756-aa6c-a8ac2f70eed4",
      "name": "Create Row",
      "type": "n8n-nodes-base.notion",
      "position": [
        1872,
        0
      ],
      "typeVersion": 2.2,
      "credentials": {
        "notionApi": {
          "id": "tFjIhGZDHO1eUM93",
          "name": "Notion account"
        }
      }
    },
    {
      "parameters": {
        "workflowId": {
          "__rl": true,
          "value": "HTY8DBRA2b8iUFlN",
          "mode": "list",
          "cachedResultName": "ProposalXSUB"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {
            "requestId": "={{ $('Format Query').first().json.request_id }}",
            "jobType": "deepresearch_initiate",
            "data": "={{ { query: $('Format Query').first().json.query, learnings: [], depth: $('Format Query').first().json.depth, breadth: $('Format Query').first().json.breadth } }}"
          }
        },
        "mode": "each",
        "options": {
          "waitForSubWorkflow": false
        }
      },
      "id": "9a18c59e-a562-4114-95fc-fc91daf2bb17",
      "name": "Initiate DeepResearch",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        2176,
        0
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { \"success\": true, \"request_id\": $('Format Query').first().json.request_id, \"notion_page\": $('Create Row').first().json, \"message\": \"Research initiated successfully\" } }}",
        "options": {}
      },
      "id": "251039d3-c7df-4aeb-b823-c014a2c1df80",
      "name": "Response Success",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        2368,
        0
      ],
      "typeVersion": 1.1
    }
  ],
  "pinData": {},
  "connections": {
    "Webhook Start": {
      "main": [
        [
          {
            "node": "Set Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables": {
      "main": [
        [
          {
            "node": "Clarifying Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Clarifying Questions",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Clarifying Questions",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Clarifying Questions": {
      "main": [
        [
          {
            "node": "Response Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Answers": {
      "main": [
        [
          {
            "node": "Format Query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Query": {
      "main": [
        [
          {
            "node": "Report Page Generator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Report Page Generator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser4": {
      "ai_outputParser": [
        [
          {
            "node": "Report Page Generator",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Report Page Generator": {
      "main": [
        [
          {
            "node": "Create Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Row": {
      "main": [
        [
          {
            "node": "Initiate DeepResearch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initiate DeepResearch": {
      "main": [
        [
          {
            "node": "Response Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a3a6d330-3519-40d3-b8fe-cb538f18d484",
  "meta": {
    "instanceId": "1b609a0a16b88a0c82d88be8ef5c2982d7d6d4a8078f13f2246fa375c4bc345a"
  },
  "id": "chw2KukgDzX8PTcy",
  "tags": []
}