{
  "name": "strategy-generator-openai",
  "nodes": [
    {
      "id": "f5a6b7c8-0001-4000-8000-000000000001",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        300
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "strategy-generator",
        "responseMode": "onReceived",
        "options": {}
      }
    },
    {
      "id": "f5a6b7c8-0002-4000-8000-000000000002",
      "name": "Generate Strategy",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        220,
        300
      ],
      "parameters": {
        "model": "gpt-4o",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are a senior strategist specializing in go-to-market and content strategy for B2B companies. Given a brief, generate a structured strategy document with these sections:\n\n1. Situation Summary (what is true right now)\n2. Goal (what success looks like in 90 days)\n3. Target Audience (specific ICP segment)\n4. Core Positioning (single differentiating idea)\n5. Channel Strategy (3 prioritized channels with rationale)\n6. 30-60-90 Day Plan (concrete actions per phase)\n7. Key Metrics (3-5 measurable outcomes)\n8. Risks and Mitigations (top 2-3 risks)\n\nWrite in clear, direct prose. Use bullet points only within sections. No em-dashes. Total length: 400-600 words."
            },
            {
              "role": "user",
              "content": "Company: {{ $json.company_name }}\nIndustry: {{ $json.industry }}\nStage: {{ $json.stage }}\nStrategy type: {{ $json.strategy_type }}\nBudget: {{ $json.budget }}\nTimeframe: {{ $json.timeframe }}\n\nBrief:\n{{ $json.brief }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "f5a6b7c8-0003-4000-8000-000000000003",
      "name": "Parse Strategy",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3,
      "position": [
        440,
        300
      ],
      "parameters": {
        "mode": "manual",
        "fields": {
          "values": [
            {
              "name": "strategy_text",
              "type": "expression",
              "value": "={{ $json.message.content }}"
            },
            {
              "name": "company_name",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.company_name }}"
            },
            {
              "name": "strategy_type",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.strategy_type }}"
            },
            {
              "name": "timeframe",
              "type": "expression",
              "value": "={{ $('Webhook Trigger').item.json.timeframe }}"
            }
          ]
        }
      }
    },
    {
      "id": "f5a6b7c8-0004-4000-8000-000000000004",
      "name": "Save to Notion",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2,
      "position": [
        660,
        300
      ],
      "parameters": {
        "operation": "create",
        "databaseId": "YOUR_NOTION_DATABASE_ID",
        "title": "={{ $json.strategy_type + ' Strategy - ' + $json.company_name + ' - ' + new Date().toISOString().split('T')[0] }}",
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Company",
              "type": "rich_text",
              "textContent": "={{ $json.company_name }}"
            },
            {
              "key": "Type",
              "type": "select",
              "selectValue": "={{ $json.strategy_type }}"
            },
            {
              "key": "Timeframe",
              "type": "rich_text",
              "textContent": "={{ $json.timeframe }}"
            },
            {
              "key": "Status",
              "type": "select",
              "selectValue": "Draft"
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "id": "f5a6b7c8-0005-4000-8000-000000000005",
      "name": "Notify Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2,
      "position": [
        880,
        300
      ],
      "parameters": {
        "operation": "post",
        "select": "channel",
        "channelId": {
          "value": "#strategy"
        },
        "text": "New strategy document generated.\nCompany: {{ $('Parse Strategy').item.json.company_name }}\nType: {{ $('Parse Strategy').item.json.strategy_type }}\nTimeframe: {{ $('Parse Strategy').item.json.timeframe }}\n\nSaved to Notion for review.",
        "otherOptions": {}
      },
      "credentials": {
        "slackApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Generate Strategy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Strategy": {
      "main": [
        [
          {
            "node": "Parse Strategy",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Strategy": {
      "main": [
        [
          {
            "node": "Save to Notion",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save to Notion": {
      "main": [
        [
          {
            "node": "Notify Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 1,
  "updatedAt": "2026-05-17T00:00:00.000Z",
  "versionId": "v1"
}