Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.
```
<your workflow>
```
That implies to any JSON output you would like to share with us.
Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!
It all comes down to undestanding how Docker works. For n8n container to be able to connect to the other container (here postgres) both have to be on the same network. If they are (which they should if you used the same docker-compose.yml file) you can connect to Posgres by referencing the host by the container name.
Here’s an example.
I have this set up in the configuration file in relation to postgres
Note I gave the container a name “postgres-ai-kit”. Also note that connecting to Postgres relies on the variables set already, namely POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB. Make sure those are set (with their values) in .env file in the root folder of the repository.