How can I use Directus Flows to manipulate certain fields when creating an item, supplement them with data from my Directus, and then return this supplemented data to the application in the response body?
Of course, the same object should also be created in Directus at the same time.
What I tried:
I have an event hook (item.create) triggering my flow and a Transform Payload operation at the end of the chain, looking like that:
Flows are a little tricky and their UX could definitely be improved.
I can’t see @ahmad_quvor script anymore, but basically you want to add the data acquired by previous operations to the original payload that was passed to the flow using a script operation.
I don’t know, what I did wrong. But now it’s working with a blocking Flow returning the data of the last operation and a custom script which transforms the payload