Back

Trigger a function when functions are deployed

  • 0
  • Functions
Ailton
16 Jan, 2024, 15:23

I am currently in the process of migrating my project to the latest version of Appwrite. In the previous version, I had a function set up to be triggered whenever another function was deployed, utilizing the event "functions..deployments..create". However, in the latest version, it appears that triggering functions from other function events is no longer supported. When attempting to do so, I encounter the following error message: "Invalid events param: Value must be a valid array, and triggering a function on a function event is not allowed." Based on some posts here, I understand that this restriction may be in place to prevent potentially unsafe uses. As an alternative, I considered creating a webhook to trigger the function. However, I'm facing challenges in getting the webhook to function as intended. Could someone provide assistance? Is it accurate that triggering the function using the "functions..deployments..create" event is no longer supported? If so, is using a webhook the recommended approach for achieving this functionality?

TL;DR
Title: Triggering a function when functions are deployed Developers are trying to trigger a function when other functions are deployed in the latest version of Appwrite. However, this functionality is no longer supported in the new version. The error message "Invalid `events` param: Value must be a valid array, and triggering a function on a function event is not allowed" is encountered. Creating a webhook as an alternative solution is suggested, but there are challenges in getting it to work. Solution: Unfortunately, triggering functions from other function events is no longer supported in the latest version of Appwrite. Using a webhook is the recommended approach for
Kenny
16 Jan, 2024, 15:25

Have you tried this?

Ailton
16 Jan, 2024, 15:28

Yes, I am getting this message when doing it:

Kenny
16 Jan, 2024, 15:29

Are you self hosted? If so what version?

Ailton
16 Jan, 2024, 15:31

Yes, I am self hosted. The version I'm using is 1.4.13

Kenny
16 Jan, 2024, 15:35

This should still be supported, I've tested on both cloud and my personal self hosted instance and both work. Are you manually typing in the trigger or are you clicking the buttons in the dialog?

Kenny
16 Jan, 2024, 15:35

When you're updating the functions are you creating a new function in the console or trying to update the old version?

Ailton
16 Jan, 2024, 15:52

I am using the buttons in the dialog. Additionally, I tested it first on my company's Appwrite self host and then installed it locally on my machine, both showed the same behavior.

Ailton
16 Jan, 2024, 15:52

I've created a new function and deployed it using the CLI.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more