I am getting data from an endpoint comming in a list , assume they are unique id's I try attempt to start a GenServer process for each of them but

Calling GenServer.start_link from the controller means the newly-started processes will be terminated when the controller process terminates. Exactly how important this is depends on how long TransactionSubscriptionHandler processes are expected to live.

I can’t speak to any particular issues with your GenServer (not posted), but there are some issues with the controller:

  • json sends the response so it shouldn’t be called repeatedly. It will give a Plug.Conn.AlreadySentError if it is passed a conn that knows the response has already been sent
  • also, call_hash needs to return the updated conn after using it. This is likely the cause of the unusual error deep in the internals of cowboy_http: the second call to call_hash gets passed a conn which is out-of-sync with the underlying Cowboy machinery

To fix this, you’ll need to decide what getting an error partway through the list of hashes should do - stop and leave the existing processes? Clean up? Keep going? - and then whatever makes that decision can render a JSON response.