{
  "name": "Create an autonomous task-handling AI agent with OpenAI and Slack",
  "nodes": [
    {
      "id": "4c4ac089-ee21-4363-9bdc-fbf8bedfc52a",
      "name": "Readme",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        912
      ],
      "parameters": {
        "width": 900,
        "height": 664,
        "content": "## n8n Antigravity AI Automation: Create Autonomous Task-Handling AI Agent\n\nThis workflow creates a self-improving AI agent inside n8n that can understand natural language tasks, plan steps, use tools"
      }
    },
    {
      "id": "a4ba1f88-6239-4a56-bf2e-dc127652f8e3",
      "name": "Input",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        1056
      ],
      "parameters": {
        "width": 428,
        "height": 444,
        "content": "## 1. Input"
      }
    },
    {
      "id": "31dba07e-8849-45ab-9d9c-aff436a7d73a",
      "name": "Planning",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        784,
        1040
      ],
      "parameters": {
        "width": 628,
        "height": 480,
        "content": "## 2. Planning"
      }
    },
    {
      "id": "781af996-5a7e-446e-af73-90f2d32bbc47",
      "name": "Loop",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        768
      ],
      "parameters": {
        "width": 1064,
        "height": 780,
        "content": "## 3. Agent Loop"
      }
    },
    {
      "id": "ab00a7e5-4f8b-4426-9b01-c1f9068db931",
      "name": "Output",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2592,
        912
      ],
      "parameters": {
        "width": 508,
        "height": 620,
        "content": "## 4. Output"
      }
    },
    {
      "id": "8bd1ac0e-4715-422e-a01e-42e918bc563b",
      "name": "Webhook: Start Agent",
      "type": "n8n-nodes-base.webhook",
      "position": [
        384,
        1232
      ]
    },
    {
      "id": "822a91cd-8035-497f-a14c-9782d9540390",
      "name": "Initialize Task & Memory",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        1232
      ]
    },
    {
      "id": "22f2ec26-5296-4908-8ba6-64e62da27ee8",
      "name": "LLM: Initial Plan",
      "type": "n8n-nodes-base.openAi",
      "position": [
        832,
        1232
      ]
    },
    {
      "id": "836a5880-be68-462c-b9be-17bec27ab198",
      "name": "Already Finished?",
      "type": "n8n-nodes-base.if",
      "position": [
        1056,
        1232
      ]
    },
    {
      "id": "3f6072e0-a74f-4321-bb05-c99b2a1d1c09",
      "name": "Loop Control",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1488,
        1376
      ]
    },
    {
      "id": "67f9c4bf-f171-40d6-8bce-db2921f711f2",
      "name": "Parse LLM Output",
      "type": "n8n-nodes-base.code",
      "position": [
        1712,
        1200
      ]
    },
    {
      "id": "39a761b3-90c0-4ded-8806-491f3e780162",
      "name": "Loop → Finish?",
      "type": "n8n-nodes-base.if",
      "position": [
        1936,
        1200
      ]
    },
    {
      "id": "025a750b-6d34-4f7c-924e-d9390fbda05d",
      "name": "Tool → HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2160,
        1152
      ]
    },
    {
      "id": "3aa5fb16-8e16-4ebf-947a-48866bcd7f3f",
      "name": "Other Tools (expand later)",
      "type": "n8n-nodes-base.code",
      "position": [
        2160,
        1344
      ]
    },
    {
      "id": "c8b5784c-847c-4642-b195-6affde217d21",
      "name": "Merge Observations",
      "type": "n8n-nodes-base.merge",
      "position": [
        2384,
        1248
      ]
    },
    {
      "id": "bf6bd74b-4cd1-4f16-a633-360e0a466035",
      "name": "LLM: Reflect → Next",
      "type": "n8n-nodes-base.openAi",
      "position": [
        2608,
        1248
      ]
    },
    {
      "id": "2d1d2f25-7616-4b95-a3dc-5ffd3253468e",
      "name": "Update Memory",
      "type": "n8n-nodes-base.set",
      "position": [
        2832,
        1328
      ]
    },
    {
      "id": "3664d895-4a0c-4c18-846d-a4e8af2fb60a",
      "name": "Prepare Final Result",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        944
      ]
    },
    {
      "id": "7e2064fd-f412-4790-8ced-ce84e650ef24",
      "name": "Notify Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        2336,
        960
      ]
    },
    {
      "id": "36791bda-27b1-4ed9-9852-662cbfbeb438",
      "name": "Wait For Result",
      "type": "n8n-nodes-base.wait",
      "position": [
        2064,
        944
      ]
    }
  ],
  "connections": {
    "Loop Control": {
      "main": [
        [
          {
            "node": "Parse LLM Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Memory": {
      "main": [
        [
          {
            "node": "Loop Control",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait For Result": {
      "main": [
        [
          {
            "node": "Notify Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop → Finish?": {
      "main": [
        [
          {
            "node": "Prepare Final Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Tool → HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "Other Tools (expand later)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse LLM Output": {
      "main": [
        [
          {
            "node": "Loop → Finish?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Already Finished?": {
      "main": [
        [
          {
            "node": "Prepare Final Result",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Control",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM: Initial Plan": {
      "main": [
        [
          {
            "node": "Already Finished?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Observations": {
      "main": [
        [
          {
            "node": "LLM: Reflect → Next",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Final Result": {
      "main": [
        [
          {
            "node": "Wait For Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook: Start Agent": {
      "main": [
        [
          {
            "node": "Initialize Task & Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "LLM: Reflect → Next": {
      "main": [
        [
          {
            "node": "Update Memory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tool → HTTP Request": {
      "main": [
        [
          {
            "node": "Merge Observations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initialize Task & Memory": {
      "main": [
        [
          {
            "node": "LLM: Initial Plan",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Other Tools (expand later)": {
      "main": [
        [
          {
            "node": "Merge Observations",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}