I want my orchestrator function to return an object representing what happened in my workflow, basically some stats about what my workflow has done: users retrieved from an API, users inserted in a database, ...
What I was doing until now was to return these information from my activies functions and aggregating them in my orchestrator before returning them :
return new
{
UserInsterted = myActivity1.InsertedUsersNumber,
UsersRetrievedFromApi = myActivity2.RetrievedUserNumber
};
However I am have now activities that run in parallel (thanks to a Task.WhenAll(myActivity1, myActivity2)
so I can't return a result with a different type.
That's why I was wondering if using a Durable Entity in my code to store everything I want to return at the end in my orchestrator was a good solution.