Is it possible to start a Flow from an event hook script ? I created an item.create based event, I asked gemini and it tried to explain me it’s possible with the servies object but that seems wrong so I don’t know where it found that. He indicates a services.FlowService; but it doesn’t work.
Is there a solution ? if yes which type of flow should be used for triggering?
Easiest solution would be to trigger a webhook flow by calling the webhook address from the event hook.
If you really need to trigger another flow type, it will get more complicated because as of now FlowManager is not exported by the extension sdk.
It’s doable tho by using dynamic imports. I’m describing exactly this usecase here
In the linked example the flow should have been triggered inside a server.start hook which, allegedly, executes before the flow endpoints are mounted. So there might be edge cases where you want to trigger flows programmatically.
I'd recommend just going through the API :)
– rijkvanzantenIn the linked example the flow should have been triggered inside a server.start hook which, allegedly, executes before the flow endpoints are mounted. So there might be edge cases where you want to trigger flows programmatically.
– Nik