Polling not working or am I doing something wrong?

Describe the issue/error/question

Hi n8n community!

I am thinking I’m doing something wrong… I installed n8n and created a clockify trigger. My goal is to pass all clockify entries to my invoiceninja system. The flow is working perfectly (except for all entries being sent, but that’s another issue) when I click execute workflow. However when I set the polling interval to 1 minute, nothing happens. Setting it to different polling intervals also doesn’t change anything. I also tested the cron trigger, which is executing just fine.

Is this something I do wrong? Or did I not configure n8n correctly?

Thanks in advance!

Please share the workflow

{
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "workspaceId": ""
      },
      "name": "Clockify Trigger",
      "type": "n8n-nodes-base.clockifyTrigger",
      "typeVersion": 1,
      "position": [
        100,
        300
      ],
      "credentials": {
        "clockifyApi": {
          "id": "",
          "name": ""
        }
      },
      "continueOnFail": true
    },
    {
      "parameters": {
        "resource": "task",
        "additionalFields": {
          "client": 23,
          "description": "={{$json[\"project\"][\"name\"]}}: {{$json[\"description\"]}} ({{$json[\"timeInterval\"][\"start\"]}} - {{$json[\"timeInterval\"][\"end\"]}})",
          "project": 
        },
        "timeLogsUi": {
          "timeLogsValues": [
            {
              "startDate": "={{$json[\"timeInterval\"][\"start\"]}}",
              "endDate": "={{$json[\"timeInterval\"][\"end\"]}}"
            }
          ]
        }
      },
      "name": "Invoice Ninja",
      "type": "n8n-nodes-base.invoiceNinja",
      "typeVersion": 1,
      "position": [
        660,
        300
      ],
      "credentials": {
        "invoiceNinjaApi": {
          "id": "",
          "name": ""
        }
      }
    }
  ],
  "connections": {
    "Clockify Trigger": {
      "main": [
        [
          {
            "node": "Invoice Ninja",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.155.2
  • Database you’re using (default: SQLite): Postgresql
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: docker(caprover)

Hey @krozendaal, welcome to the community!

n8n behaves differently for test data (the data obtained when manually testing a workflow by clicking Execute Workflow/Node) and production data (data processed in the background by active workflows). Only test data would be visible in your canvas whereas regular production execution data does not show up as it comes in.

So the first step coming to my mind here would be to check whether you have activated your workflow? There’s a little toggle in the upper right corner, if it’s green your workflow is active:
image

Next step would be to check whether execution data is stored for your workflow which can be done in the workflow settings (available in the left sidebar under Workflows > Settings):
image

Once your workflow is active and your data is stored, you would need to create a new time entry to be found by the Clockify Trigger.

Once the polling interval has passed, you should then see your past executions in the executions list (Executions in the left sidebar). You can then pull the data through the button with the little folder icon on it:

Hi MutedJam,

Thanks for your reply! I checked your comments and they were all set correctly. I digged a little deeper now and I noticed some strange behaviour where some small tasks (less than 1 minute) where synced, however larger tasks (more than 1 minute) where not. I checked the source code of the node and then it hit me. The start and end times are added as query parameters to the API request, which is something like: start → Last checking time and end → current time. When the polling interval is set to 1 minute, the start will always be less than 1 minute from the current time and end being the current time. So there is only a small window when the entry actually shows up in the api. I guess this node shouldn’t be able to poll more than once per day, and even then you should be carefull to set a custom schedule (e.g. to a moment you’re definitely not using clockify). When you’re using clockify and it checks the start date and time will be updated, which leads to the entry never again being within the timeframe again. I don’t think this is correct behaviour in terms of functionality, it does however work when being tested. For now it might be a bug or maybe it’s intentional. I don’t know. But my issue seems solved :slight_smile:

1 Like

Wow, that was quite some investigation. This is great feedback and the behavior also seem unexpected to me. I shall add this to our internal bug tracker for a closer look.

Thanks so much for sharing!

No problem, thanks for the great application and community!