Calling Microservice Workflows from Functions (like possible from Apps)

Dear all,

this is a question about OD Functions, in particular about using them as “endpoint” for a “Save” action on an editable table in Apps.

I’ve tried solving the following problem: When saving a table from Apps, I actually don’t want to execute 1 Microservice Workflow but multiple. I thought of solving this by - instead of calling a Workflow directly from the App via “saveToMicroservice” - calling a function via “saveToFunction” and then just passing on the received JSON to mutliple Microservice Workflows via the OD API.

My problem is, that I am not quite sure what the correct format for the edited/added/deleted rows is. I’ve analysed what is “going out” of the app via the console and that’s the same for both, “saveToFunction” and “saveToMicroservice”. However, in the function I receive a different JSON format than the one that I’ve observed leaving the app.
I have then actually found a third JSON format when investigating which JSON format a Microservice Workflow expects (

Could someone maybe tell me if I am correct in my assumption that functions and workflows expect different JSON formats from an edited table in an App? And if so, would there be an easy way to convert the format from the Function to a format expected by a Microservice Workflow?

I am not exactly sure, what JSON format is expected by “Save to microservice” workflows, but I guess you could use a usual Workflow, as the function will already have all needed ROW_IDs of edited/deleted rows and using “Save to microservice” twice is unnecesary. Therefore a possible solution would be to form a JSON with all needed data in your function and call a workflow passing this JSON as a WF variable.

1 Like

Thank you, I will try that out! :slight_smile:

@magdalena.murr please avoid using WF variables to get table-like data (like what’s content of a microservice input or CIT) into a workflow. There are other measures to achieve this (and they are used by the Apps backend when triggering saveToMicroservice calls. You can provide the data payload as microservice input tables. Please refer to the microservice API for this.