Postgresql Missing Command


GCP’s tech support advised me to contact N8N regarding the Configure n8n deployment of my PostgreSQL (e.g., Create a volume for file storage, Pod resources, Environment variables) error message: Command Not Found (See captured screenshot images for details).

Reference source, Community, Google Cloud | n8n Docs

Can you provide assistance on how to deploy my N8N PostgreSQL?


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:

Hi @DevCED-Team,

To configure n8n to use Postgres you will need to create a database and user in your postgres instance and set the environment variables which can be found here: Supported databases and settings | n8n Docs to let n8n know which database it is connecting to.

An example of this can be found below.

export DB_TYPE=postgresdb
export DB_POSTGRESDB_HOST=postgresdb

Which GCP firewall rule port 5432 should we use:

(1) Ingress rules are concerned with managing incoming traffic, specifying what is allowed to enter a network or system.

(2) Egress rules are concerned with managing outgoing traffic, specifying what is allowed to leave a network or system.

Hey @DevCED-Team,

That doesn’t sound like an n8n setting and is more related to your GCP configuration which we don’t support. We consider self hosting n8n an advanced configuration option and a pre-req for this is the knowledge to manage the environment you are planning to use.

In this case to actually answer the question though the data will be going from n8n to Postgres so it would be an ingress rule on your database and an egress rule for your n8n instance. I would strongly recommend getting in touch with someone who can help you set up your Google environment as if you configure it incorrectly you may potentially leave your data at risk


I will run the n8n Google Docker installation, which is different from the n8n Google Kubernetes installation. My use case is to install an n8n Python module node. Please see the attached screenshot of the n8n cloud workflow error message.


Hey. @DevCED-Team,

Can you share the actual workflow so we can see what you are doing? That error looks like you are trying to use n8n as a module which doesn’t exist, It is also important to note that when using Python in n8n you are limited to the pyodide packages.

Hi everyone,

Here is the N8N Workflow gist link, Cloudflare Workers to IMAP - N8N Workflow · GitHub


Hi Jon,

Visit the following gist link to view the workflow, Cloudflare Workers to IMAP - N8N Workflow · GitHub


Hey @DevCED-Team,

It looks like you are trying to import from n8n which doesn’t exist. You can find a bit more information about the Python support and the packages supported here: Code node | n8n Docs


Does the error message (Error: ModuleNotFoundError: No module named ‘n8n’) refer to either:

(1) External libraries#
If you self-host n8n, you can import and use built-in and external npm modules in the Code node. To learn how to enable external modules, refer the Configuration guide.

(2) Built-in methods and variables#
n8n provides built-in methods and variables for working with data and accessing n8n data. Refer to Built-in methods and variables for more information.

The syntax to use the built-in methods and variables is _variableName or _methodName(). Type _ in the Code node to see a list of suggested methods and variables.



Are these local directory modules available on the n8n online version(External libraries#, Built-in methods and variables#) :

at PythonSandbox.getPrettyError (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/PythonSandbox.js:69:20)
at PythonSandbox.runCodeInPython (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/PythonSandbox.js:56:24)
at PythonSandbox.runCodeEachItem (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/PythonSandbox.js:26:33)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Code/Code.node.js:134:26)
at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:670:19)
at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:652:53


Hey @DevCED-Team,

Does the error message (Error: ModuleNotFoundError: No module named ‘n8n’) refer to either:

This is what I mentioned previously, There is no python module called n8n that you can import anything from so if you were doing something like from n8n.core.node_context import NodeContext I would expect it to fail. Out of interest where did you see this documented?

The paths in your second part are from the error and point to code paths for where the issue is coming from, These are not directories you would access and they are javascript files not python so would likely not make that much of a difference.

Code node in n8n supports Python, Code | n8n Docs

My best option is self hosting?

Hey @DevCED-Team,

The Code node does support Python but you are trying to use a package that doesn’t exist which is why you are seeing the error. Self hosting could be an option but if you try running the code you are using now it will still fail.

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