Warning "Workflow is activated, but could not be started."

I have noticed from time to time a warning triangle appearing next to the Active toggle switch for some of my workflows that states “Workflow is activated, but could not be started.” These workflows work fine without errors so I’m at a loss why I get these messages.

I have been de-activating and re-activating the affected workflows, but is there any way to track down this issue to avoid it?

You can add an Error Trigger Node to the workflow. Like that you can get directly informed when that happens (for example via Email or Slack) and you can see the error which is causing this issue.

Thanks for the quick response, @jan.

I created an Error Trigger workflow to be notified going forward, but I believe the error message generated was not too helpful in tracking down the issue.

I unfortunately do not have access to the error message now since I de-activated and re-activated the affected workflows, but I’ll update this thread when it occurs again.

Hi @jan .

My Error Trigger node activated with this issue for one of my workflows, but it didn’t provide any useful information (all the error node fields were blank).

Any other suggestions to track down the issue?

Some further information which may or may not be helpful to diagnose the issue…the workflows having this issue are all triggered by an EmailReadImap node (Gmail). I added the Force Reconnect option to 60 previously after I first encountered this issue. Also this particular workflow has not been triggered for several days.

snip

snip2

I just looked at the execution for the Error Trigger node and it generated this as the trigger…

{
  "error": {
    "context": {},
    "name": "WorkflowActivationError",
    "cause": {
      "message": "connection timed out. timeout = 20000 ms",
      "stack": "ConnectionTimeoutError: connection timed out. timeout = 20000 ms\n    at Connection.imapOnError (/usr/local/lib/node_modules/n8n/node_modules/imap-simple/lib/imapSimple.js:544:23)\n    at Object.onceWrapper (node:events:642:26)\n    at Connection.emit (node:events:527:28)\n    at Connection.emit (node:domain:475:12)\n    at Timeout._onTimeout (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:141:12)\n    at listOnTimeout (node:internal/timers:559:17)\n    at processTimers (node:internal/timers:502:7)"
    },
    "timestamp": 1658231467759,
    "message": "There was a problem activating the workflow",
    "node": {
      "parameters": {
        "mailbox": "=n8n/Application Started",
        "postProcessAction": "read",
        "format": "resolved",
        "dataPropertyAttachmentsPrefixName": "attachment_",
        "options": {
          "customEmailConfig": "[\"UNSEEN\"]",
          "allowUnauthorizedCerts": true,
          "forceReconnect": 60
        }
      },
      "name": "IMAP - Application Started",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 1,
      "position": [
        1160,
        260
      ],
      "credentials": {
        "imap": {
          "id": "6",
          "name": "IMAP [email protected]"
        }
      }
    }
  },
  "mode": "internal"
}

Thanks for providing that information.

You did sadly decide to delete the issues template instead of filling it (please do not do that, it is there for a reason) so I do not know what version you are running. That information is however important as we made recently changes to the node. So can you please share which n8n version you have installed and if you run it locally or on our cloud?

Sorry @jan and thanks for the quick reply. I usually use the template when encountering an issue, but it didn’t seem to apply when I first submitted this.

I am running n8n on my own server installed with docker and currently on version 0.185.0.

Also in case it helps, I have 5 workflows that monitor different labels of the same Gmail account. Only this workflow is currently experiencing this issue although I have had several workflows affected in the past.

Thanks a lot. In this case the fix is already in the version you are using. So upgrading will said not help. @krynble could you please have a look at some point as you worked on that node before. Thanks!

Just experienced this issue again, @jan. This time 3 of 6 workflows that all use the same IMAP credentials (monitoring different Gmail labels) were affected within a 2 minute period (see below for output generated by the Error Trigger node for one of the workflows).

BTW the EmailReadImap node also has another issue where it fails to trigger upon an incoming email from time to time, but I have been unable to track that down yet since it never executes (no error or execution generated by n8n).

