Trouble appending Google Calendar event

I am trying to append a Google Calendar event, but I get a 404 when I enter the event ID. Should I be entering another variable?

It means the event does not exist. Are you sure that Event ID belongs to that calendar?

I believe so, because I created it in an earlier step.

Here is the workflow:

Share the workflow please. Just copy and paste it here.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyHour"
            },
            {
              "mode": "everyHour",
              "minute": 30
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "getAll",
        "team": "8426050",
        "space": "10565749",
        "folder": "17021792",
        "list": "37877844",
        "filters": {}
      },
      "name": "ClickUp",
      "type": "n8n-nodes-base.clickUp",
      "typeVersion": 1,
      "position": [
        650,
        300
      ],
      "credentials": {
        "clickUpOAuth2Api": "OAuth2 [email protected]"
      }
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$node[\"ClickUp\"].json[\"status\"][\"type\"]}}",
              "value2": "open"
            }
          ]
        }
      },
      "name": "IF",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        960,
        130
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "getAll",
        "team": "8426050",
        "space": "10565749",
        "folder": "17021792",
        "list": "35927627",
        "filters": {}
      },
      "name": "ClickUp1",
      "type": "n8n-nodes-base.clickUp",
      "typeVersion": 1,
      "position": [
        1110,
        50
      ],
      "credentials": {
        "clickUpOAuth2Api": "OAuth2 [email protected]"
      }
    },
    {
      "parameters": {
        "batchSize": "=10",
        "options": {}
      },
      "name": "SplitInBatches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        1310,
        30
      ]
    },
    {
      "parameters": {
        "calendar": "[email protected]",
        "start": "2020-12-16T13:00:44.000Z",
        "end": "2020-12-16T15:00:00.000Z",
        "additionalFields": {
          "summary": "Finish Open ClickUp Tasks"
        }
      },
      "name": "Google Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "typeVersion": 1,
      "position": [
        820,
        300
      ],
      "credentials": {
        "googleCalendarOAuth2Api": "[email protected]"
      }
    },
    {
      "parameters": {
        "operation": "update",
        "calendar": "[email protected]",
        "eventId": "={{$node[\"Google Calendar\"].json[\"id\"]}}",
        "updateFields": {
          "description": "={{$node[\"SplitInBatches\"].json[\"name\"]}}: {{$node[\"SplitInBatches\"].json[\"url\"]}}."
        }
      },
      "name": "Google Calendar1",
      "type": "n8n-nodes-base.googleCalendar",
      "typeVersion": 1,
      "position": [
        1500,
        30
      ],
      "credentials": {
        "googleCalendarOAuth2Api": "[email protected]"
      }
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "ClickUp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ClickUp": {
      "main": [
        [
          {
            "node": "Google Calendar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF": {
      "main": [
        [
          {
            "node": "ClickUp1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ClickUp1": {
      "main": [
        [
          {
            "node": "SplitInBatches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SplitInBatches": {
      "main": [
        [
          {
            "node": "Google Calendar1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar": {
      "main": [
        [
          {
            "node": "IF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Can you please explain a bit what you are trying to accomplish? The problem does not seems to be with the Google Calendar node but with how the workflow is setup. This is what I’m understanding

1- You are getting all tasks from a particular list and creating an event on Google Calendar per each task with the same start and end date? That does not seems right.

2- if that task has status open then you want to get all tasks again? that does not seems right either.

3 - Why is the split batches node after the ClickUp1 node? for me that is not needed as the the GoogleCalendar1 node will iterare automatically over all tasks. So if the ClickUp1 returns 100 tasks the GoogleCalendar1 will be executed 100 times. This can be avoided but it’s gonna depend on what you want to do.

Thanks @RicardoE105! Here are my answers:

1- You are getting all tasks from a particular list and creating an event on Google Calendar per each task with the same start and end date? That does not seems right.
2- if that task has status open then you want to get all tasks again? that does not seems right either.

My intention is to create one event per day in which there are incomplete tasks in ClickUp.
Then, I want to add each task to the single event, per day.

  1. Why is the split batches node after the ClickUp1 node? for me that is not needed as the the GoogleCalendar1 node will iterate automatically over all tasks. So if the ClickUp1 returns 100 tasks the GoogleCalendar1 will be executed 100 times. This can be avoided but it’s gonna depend on what you want to do.

I don’t want 100 calendar entries (that would overwhelm me); rather, I want 1 event with the 100 ClickUp tasks.

My intention is to create one event per day in which there are incomplete tasks in ClickUp.

what should be the start and end date for the events?

By incomplete, you mean the ones with status todo and in progress? or you have a status incomplete on your setup?

The date is not necessary, since I only want to list all to do and in progress tasks.

yes, but when creating an event in google calendar you need a start and end date.

This is done in an earlier step:

[

{

“kind”
:
“calendar#event”
,

“etag”
:
"“3216507733316000"”
,

“id”
:
“spl2urcum5i9r5b7o3qge5m5no”
,

“status”
:
“confirmed”
,

“htmlLink”
:
https://www.google.com/calendar/event?eid=c3BsMnVyY3V------JsOGRuN2Rnc2Q2MHE0ZGExN3Nzc2M4NW9AZw
,

“created”
:
“2020-12-18T01:11:06.000Z”
,

“updated”
:
“2020-12-18T01:11:06.658Z”
,

“summary”
:
“Finish Open ClickUp Tasks”
,

“creator”
:
{

“email”
:
jo--------mp.com
,

“displayName”
:
“Josh Fialkoff”

}
,

The error message seems to cite the other Google Calendar component:

ERROR: Google Calendar error response [404]: Not Found

Error: Google Calendar error response [404]: Not Found
    at Object.googleApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Google/Calendar/GenericFunctions.js:28:19)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

I verified that the ID is correct.

Thanks for all of your help!
Josh

Yes, that is happening because the Google Calendar node returns one item, and the Google Calendar1 is getting more than one item as input. Remember the node it’s going to "run" as many times as inputs the node has. So, let’s say the Google Calendar1 is receiving two items as input.

1 Iteration {{$node[“Google Calendar”].json[“id”]}} will return a event id
2 Iteration {{$node[“Google Calendar”].json[“id”]}} will be undefined cuz there no item[2] in the Google Calendar output.

To fix the issue on the Google Calendar1 change the expresion from {{$node["Google Calendar"].json["id"]}} to {{$items(0).$node["Google Calendar"].json["id"]}} to {{$item(0).$node["Google Calendar"].json["id"]}}

Also, I do not think the split batches node there is doing what you think is doing.

Thanks again @RicardoE105! I cloned this and removed the last part of the automation:

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyHour"
            },
            {
              "mode": "everyHour",
              "minute": 30
            }
          ]
        }
      },
      "name": "Cron",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        390,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "operation": "getAll",
        "team": "842xx50",
        "space": "105xx749",
        "folder": "170xx792",
        "list": "378xx844",
        "filters": {}
      },
      "name": "ClickUp",
      "type": "n8n-nodes-base.clickUp",
      "typeVersion": 1,
      "position": [
        550,
        300
      ],
      "credentials": {
        "clickUpOAuth2Api": "OAuth2 [email protected]"
      }
    },
    {
      "parameters": {
        "calendar": "[email protected]",
        "start": "2020-12-16T13:00:44.000Z",
        "end": "2020-12-16T15:00:00.000Z",
        "additionalFields": {
          "summary": "Finish Open ClickUp Tasks"
        }
      },
      "name": "Google Calendar",
      "type": "n8n-nodes-base.googleCalendar",
      "typeVersion": 1,
      "position": [
        700,
        300
      ],
      "credentials": {
        "googleCalendarOAuth2Api": "[email protected]"
      }
    },
    {
      "parameters": {
        "operation": "update",
        "calendar": "[email protected]",
        "eventId": "={{$node[\"Google Calendar\"].json[\"id\"]}}\nhttps://calendar.google.com/calendar/u/0?cid=azJsOGRuN2Rnc2Q2xxxxExN3Nzc2M4NW9AZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ",
        "updateFields": {
          "description": "={{$node[\"SplitInBatches\"].json[\"name\"]}}: {{$node[\"SplitInBatches\"].json[\"url\"]}}."
        }
      },
      "name": "Google Calendar1",
      "type": "n8n-nodes-base.googleCalendar",
      "typeVersion": 1,
      "position": [
        1640,
        150
      ],
      "credentials": {
        "googleCalendarOAuth2Api": "[email protected]"
      }
    }
  ],
  "connections": {
    "Cron": {
      "main": [
        [
          {
            "node": "ClickUp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ClickUp": {
      "main": [
        [
          {
            "node": "Google Calendar",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

When I run it, it produces multiple events. Here’s a screenshot:


My goal is to have one event which consolidates all of the open tasks into the calendar details field.
What do you recommend?

Hey @Josh_Fialkoff!

This is because your ClickUp node might be returning multiple items. Taking a look at your Google Calendar node, I see that you’re passing the same start and end date. Do you want to create events with different Start and End dates?