Is it possible to add a CodeAction
to the declarative .dialog file somehow? Or what is the current way of calling custom code from a trigger action?
There is no way to use code actions with declarative dialogs. You'll have export the runtime and follow these instructions: https://learn.microsoft.com/composer/how-to-add-custom-action