{
  "error": {
    "context": {},
    "name": "WorkflowActivationError",
    "cause": {
      "message": "connection timed out. timeout = 20000 ms",
      "stack": "ConnectionTimeoutError: connection timed out. timeout = 20000 ms\n    at Connection.imapOnError (/usr/local/lib/node_modules/n8n/node_modules/imap-simple/lib/imapSimple.js:544:23)\n    at Object.onceWrapper (node:events:642:26)\n    at Connection.emit (node:events:527:28)\n    at Connection.emit (node:domain:475:12)\n    at Timeout._onTimeout (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:141:12)\n    at listOnTimeout (node:internal/timers:559:17)\n    at processTimers (node:internal/timers:502:7)"
    },
    "timestamp": 1658924213484,
    "message": "There was a problem activating the workflow",
    "node": {
      "parameters": {
        "mailbox": "n8n/Homebot",
        "postProcessAction": "read",
        "format": "resolved",
        "dataPropertyAttachmentsPrefixName": "attachment_",
        "options": {
          "customEmailConfig": "[\"UNSEEN\",[\"SUBJECT\",\"sent you a message\"]]",
          "allowUnauthorizedCerts": true,
          "forceReconnect": 60
        }
      },
      "name": "IMAP Email",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 1,
      "position": [
        240,
        460
      ],
      "credentials": {
        "imap": {
          "id": "6",
          "name": "IMAP [email protected]"
        }
      }
    }
  },
  "mode": "internal"
} 

Another error, @jan, but for a different reason this time. It appears that these errors are specific to the EmailReadImap node (perhaps as it communicates with Google Workspace/Gmail?).

I am heavily dependent on this node to process incoming leads. Has the issue been tracked down or is the node being worked on?

Thanks in advance for your help.

{
  "error": {
    "context": {},
    "name": "WorkflowActivationError",
    "cause": {
      "message": "No mailbox is currently selected",
      "stack": "Error: No mailbox is currently selected\n    at Connection._search (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:571:11)\n    at Connection.search (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:566:8)\n    at /usr/local/lib/node_modules/n8n/node_modules/imap-simple/lib/imapSimple.js:129:19\n    at new Promise (<anonymous>)\n    at ImapSimple.search (/usr/local/lib/node_modules/n8n/node_modules/imap-simple/lib/imapSimple.js:127:12)\n    at getNewEmails (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/EmailReadImap/EmailReadImap.node.js:219:46)\n    at Connection.onmail (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/EmailReadImap/EmailReadImap.node.js:346:54)\n    at Connection.emit (node:events:539:35)\n    at Connection.emit (node:domain:475:12)\n    at Connection._resUntagged (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:1287:14)\n    at Parser.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Connection.js:191:10)\n    at Parser.emit (node:events:527:28)\n    at Parser.emit (node:domain:475:12)\n    at Parser._resUntagged (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:271:10)\n    at Parser._parse (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:137:16)\n    at Parser._tryread (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:82:15)\n    at TLSSocket.Parser._cbReadable (/usr/local/lib/node_modules/n8n/node_modules/imap/lib/Parser.js:53:12)\n    at TLSSocket.emit (node:events:527:28)\n    at TLSSocket.emit (node:domain:475:12)\n    at emitReadable_ (node:internal/streams/readable:578:12)\n    at processTicksAndRejections (node:internal/process/task_queues:82:21)"
    },
    "timestamp": 1659483933014,
    "message": "There was a problem with the trigger, for that reason did the workflow had to be deactivated",
    "node": {
      "parameters": {
        "mailbox": "=n8n/Application Started",
        "postProcessAction": "read",
        "format": "resolved",
        "dataPropertyAttachmentsPrefixName": "attachment_",
        "options": {
          "customEmailConfig": "[\"UNSEEN\"]",
          "allowUnauthorizedCerts": true,
          "forceReconnect": 60
        }
      },
      "name": "IMAP - Application Started",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 1,
      "position": [
        1160,
        260
      ],
      "credentials": {
        "imap": {
          "id": "6",
          "name": "IMAP [email protected]"
        }
      }
    }
  },
  "mode": "trigger"
}