Microservice Output Processor

Modified on Fri, 15 Oct 2021 at 08:53 AM

Overview

The Microservice Output Processor is used to export data for exposed Workflows that serve as Microservices.


Motivation

In real world applications it is common to have a backend, from which data can be requested and displayed in a certain client. 

The Microservice Output Processor acts as such an endpoint to request data from using an HTTP request.


Input

The processor takes any valid dataset as input.


Configuration

If a workflow, which contains the Microservice Output processor, was not run yet, the configuration menu looks like this:


But if it was already run successfully, the dialog includes options to view the results returned by the processor, similar to the configuration of a Result Table Processor:


Output

The processor has no output node to pass data to other OD processors, but data can be fetched from it using a HTTP request. The response contains the data that is displayed in the "Results" tab of the processor as JSON Object with following format:

"columns": [ 
  {
    "header": "columnName",
    "content" [
       ... rows
    ]
  }
]


Please note that in order to make successful calls to the processor, you need to authenticate your requests. Information on how you can do that can be found here.


Example

In this example we will use the Postman software to send HTTP requests to an example workflow, to retrieve a dataset containing book data from the the Microservice Output Processor.


Workflow

In this workflow, a Data Table Load Processor is used to load the sample dataset. Then it is passed to the Take First Data Processor to extract the first 50 rows of it. In the end the result is returned to our processor of interest.


Input

This is a snippet of the dataset loaded by the workflow:


Configuration

We set the identifier of the Processor to "books".


Fetch data with Postman

Now we use Postman to configure a POST request that fetches the test data.

The URL for the requests to the OD Microservice Processors has the following structure:

https://doc.onedata.de/api/v1/microservice/public/[WorkflowId]

First of all, we need to configure the Authorization.


Next comes the configuration of the request body.


Then we send the request to ONE DATA by clicking "Send" and get following response:


The output name matches the configured identifier. 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article