{
  "id": "O3BJdDDZbAtT74VZ",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "newsapi without credentials",
  "tags": [],
  "nodes": [
    {
      "id": "f12fb93e-7d7d-4f99-9e30-112e02237cd3",
      "name": "Notes",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        -1340
      ],
      "parameters": {
        "width": 580,
        "height": 100,
        "content": "# AI Article Generator with Qdrant\n1. Edit 'Set Input Data' node with your topic, company, and tone.\n2. Retrieves company data from Qdrant using RAG.\n3. Fetches recent news using NewsAPI.\n4. Generates a 500-word article using OpenAI.\n5. Sends the article via Gmail.\n\n**Setup**:\n- Add credentials: Qdrant, Gmail SMTP.\n- Set env vars: OPENAI_API_KEY, NEWSAPI_KEY.\n- Pre-populate Qdrant collection 'company_data' with documents.\n- Update `fromEmail` and `toEmail` in Send Article via Gmail."
      },
      "typeVersion": 1
    },
    {
      "id": "d17ff0dc-914f-4c9b-b984-5179fb688b81",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -560,
        -620
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1ce01576-ef29-41ed-a97e-cdc296917239",
      "name": "Split Articles",
      "type": "n8n-nodes-base.code",
      "position": [
        120,
        -660
      ],
      "parameters": {
        "jsCode": "// Access the articles array from the current node's input\nconst articles = $input.first().json.articles || [];\n\n// Log the number of articles for debugging\nconsole.log(`Found ${articles.length} articles`);\n\n// Aggregate the articles into an HTML-formatted string\nconst emailBody = `\n  \n  <hr style=\"border: 1px solid #ddd;\">\n  ${articles.map((article, index) => `\n    <div style=\"margin-bottom: 20px;\">\n      <h2 style=\"color: #1a73e8;\">Article ${index + 1}: ${article.title}</h2>\n      <p><strong>Description:</strong> ${article.description}</p>\n    </div>\n    <hr style=\"border: 1px solid #ddd;\">\n  `).join('')}\n`;\n\n// Output a single item with the HTML email body\nconst output = [{\n  json: {\n    email_subject: \"Latest News Articles\",\n    email_body: emailBody\n  }\n}];\n\n// Log the final output for debugging\nconsole.log('Output item:', JSON.stringify(output, null, 2));\n\n// Return the single item\nreturn output;"
      },
      "typeVersion": 2
    },
    {
      "id": "8bdb2b9a-a57b-4d64-ad17-aaf2bbcd1119",
      "name": "News API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -60,
        -660
      ],
      "parameters": {
        "url": "=https://newsapi.org/v2/everything?q={{ encodeURIComponent($json.keyword) }}&sortBy=publishedAt&language=en&pageSize=5&from={{ new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString().split('T')[0] }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth"
      },
      "credentials": {
        "httpQueryAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4dface60-cd99-48d6-9b6a-49b8dcc5c552",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -900,
        -100
      ],
      "parameters": {
        "filters": {
          "sender": "user@example.com",
          "readStatus": "unread"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4014f595-46fd-4fa2-8771-61027cdcfe16",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -380,
        -240
      ],
      "parameters": {
        "simple": false,
        "options": {},
        "messageId": "={{ $json.id }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "fdaf2818-d4f0-4108-b598-96ea88e89a09",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        -740,
        -280
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d0552f56-1c1c-4c33-b633-d5cf3b73007a",
              "name": "content",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9182a1ad-49d5-4fc2-b55d-8633dd0e9834",
      "name": "confirmation",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -460,
        320
      ],
      "parameters": {
        "messageId": "={{ $json.id }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "251e95a1-3bfe-4ef1-b105-0a3d9b36c1cb",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        140,
        120
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "db8c4c3f-f2bf-4a2a-a5ed-4d5243b59185",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        60,
        -60
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3
    },
    {
      "id": "e7b449b3-53d6-449b-9772-c0925b553e91",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        800,
        -20
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"commentary\": \"\ud83d\ude80 Great news for developers! PyDantic-AI-Examples 0.1.2 is out, offering practical examples to implement PydanticAI and build robust apps with ease. Check it out! \ud83d\udcbb #AI #TechInnovation #Developers\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "fbe9396a-66f7-411a-a19d-44425dccf8c0",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        80,
        -60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4257fd89-716a-43e5-91b8-0fe63a23080f",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "= {{ $json.decision }}",
              "rightValue": ""
            },
            {
              "id": "55c996ae-9990-4642-901f-21e5fbee263e",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.content }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "0092d297-df30-4ca3-96ed-f5dded80926a",
      "name": "Unread",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -440,
        20
      ],
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "markAsRead"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3b59e60e-45df-4de5-82a0-592e3d609c75",
      "name": "Set Input Data (Topic/Company/Tone)",
      "type": "n8n-nodes-base.set",
      "position": [
        -320,
        -620
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "649f3dcc-f800-49f2-9a47-806d11ba819b",
              "name": "=keyword",
              "type": "string",
              "value": "ai"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ae60f9ec-fdf8-40f0-b73b-c9c3c2fe55fd",
      "name": "Send Email with News Articles",
      "type": "n8n-nodes-base.gmail",
      "position": [
        360,
        -660
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=Latest articles {{ $json.email_subject }}{{ $json.email_body }}",
        "options": {},
        "subject": "Latest Ai news"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "55940722-dfbd-4807-99f7-d6d32d05d20a",
      "name": "Log Email Activity",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        580,
        -660
      ],
      "parameters": {
        "columns": {
          "value": {
            "Recipient": "user@example.com",
            "Timestamp": "={{ new Date().toISOString() }}",
            "Message-ID": "={{ $json.id }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message-ID",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Message-ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Recipient",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Recipient",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ypiv9KQrW-7tc4iJ8b0YmcLUKotXDrEAobZDXMcUGUQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Ypiv9KQrW-7tc4iJ8b0YmcLUKotXDrEAobZDXMcUGUQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ypiv9KQrW-7tc4iJ8b0YmcLUKotXDrEAobZDXMcUGUQ/edit?usp=drivesdk",
          "cachedResultName": "email-n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "ab44e274-8c67-493f-8968-2f6d841e79fc",
      "name": "Capture Email Decision",
      "type": "n8n-nodes-base.set",
      "position": [
        -180,
        140
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e8acea05-1b3f-405b-8adb-2604f17d0e4f",
              "name": "decision",
              "type": "string",
              "value": "={{ $json.snippet }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "865cf8c6-565c-4a9b-b976-417ae7165d84",
      "name": "Retrieve the message",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -680,
        -100
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ypiv9KQrW-7tc4iJ8b0YmcLUKotXDrEAobZDXMcUGUQ/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Ypiv9KQrW-7tc4iJ8b0YmcLUKotXDrEAobZDXMcUGUQ",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Ypiv9KQrW-7tc4iJ8b0YmcLUKotXDrEAobZDXMcUGUQ/edit?usp=drivesdk",
          "cachedResultName": "email-n8n"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "3120723e-7bf8-4896-8fb3-93d526765461",
      "name": "Generate Linkedin Posts",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        800,
        -240
      ],
      "parameters": {
        "text": "=You are a social media expert specializing in tech and AI content, tasked with generating a professional LinkedIn post. Use the \"linkedin_posts\" tool to retrieve example LinkedIn posts, which will provide the style, tone, and structure you should follow.\n\nSteps:\n1. Use the \"linkedin_posts\" tool to retrieve example LinkedIn posts.\n2. Analyze the style, tone, and structure of the retrieved posts (e.g., use of emojis, hashtags, bullet points, or engaging questions).\n3. Based on the news provided in {{ $json.content }}, generate a professional LinkedIn post to share key insights or updates relevant to tech and AI.\n4. Ensure the post aligns with the user\u2019s decision from the email confirmation: {{ $json.decision }}.\n5. Make the post engaging, professional, and suitable for a LinkedIn audience. Include hashtags, emojis, or other elements if they are present in the example posts.\n\nGenerate the LinkedIn post now.",
        "options": {
          "systemMessage": "You are a skilled social media content creator specializing in tech and AI news. Your role is to craft engaging and professional LinkedIn posts based on provided news content and user decisions. Follow the user\u2019s instructions to generate posts in the specified JSON . Return the post as a JSON object in the format: {\"Text\": \"your generated post content\"}"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "executeOnce": true,
      "typeVersion": 1.8
    },
    {
      "id": "dfb952de-546d-4541-9bf7-d62ca6f5544e",
      "name": "Generate Vector Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1100,
        140
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "efd07f78-e8a3-4d82-a355-f200be1f4b0b",
      "name": "Publish LinkedIn Post",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1560,
        -100
      ],
      "parameters": {
        "url": "https://api.linkedin.com/rest/posts",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"author\": \"{{ $json.author }}\",\n  \"commentary\":\"{{ $json.commentary }}\",\n  \"visibility\": \"PUBLIC\",\n  \"lifecycleState\": \"PUBLISHED\",\n  \"distribution\": {\n    \"feedDistribution\": \"MAIN_FEED\",\n    \"targetEntities\": [],\n    \"thirdPartyDistributionChannels\": []\n  }\n}",
        "sendBody": true,
        "contentType": "=json",
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "LinkedIn-Version",
              "value": "202503"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "X-Restli-Protocol-Version",
              "value": "2.0.0"
            }
          ]
        },
        "nodeCredentialType": "linkedInOAuth2Api"
      },
      "credentials": {
        "linkedInOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "ec510882-812b-4b4e-8a29-3e8b799f3424",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -780
      ],
      "parameters": {
        "color": 5,
        "width": 1940,
        "height": 320,
        "content": "# News digest with article summaries\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9ee79293-12d6-4542-9a31-444d8ed8a7da",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -920,
        -380
      ],
      "parameters": {
        "width": 1640,
        "height": 900,
        "content": "# Get decision and the articles from email\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cba603cb-7d72-46d0-82cb-474c1a29a3d8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        700,
        -380
      ],
      "parameters": {
        "color": 3,
        "width": 1000,
        "height": 820,
        "content": "# Generate the Linkedin Post"
      },
      "typeVersion": 1
    },
    {
      "id": "8e22b721-99f5-4dda-96ad-d9e9a258ed12",
      "name": "RetrievePostExamples",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        1100,
        -20
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {},
        "toolName": "linkedin_posts",
        "toolDescription": "Examples of LinkedIn posts. Use these to generate new posts in a similar style and tone.\n\n",
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "posts",
          "cachedResultName": "posts"
        }
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3ade436d-a77b-4d01-87f8-1186a93cc1a5",
      "name": "ExtractLatestEmail2",
      "type": "n8n-nodes-base.code",
      "position": [
        -120,
        -280
      ],
      "parameters": {
        "jsCode": "return [$input.all().slice(-1)[0]];"
      },
      "typeVersion": 2
    },
    {
      "id": "19c15ab2-5be6-433c-9cbb-ddbcbef6720d",
      "name": "FormatLinkedInPayload",
      "type": "n8n-nodes-base.code",
      "position": [
        1200,
        -200
      ],
      "parameters": {
        "jsCode": "// Helper function to escape special characters for JSON\nfunction escapeJsonString(str) {\n  if (typeof str !== 'string') {\n    return String(str || 'Default commentary');\n  }\n  return str\n    .replace(/\\\\/g, '\\\\\\\\') // Escape backslashes\n    .replace(/\"/g, '\\\\\"')   // Escape double quotes\n    .replace(/\\n/g, '\\\\n')  // Escape newlines\n    .replace(/\\t/g, '\\\\t'); // Escape tabs\n}\n\n// Get all input items\nconst items = $input.all();\n\n// Check if there are any items\nif (!items.length) {\n  console.log(\"No input items found\");\n  return [{ json: { error: \"No input items\" } }];\n}\n\n// Take the first item's json.output.commentary (adjust if you need a different item)\nconst commentary = items[0].json.output?.commentary;\n\nconst linkedInProfileId = 'urn:li:person:default-id';\n\n\n\n// Construct the JSON payload\nconst payload = {\n  author: linkedInProfileId,\n\n\n  commentary: escapeJsonString(commentary),\n  visibility: \"PUBLIC\",\n  lifecycleState: \"PUBLISHED\",\n  distribution: {\n    feedDistribution: \"MAIN_FEED\",\n    targetEntities: [],\n    thirdPartyDistributionChannels: []\n  }\n};\n\n// Log for debugging\nconsole.log(\"Dynamic JSON:\", JSON.stringify(payload, null, 2));\nconsole.log(\"Raw Commentary:\", commentary);\nconsole.log(\"Escaped Commentary:\", payload.commentary);\nconsole.log(\"Commentary Type:\", typeof commentary);\n\nreturn [{ json: payload }];"
      },
      "typeVersion": 2
    },
    {
      "id": "7e3aa544-9db6-462d-a6a7-284c206064c5",
      "name": "Set Linkedin Id",
      "type": "n8n-nodes-base.set",
      "position": [
        1320,
        -380
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "81da58bf-b0bd-4c73-8895-243a8953fbce",
              "name": "author",
              "type": "string",
              "value": "urn:li:person"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "14cd9288-9687-4b82-816b-cd8ab3127e17",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1460,
        -220
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "58392ebf-f703-450d-aabd-6a630b0b3578",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Generate Linkedin Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Publish LinkedIn Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unread": {
      "main": [
        [
          {
            "node": "Gmail1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "News API": {
      "main": [
        [
          {
            "node": "Split Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "ExtractLatestEmail2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "confirmation": {
      "main": [
        [
          {
            "node": "Capture Email Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Retrieve the message",
            "type": "main",
            "index": 0
          },
          {
            "node": "confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Articles": {
      "main": [
        [
          {
            "node": "Send Email with News Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Linkedin Id": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Input Data (Topic/Company/Tone)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Linkedin Posts",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "ExtractLatestEmail2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve the message": {
      "main": [
        [
          {
            "node": "Unread",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "RetrievePostExamples": {
      "ai_tool": [
        [
          {
            "node": "Generate Linkedin Posts",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "FormatLinkedInPayload": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Publish LinkedIn Post": {
      "main": [
        []
      ]
    },
    "Capture Email Decision": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Generate Linkedin Posts": {
      "main": [
        [
          {
            "node": "FormatLinkedInPayload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Linkedin Posts",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Vector Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "RetrievePostExamples",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Send Email with News Articles": {
      "main": [
        [
          {
            "node": "Log Email Activity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Input Data (Topic/Company/Tone)": {
      "main": [
        [
          {
            "node": "News API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}