This behavior usually comes from how n8n writes the file, not from the Wazuh path/permissions:
Make sure each event is written as a complete line and ends with a newline (\n) (one event per line / JSONL). If the last line isn’t terminated, wazuh-logcollector may not ingest it until another change happens (your “manual edit” effect).
Ensure n8n appends to the same file (no truncate/overwrite/atomic replace). If the file is being replaced, consider monitoring with a wildcard in <localfile> so Wazuh can re-match the file.
If you restarted components during tests, review <only-future-events> (set to no if you need it to read events written while logcollector was stopped). ref: https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/localfile.html
Quick validation: try echo "test\n" >> /path/to/file (must include the newline). If Wazuh ingests that but not n8n writes, it confirms it’s the writer format/mode.