{
  "name": "Parse Gmail inbox and transform into Todoist tasks with Solve Propositions",
  "nodes": [
    {
      "id": "5b711a67-3d03-4687-a550-0514e2a5d251",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -220,
        100
      ]
    },
    {
      "id": "5862ae85-d48b-49a6-9c9f-4a682d42af78",
      "name": "Mark As Read",
      "type": "n8n-nodes-base.gmail",
      "position": [
        580,
        -240
      ]
    },
    {
      "id": "19655c59-dc43-4d3d-aaa1-a23e0b5c64e2",
      "name": "Star",
      "type": "n8n-nodes-base.gmail",
      "position": [
        780,
        -240
      ]
    },
    {
      "id": "62eeda04-39b2-4423-90e4-7d6518210b00",
      "name": "Get Starred From Inbox",
      "type": "n8n-nodes-base.gmail",
      "position": [
        300,
        20
      ]
    },
    {
      "id": "dfd857e6-7728-4d7e-88ad-c20ffab1a90b",
      "name": "Get Unread From Inbox",
      "type": "n8n-nodes-base.gmail",
      "position": [
        300,
        -160
      ]
    },
    {
      "id": "a864282e-c50c-4719-a813-dc407f28043b",
      "name": "If Task Not Exist",
      "type": "n8n-nodes-base.if",
      "position": [
        -140,
        800
      ]
    },
    {
      "id": "7f0ce1d6-14de-4087-b3f1-542cf38e5df3",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        220,
        820
      ]
    },
    {
      "id": "7e314e74-1f3e-460e-99f2-7338e3f4627e",
      "name": "Structure Output Todoist Ready",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        600,
        820
      ]
    },
    {
      "id": "a36464d3-917c-4a8c-bd4b-f5ae21e3d758",
      "name": "If AI responded properly",
      "type": "n8n-nodes-base.if",
      "position": [
        740,
        580
      ]
    },
    {
      "id": "4d2de14b-719d-44f2-a207-94cc4394738a",
      "name": "Create Todoist Task",
      "type": "n8n-nodes-base.todoist",
      "position": [
        980,
        560
      ]
    },
    {
      "id": "25fddc8e-6781-473a-9978-aae3c900e39a",
      "name": "Get Full Message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        140,
        580
      ]
    },
    {
      "id": "7531e446-4d17-460f-b3c4-6830c01060c0",
      "name": "Summarize Message",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        340,
        580
      ]
    },
    {
      "id": "5034b666-de2f-42f4-8b3a-3a4e36ca52a7",
      "name": "Enrich Emails With Tasks",
      "type": "n8n-nodes-base.merge",
      "position": [
        760,
        380
      ]
    },
    {
      "id": "ec352eb7-7670-47ab-b16e-6407b9a69455",
      "name": "Enrich Tasks with Emails",
      "type": "n8n-nodes-base.merge",
      "position": [
        900,
        180
      ]
    },
    {
      "id": "e3a513f0-8113-4bcc-990f-c113a1086bc6",
      "name": "If Email Unstarred (Not Exist)",
      "type": "n8n-nodes-base.if",
      "position": [
        -200,
        1160
      ]
    },
    {
      "id": "5acaa018-6592-4449-8ff4-9225f8ed28c5",
      "name": "Close Task",
      "type": "n8n-nodes-base.todoist",
      "position": [
        80,
        1100
      ]
    },
    {
      "id": "4004e68a-4dcf-4216-bd01-2f2da0eeba77",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "position": [
        -220,
        -80
      ]
    },
    {
      "id": "0e986c57-a016-4053-acb3-08e3b3a7af08",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -220,
        -260
      ]
    },
    {
      "id": "fe1012a0-638f-469f-af09-f30a890a4937",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        0,
        100
      ]
    },
    {
      "id": "5e09f039-53cc-4473-ab60-5c1337ab75af",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -280,
        -360
      ],
      "parameters": {
        "width": 500,
        "height": 660,
        "content": "## Select Trigger\n**This workflow will work with many triggers**"
      }
    },
    {
      "id": "1874a3c5-7467-4642-9ce4-7171b6e76af7",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -380
      ],
      "parameters": {
        "width": 560,
        "height": 320,
        "content": "## Read and Star\n**Mark messages as Read and add Star to them**\nYou can delete this section if you don't want to make this happen automatically to your emails"
      }
    },
    {
      "id": "c8f68aac-971c-427d-8b74-167d78b37037",
      "name": "Merge Starred and Unread Messages",
      "type": "n8n-nodes-base.merge",
      "position": [
        600,
        40
      ]
    },
    {
      "id": "7eab417d-6332-45d9-be0d-ba7b8888dd91",
      "name": "Get Open Tasks",
      "type": "n8n-nodes-base.todoist",
      "position": [
        300,
        200
      ]
    },
    {
      "id": "60071d08-d333-475e-a48b-cdb9c19eb7a2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        1000
      ],
      "parameters": {
        "width": 720,
        "height": 340,
        "content": "## Close Task\n**If Email was Unstarred manually by you, then we can probably close task, so we are closing it**"
      }
    },
    {
      "id": "780d6400-226b-4da6-8d33-6f7977fcbb2d",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        380
      ],
      "parameters": {
        "width": 1420,
        "height": 600,
        "content": "## Make New Task in Todoist\nIf there is no task on Todoist with same subject as your either starred or unread message, then it's time to create one.\nBut to make it easier for you to close tasks and em"
      }
    }
  ],
  "connections": {
    "Close Task": {
      "main": [
        []
      ]
    },
    "Mark As Read": {
      "main": [
        [
          {
            "node": "Star",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Open Tasks": {
      "main": [
        [
          {
            "node": "Enrich Emails With Tasks",
            "type": "main",
            "index": 1
          },
          {
            "node": "Enrich Tasks with Emails",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Full Message": {
      "main": [
        [
          {
            "node": "Summarize Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Task Not Exist": {
      "main": [
        [
          {
            "node": "Get Full Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Message",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Message": {
      "main": [
        [
          {
            "node": "If AI responded properly",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Trigger (IMAP)": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Unread From Inbox": {
      "main": [
        [
          {
            "node": "Mark As Read",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge Starred and Unread Messages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Starred From Inbox": {
      "main": [
        [
          {
            "node": "Merge Starred and Unread Messages",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Enrich Emails With Tasks": {
      "main": [
        [
          {
            "node": "If Task Not Exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich Tasks with Emails": {
      "main": [
        [
          {
            "node": "If Email Unstarred (Not Exist)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If AI responded properly": {
      "main": [
        [
          {
            "node": "Create Todoist Task",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "No Operation, do nothing": {
      "main": [
        [
          {
            "node": "Get Unread From Inbox",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Starred From Inbox",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Open Tasks",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Email Unstarred (Not Exist)": {
      "main": [
        [
          {
            "node": "Close Task",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure Output Todoist Ready": {
      "ai_outputParser": [
        [
          {
            "node": "Summarize Message",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Merge Starred and Unread Messages": {
      "main": [
        [
          {
            "node": "Enrich Emails With Tasks",
            "type": "main",
            "index": 0
          },
          {
            "node": "Enrich Tasks with Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}