{
  "name": "Generate and auto-evaluate Facebook ad headlines using GPT-4o-mini",
  "nodes": [
    {
      "id": "53bc6494-458c-4dcb-a66c-092fb30bf6b7",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2784,
        144
      ]
    },
    {
      "id": "ca661097-1b4e-4dc6-b22c-2ff220106928",
      "name": "FormTrigger_CopywritingBrief",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        256,
        400
      ]
    },
    {
      "id": "340fb887-e9e7-45d6-8294-09337c5b20fc",
      "name": "Set_PromptForHeadline",
      "type": "n8n-nodes-base.set",
      "position": [
        464,
        432
      ]
    },
    {
      "id": "08915a22-5c32-4680-a299-9588fffc08b2",
      "name": "LLM_HeadlineWriterModel",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        784,
        608
      ]
    },
    {
      "id": "a831df58-17e1-4e56-863b-e5918b1a4e80",
      "name": "Agent_HeadlineWriter",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        816,
        384
      ]
    },
    {
      "id": "fd5cdd53-4738-4023-ac23-f8ada2c176f9",
      "name": "LLM_EvalCriteriaModel",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1216,
        576
      ]
    },
    {
      "id": "d9e284c1-92d1-43c9-9307-a4b3a2d3479f",
      "name": "LLM_HeadlineEvaluatorModel",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1616,
        592
      ]
    },
    {
      "id": "2484f5c0-6d3b-4a81-a82e-bb9619bc27c6",
      "name": "LLM_BottomLineModel",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2128,
        624
      ]
    },
    {
      "id": "15d3350a-4fe1-49dd-8a2a-3f03350c18a2",
      "name": "Agent_IterationDecision",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2144,
        384
      ]
    },
    {
      "id": "086982ae-6aef-43c8-8cd1-228a2fcaebe0",
      "name": "If_NeedMoreIterations",
      "type": "n8n-nodes-base.if",
      "position": [
        2576,
        224
      ]
    },
    {
      "id": "02058dda-acda-4d7d-bf31-062598f91683",
      "name": "Agent_HeadlineEvaluator",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1712,
        384
      ]
    },
    {
      "id": "14734fe9-5368-40b6-b386-df80aa281507",
      "name": "Agent_EvalCriteriaBuilder",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1264,
        384
      ]
    },
    {
      "id": "ff7e0559-fc28-4be8-bf1b-492e4cbcb3f9",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        -272
      ],
      "parameters": {
        "width": 1300,
        "height": 320,
        "content": "=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tip"
      }
    },
    {
      "id": "d3cbada6-0cbe-42cb-b7a9-600bd1c1a567",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1216,
        96
      ],
      "parameters": {
        "width": 1289,
        "height": 2214,
        "content": "# Generate and Auto-Evaluate Facebook Ad Headlines using GPT-4o-mini\n\nBuilt with **n8n + OpenAI**\n\nThis workflow captures a product description, generates ad headlines, evaluates them with custom crit"
      }
    }
  ],
  "connections": {
    "LLM_BottomLineModel": {
      "ai_languageModel": [
        [
          {
            "node": "Agent_IterationDecision",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Agent_HeadlineWriter": {
      "main": [
        [
          {
            "node": "Agent_EvalCriteriaBuilder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If_NeedMoreIterations": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM_EvalCriteriaModel": {
      "ai_languageModel": [
        [
          {
            "node": "Agent_EvalCriteriaBuilder",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set_PromptForHeadline": {
      "main": [
        [
          {
            "node": "Agent_HeadlineWriter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent_HeadlineEvaluator": {
      "main": [
        [
          {
            "node": "Agent_IterationDecision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Agent_IterationDecision": {
      "main": [
        [
          {
            "node": "If_NeedMoreIterations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM_HeadlineWriterModel": {
      "ai_languageModel": [
        [
          {
            "node": "Agent_HeadlineWriter",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Agent_EvalCriteriaBuilder": {
      "main": [
        [
          {
            "node": "Agent_HeadlineEvaluator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM_HeadlineEvaluatorModel": {
      "ai_languageModel": [
        [
          {
            "node": "Agent_HeadlineEvaluator",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "FormTrigger_CopywritingBrief": {
      "main": [
        [
          {
            "node": "Set_PromptForHeadline",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}