I’m currently working on integrating a custom microservice with an Analytics Builder custom block in Cumulocity, and I would really appreciate some guidance or examples.
What I’m trying to achieve
I have:
A Node.js microservice deployed in Cumulocity (/service/temp-classifier)
A custom Analytics Builder block written in EPL
The goal is: From the custom block, send an HTTP request to the microservice Receive a JSON response Use the response inside the block logic
Microservice (working)
The microservice exposes:
GET /health → returns { "status": "UP" }
POST /classify → accepts:
{ "temperature": 40 }
returns:
{ "category": "Hot" }
Issue
I’m facing multiple issues when integrating from the custom block:
Runtime errors like:
Unexpected termination of monitor
JSON parsing issues in EPL
Difficulty handling async HTTP responses properly
apama-ctrl readiness probe failures (503)
Current EPL approach (simplified)
Request req := cumulocity.createRequest(
"POST",
"/service/temp-classifier/classify",
body
);
req.execute(handleResponse);
My questions
What is the recommended pattern to call a microservice from an Analytics Builder block?
How should I properly handle asynchronous HTTP responses in EPL?
Is there an official or best-practice example for this use case?
Are there known limitations when calling microservices from Analytics Builder blocks?
What I’m looking for
A minimal working example (EPL + microservice call)
Best practices for stability (avoiding monitor crashes)
there is a complete example to do rest requests in the contrib repository:
In general, I would recommend to run the block locally using Pysys tests before deploying to Cumulocity. The project also includes 4 tests for this block:
The SDK documentation explains how to write your own tests: