IMAP Trigger not working

Hello N8N community,

I hope this post finds you well. I am currently facing an issue with my N8N (using 1.18.2 with Docker and Postgresql) workflow, and I would appreciate any insights or assistance you could provide.

Problem Description: I have set up a workflow that processes new emails from a mailbox. The workflow involves marking the email as read and then processing a PDF file before sending it via SMTP. When I manually execute the workflow using “Execute Workflow,” everything works as expected. However, when the workflow is triggered automatically, only the step to mark the email as read is executed, and the nodes for processing the PDF file do not run.

I am reaching out to the community to seek guidance on what might be causing this discrepancy between manual and automatic execution. If anyone has experienced a similar issue or has insights into potential solutions, your input would be highly appreciated.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @th142,

That is odd, Does the execution log show the workflow running at all? Can you also share which email provider you are using?

Hey, no, the execution (when the trigger runs) is not in the log. Mail provider is mittwald (webhosting provider in germany).

Can you try enabling debug logging on your n8n instance and when it fails next send over the log so I can take a look?

When sending a new message:

workflows-app-1  | 2023-12-08T13:14:59.017Z | debug    | Querying for new messages on node "EmailReadImap" "{\n  searchCriteria: [\n    'UNSEEN',\n    [ 'HEADER', 'SUBJECT', 'Ihre EnBW mobility+ Rechnung' ],\n    [ 'UID', '22:*' ],\n    [ 'UID', '22:*' ],\n    [ 'UID', '22:*' ]\n  ],\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"

When executing manually:

