checkExists, create & delete webhookMethods for trigger based nodes (ITriggerFunctions)

Describe the issue/question

I created a node (copy/paste) based on RabbitMQTrigger (n8n/RabbitMQTrigger.node.ts at master · n8n-io/n8n · GitHub).

I would like to extend it with the functionality of creating a RabbitMQ queue when the node starts. I found that webhooks have checkExists, create & delete methods which is exactly what I need. How is it possible to get those methods working also for ITriggerFunctions? Or is there any way to define a method in the node that is executed on workflow activation or deactivation?

Thank you.

Information on your n8n setup

  • n8n version: 0.171.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm

Hey @wspiral, welcome to the community!

Or is there any way to define a method in the node that is executed on workflow activation or deactivation?

Yes, this exists. You can check out some of the other existing trigger nodes, quite a few of them will try registering a webhook when the workflow is activated. For example the Webflow node:

Hello @MutedJam, thank you for your quick response.

Yes, I’ve seen a lot of examples with the webhook implementation but for some reason when I try the exact same thing with the trigger function implementation, it doesn’t work.

sync trigger(this: ITriggerFunctions): Promise<ITriggerResponse> {
}

Hi @wspiral, I am afraid I am not a node builder myself, but perhaps @marcus has an idea?