User created webhook not firing

Description

I created an outgoing integration webhook with the following parameters:
Event Trigger: User Created
Target Room: #general (don’t know why this is not optional)
Post as: a bot username (again, dont know why this is not optional)
Script: enabled
Here’s the script:
class Script {
prepare_outgoing_request({ request }) {
// Modify the request object as needed
request.headers[‘x-webhook-secret’] = ‘YOUR_SECRET’; // Replace with your secret

// Return the modified request
return request;

}

process_outgoing_response({ request, response }) {
return response;
}
}

The webhook is simply not firing. I checked the URL twice, also pinged the URL myself.

Server Setup Information

  • Version of Rocket.Chat Server:
  • Operating System: Ubuntu
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 14.21.2 - x64
  • MongoDB Version: 5.0.15
  • Proxy: nginx
  • Firewalls involved: None

Any additional Information

Couldn’t find anything in logs. The webhook history was also not available (indicating no webhook was fired).

Probably related problem with my newly updated RocketChat 5.4.10, previously outgoing webhooks worked fine. Settings seems unchanged.

Now the request is sent but came empty when i tried with my own endpoint and webhook.site one.

The RocketChat log seems normal, all params exist.

I solved the empty request by changing the body parameter name into “data”. Now i can isolate the problem which is the process_outgoing_response that wouldn’t return anything.

process_outgoing_response({ request, response }) {
		
                return {
				content: {
					"text"			: "Body text",
					"attachments"	: [{
						"title"			: "This is a title",
						"title_link"	: "https://domain.com/",
						"text"			: "Attachment content",
						"thumb_url"		: "https://domain.com/image.png",
						"color"			: "#00000"
					}]
				}
		};
		
	}

I ended up using MongoDB change streams instead. RC’s webhooks don’t work. Neither does the DDP SDK work.