SSE with Pocketbase

Describe the problem/error/question

I am trying to use Server Sent Events with pocketbase and triggering the correct api from PocketBase. I have already tested this API via Postman and it works as expected

What is the error message (if any)?

The SSE trigger node in n8n runs continuously and never returns an output

Please share your workflow

Share the output returned by the last node

The output is never generated but should look something like this:

The client ID is sent by pocketbase in the realtime connection

Information on your n8n setup

  • n8n version: 1.34.2
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker run command
  • Operating system: Mac OS M1

SSE Trigger is also not working for me. Viewing it view curl in Windows cmd works, just not in n8n through Docker.

Yes, it would be a game changer for my use case, if I could get this to run

bumping this for some attention

It might get more attention as a Github issue.

I’m unable to reproduce this with sse.dev, or with a custom sse server.

Perhaps the issue is on the server-side or on a reverse-proxy (if one is being used).

This would likely be difficult to fix without being able to reproduce it locally.

Thank you for the reply. I will try it once https://sse.dev is back up. Seems to be down right now

@netroy
I tried this node, but it does not trigger the second step at all after triggering a message to the SSE listener trigger node

Can you please tell me if I’m missing some kind of setting in this workflow

I used this js file as sse.dev is down from the last few days

Screenshot of executions

I created a simple SSE server with this code

const http = require('node:http')

let uptime = 0
setInterval(() => { uptime++ }, 1000)

const server = http.createServer((req, res) => {
  console.info('client connected')
  req.socket.setNoDelay(true)
  res.on('close', () => {
    clearInterval(timer)
    console.info('disconnected')
  })

  res.writeHead(200, {
    'Content-Type': 'text/event-stream',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive'
  })
  const timer = setInterval(() => {
    res.write('data: ' + JSON.stringify({ uptime: `${uptime} seconds` }) + '\n\n')
  }, 1000)
})

server.listen(1234, () => {
  console.info('SSE Server running at http://localhost:1234/')
})

and then used http://localhost:1234/ as the url in my workflow, and it seems to work just as expected.
Can you please try running this test server, and see if the node still fails for you?

Apologies I think I have misunderstood how this node trigger because I still don’t see it working. I tried running the script exactly like you have shared with the same js file.

I just see this in the executions:

This is the node after the trigger node and it creates a simple table. It never triggers and does not show up in executions. I added a timeout after 15 seconds which is why we see the error on the bottom right (which means 0 successful executions)

Here’s the setup:

bumping for attention

Still unable to reproduce this.
I ran the SSE server using the code I posted above, and then used your workflow, and got a successful execution immediately.

Are you using n8n via a tunnel?