How to create Node-RED agent

I was trying to access the Node-RED agent, but it’s giving a “Bad Gateway” error. I even created a new agent, but it’s still not opening. Can you tell me what the issue might be and how I can resolve it?

you need to select “Node-RED” under image, when you are creating the agent.

Thanks Allan, that worked quite well. I also wanted to ask one more question:
Can we access a work item through the API?

I don’t want to use pop workitem since it consumes the item. Instead, I want to access the work item using the API to extract the data from it. Basically, I couldn’t find the correct endpoint and key. I even tried from the network tab, but it wasn’t working.

All workitems are inside the workitems collection, you can use one of the client libraries to access the database