504 Bad gateway error

Describe the problem/error/question
I am running a Playwright-based web crawler through n8n. The crawler works correctly locally, but when executed in a Kubernetes (EKS) environment, the HTTP Request node often fails with a NodeApiError: Gateway timed out - perhaps try again later?. The crawler itself completes successfully, so the issue seems related to timeouts in the network path or n8n settings.

What is the error message (if any)?

NodeApiError: Gateway timed out - perhaps try again later? at ExecuteContext.execute ...

and sometimes 504 Gateway Time-out.

Please share your workflow

  • The workflow uses an HTTP Request node to call an API endpoint that triggers the Playwright crawler.

  • The API receives merchant data and returns results.

  • Data structure example:

[
  { "merchant": { "bizno": "1234", "partnercode": "ABC", ... } },
  { "merchant": { "bizno": "124123", "partnercode": "ABC", ... } }
]

  • The workflow may transform or wrap this JSON before sending it to the API.

Share the output returned by the last node

  • Sometimes the node returns nothing due to timeout.

  • The API itself is returning valid results if called directly outside n8n.

Information on your n8n setup

  • n8n version: latest

  • Database: SQLite, pool size 5

  • EXECUTIONS_PROCESS: worker mode enabled (N8N_RUNNERS_ENABLED=true)

  • Running n8n via: Docker in Kubernetes (EKS)

  • Operating system: Debian slim image (Python 3.13, Playwright installed)

Attempts and adjustments made

  1. Increased n8n internal timeouts:

    • EXECUTIONS_TIMEOUT=7200 (2 hours)

    • EXECUTIONS_TIMEOUT_MAX=7200

    • N8N_WORKFLOW_TIMEOUT=7200

    • N8N_DEFAULT_TIMEOUT=7200000 (ms)

  2. Configured ALB ingress annotations:

    • alb.ingress.kubernetes.io/idle-timeout='3600'
  3. Adjusted HTTP Request node:

    • Tried json=false, useStream=true, and then json=true, useStream=false
  4. Verified the crawler runs normally locally and in k8s, with headless browser and necessary fonts.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.