Get automation trigger(recipe+action) in backend

Is there a way to get the trigger that run the automation? We checked the payload and it contains fields like “recipeId” and “integrationId” which didn’t give any idea of the trigger.

I think using the “recipeId” we can get the custom recipe and get the trigger. But for the custom actions which can be added to any trigger, how to get the trigger in this case?

Thanks for reading

hi @YuvrajSingh

What feature are you referring to? Is it a view or an integration with a (custom) trigger?

Hi @basdebruin,

It’s an integration feature. We first created a custom action then used the created action to create a custom recipe.

Any automation needs a trigger, either a standard built-in trigger or a custom one. Using a built-in trigger monday will post to your action endpoint. When using a custom trigger you need to have a subscribe and an unsubscribe endpoint. Those are called when the integration is added / deleted from a board.

In the subscribe endpoint you create a webhook that points to another endpoint from your app. When the trigger fires this endpoint will be called and you can post to the subscriptionURL (needs to be stored somewhere from your subscribe endpoint).

We are using built-in triggers with custom actions. In this scenario is there a way to get the trigger?

for eg. if the recipe is → When COLUMN changes, copy files from COLUMN1 to COLUMN2.
here → “When COLUMN changes” is a built-in trigger, and “copy files from COLUMN1 to COLUMN2” is a custom action.

So, when a user run this recipe, we want to get the trigger. Is this possible to get it?
Currently getting the below object in payload and there is no details of the trigger.
{
“payload”: {
“blockKind”: “action”,
“inboundFieldValues”: {
“shoes”: “shoe1”,
“listSocks”: "socks_2,
“login”: “abc1234”,
“boo”: true,
“myNumber”: 10
},
“inputFields”: {
“shoes”: “shoe1”,
“listSocks”: “socks_2”,
“login”: “abc1234”,
“boo”: true,
“myNumber”: 10
},
“recipeId”: 629280,
“integrationId”: 398528596
},
“runtimeMetadata”: {
“actionUuid”: “3b0a86dcb5a1d05e8aff1e4791cafde5”,
“triggerUuid”: “bd661564c1d1968d5e56c67051cf7511”
}
}

I don’t fully understand what you mean by “get the trigger”. What do you want to do with it.

When using built-in triggers the payload you get is fixed, you can’t modify which fields you are getting in the payload.

We have an app name Copy Files Pro live on monday marketplace. The app have recipes to copy and rename files which eliminates the effort of manual downloading and then copying or renaming file and then reupload.

We are thinking of storing data like, on which trigger the automation run, the file type, the monday.com account user who run the automation, etc, details. So in future, at the month end, we can give users a detailed report about which trigger they used most, the file type they mainly worked with, the number of files copied/renamed by different users, etc.

So, this is the idea behind getting the trigger. We found out how to get the other details(file type, user id, etc), only the “get the trigger” remains.

I don’t see how to achieve this. You have the recipeId but that can change if users delete / add the recipe to their board. I don’t see how to relate the trigger and the action in code.

You’re right that relying solely on recipeId for linking triggers and actions isn’t robust if users can modify their saved recipes.

I am going to create a support ticket. As soon as I got the way to get the trigger, will update here as well. So it can help others.

Thanks for your help @basdebruin.