workflows-app-1  | 2023-12-08T13:15:59.850Z | verbose  | Execution for workflow EnBW-Rechnung (Tobi) was assigned id 65 "{\n  executionId: '65',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"
workflows-app-1  | 2023-12-08T13:15:59.879Z | debug    | Execution ID 65 will run executing all nodes. "{\n  executionId: '65',\n  file: 'WorkflowRunner.js',\n  function: 'runMainProcess'\n}"
workflows-app-1  | 2023-12-08T13:15:59.882Z | verbose  | Workflow execution started "{\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.verbose'\n}"
workflows-app-1  | 2023-12-08T13:15:59.887Z | debug    | Executing hook (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteBefore'\n}"
workflows-app-1  | 2023-12-08T13:15:59.888Z | debug    | Send data of type "executionStarted" to editor-UI "{\n  dataType: 'executionStarted',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:15:59.896Z | debug    | Start processing node "Warte auf neue EnBW-Rechnung" "{\n  node: 'Warte auf neue EnBW-Rechnung',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:15:59.899Z | debug    | Executing hook on node "Warte auf neue EnBW-Rechnung" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
workflows-app-1  | 2023-12-08T13:15:59.901Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:15:59.904Z | debug    | Running node "Warte auf neue EnBW-Rechnung" started "{\n  node: 'Warte auf neue EnBW-Rechnung',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:15:59.939Z | debug    | Loaded static data for node "EmailReadImap" "{ staticData: {}, file: 'LoggerProxy.js', function: 'exports.debug' }"
workflows-db-1   | 2023-12-08 13:16:00.265 UTC [22] LOG:  checkpoint complete: wrote 41 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.023 s, sync=0.008 s, total=4.041 s; sync files=17, longest=0.004 s, average=0.001 s; distance=215 kB, estimate=512 kB
workflows-app-1  | 2023-12-08T13:16:00.519Z | debug    | Running node "Warte auf neue EnBW-Rechnung" finished successfully "{\n  node: 'Warte auf neue EnBW-Rechnung',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:00.521Z | debug    | Executing hook on node "Warte auf neue EnBW-Rechnung" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:00.523Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:00.529Z | debug    | Start processing node "Details der Ladungen aus PDF entfernen" "{\n  node: 'Details der Ladungen aus PDF entfernen',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:00.531Z | debug    | Executing hook on node "Details der Ladungen aus PDF entfernen" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
workflows-app-1  | 2023-12-08T13:16:00.532Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:00.534Z | debug    | Running node "Details der Ladungen aus PDF entfernen" started "{\n  node: 'Details der Ladungen aus PDF entfernen',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:00.571Z | debug    | Send data of type "sendConsoleMessage" to editor-UI "{\n  dataType: 'sendConsoleMessage',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:00.609Z | debug    | Proxying request to axios "{ file: 'LoggerProxy.js', function: 'exports.debug' }"
workflows-app-1  | 2023-12-08T13:16:01.215Z | debug    | Running node "Details der Ladungen aus PDF entfernen" finished successfully "{\n  node: 'Details der Ladungen aus PDF entfernen',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:01.219Z | debug    | Executing hook on node "Details der Ladungen aus PDF entfernen" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:01.219Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:01.229Z | debug    | Start processing node "PDF-Namen zuweisen" "{\n  node: 'PDF-Namen zuweisen',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:01.231Z | debug    | Executing hook on node "PDF-Namen zuweisen" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
workflows-app-1  | 2023-12-08T13:16:01.232Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:01.234Z | debug    | Running node "PDF-Namen zuweisen" started "{\n  node: 'PDF-Namen zuweisen',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:01.316Z | debug    | Running node "PDF-Namen zuweisen" finished successfully "{\n  node: 'PDF-Namen zuweisen',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:01.319Z | debug    | Executing hook on node "PDF-Namen zuweisen" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:01.320Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:01.330Z | debug    | Start processing node "E-Mail an Einkauf versenden" "{\n  node: 'E-Mail an Einkauf versenden',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:01.333Z | debug    | Executing hook on node "E-Mail an Einkauf versenden" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteBefore'\n}"
workflows-app-1  | 2023-12-08T13:16:01.334Z | debug    | Send data of type "nodeExecuteBefore" to editor-UI "{\n  dataType: 'nodeExecuteBefore',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:01.336Z | debug    | Running node "E-Mail an Einkauf versenden" started "{\n  node: 'E-Mail an Einkauf versenden',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:02.157Z | debug    | Running node "E-Mail an Einkauf versenden" finished successfully "{\n  node: 'E-Mail an Einkauf versenden',\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.debug'\n}"
workflows-app-1  | 2023-12-08T13:16:02.160Z | debug    | Executing hook on node "E-Mail an Einkauf versenden" (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'nodeExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:02.161Z | debug    | Send data of type "nodeExecuteAfter" to editor-UI "{\n  dataType: 'nodeExecuteAfter',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"
workflows-app-1  | 2023-12-08T13:16:02.165Z | verbose  | Workflow execution finished successfully "{\n  workflowId: '1',\n  file: 'LoggerProxy.js',\n  function: 'exports.verbose'\n}"
workflows-app-1  | 2023-12-08T13:16:02.166Z | debug    | Executing hook (hookFunctionsSave) "{\n  executionId: '65',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:02.169Z | debug    | Save execution data to database for execution ID 65 "{\n  executionId: '65',\n  workflowId: '1',\n  finished: true,\n  stoppedAt: 2023-12-08T13:16:02.164Z,\n  file: 'sharedHookFunctions.js',\n  function: 'updateExistingExecution'\n}"
workflows-app-1  | 2023-12-08T13:16:02.260Z | debug    | Executing hook (hookFunctionsPush) "{\n  executionId: '65',\n  sessionId: 'qaunw7cj559',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:02.261Z | debug    | Save execution progress to database for execution ID 65  "{\n  executionId: '65',\n  workflowId: '1',\n  file: 'WorkflowExecuteAdditionalData.js',\n  function: 'workflowExecuteAfter'\n}"
workflows-app-1  | 2023-12-08T13:16:02.262Z | debug    | Send data of type "executionFinished" to editor-UI "{\n  dataType: 'executionFinished',\n  sessionIds: 'qaunw7cj559',\n  file: 'abstract.push.js',\n  function: 'sendToSessions'\n}"

Hey @th142,

Do you have the full log? The manual execution works differently to the scheduled execution as when scheduled it uses the saved IDs.