12 May 2026 12:41 PM
Hello Community,
I am working on creating a Dynatrace workflow where I start with sample JSON data and need to convert that JSON into the BizEvents format so it can be ingested into Grail.
Could you please help me with the correct JavaScript structure for this conversion? Here’s the sample JSON I am working with and the code I have so far:
function main() { // Sample JSON data const data = { requestId: "12345", dateTime: "2024-04-22T14:30:00.000Z", totalProxies: 100, proxyList: [ { proxyName: "ddd", environment: "hhh", revision: 1, created: "2024-04-22T14:30:00.000Z", lastModified: "2024-04-22T14:30:00.000Z", basePath: "/basePath", deployState: true, TargetServer: ["Server1", "Server2"], targetEndpoint: ["/Service1", "/Service2"], sharedFlows: ["sgg", "sgg"] } ] }; // Convert each proxy into a BizEvent return data.proxyList.map(proxy => ({ "event.provider": "apigee", "event.type": "apigee.proxy.metadata", "event.category": "inventory", attributes: { bucket: "test-poc", // custom marker requestId: data.requestId, dateTime: data.dateTime, totalProxies: data.totalProxies, proxyName: proxy.proxyName, environment: proxy.environment, revision: proxy.revision, created: proxy.created, lastModified: proxy.lastModified, basePath: proxy.basePath, deployState: proxy.deployState, targetServers: proxy.TargetServer, targetEndpoints: proxy.targetEndpoint, sharedFlows: proxy.sharedFlows } }));}
Is this the correct way to structure BizEvents JSON in a workflow JavaScript step?
Do I need to add or change any mandatory fields for Grail ingestion?
Are there best practices for handling multiple proxies in the array (e.g., batching vs individual events)?
Thanks in advance for your guidance!
12 May 2026 01:29 PM
Hi,
Since you are in Managed... Are workflows available in your environment?
Best regards
12 May 2026 01:31 PM - edited 12 May 2026 01:32 PM
Yes workflows are available in my environment . I am working on staging now
12 May 2026 05:03 PM
Hi,
I was not aware workflows were available in Managed environment... Are you in SaaS?
Best regards
13 May 2026 07:35 AM
It is definitely SaaS. Workflows are SaaS only feature.
13 May 2026 09:01 AM - edited 13 May 2026 09:02 AM
Hi,
I have just moved this thread to "Automations" thread instead of Managed.
Best regards
13 May 2026 08:51 AM
@tmehta3 I'm not sure what issue you are trying to solve. Maybe a different option of raising business events - (in OpenPipeline) may fit your case better. Be aware that workflows have some execution limitations and you may run in throttling issues if your workflow is executed too often.
For an example to raise a bizevent from JavaScript in the platform, see https://developer.dynatrace.com/develop/sdks/client-classic-environment-v2/#businesseventsclient (example included).
As then it comes to the data:
13 May 2026 08:58 AM - edited 13 May 2026 08:59 AM
Hi there,
I've checked this on my own demo environment, I am able to ingest this event via:
/*
* This function will run in the DYNATRACE JavaScript runtime.
* For information visit https://dt-url.net/functions-help
*/
import { businessEventsClient } from '@dynatrace-sdk/client-classic-environment-v2';
export default async function () {
// Sample JSON data
const data = {
requestId: "12345",
dateTime: "2024-04-22T14:30:00.000Z",
totalProxies: 100,
proxyList: [
{
proxyName: "ddd",
environment: "hhh",
revision: 1,
created: "2024-04-22T14:30:00.000Z",
lastModified: "2024-04-22T14:30:00.000Z",
basePath: "/basePath",
deployState: true,
TargetServer: ["Server1", "Server2"],
targetEndpoint: ["/Service1", "/Service2"],
sharedFlows: ["sgg", "sgg"]
}
]}
console.log(data);
// Convert each proxy into a BizEvent
const mapEvent = data.proxyList.map(proxy => ({
"event.provider": "apigee",
"event.type": "apigee.proxy.metadata",
"event.category": "inventory",
"attributes": {
bucket: "test-poc", // custom marker
requestId: data.requestId,
dateTime: data.dateTime,
totalProxies: data.totalProxies,
proxyName: proxy.proxyName,
environment: proxy.environment,
revision: proxy.revision,
created: proxy.created,
lastModified: proxy.lastModified,
basePath: proxy.basePath,
deployState: proxy.deployState,
targetServers: proxy.TargetServer,
targetEndpoints: proxy.targetEndpoint,
sharedFlows: proxy.sharedFlows
}
}));
console.log(mapEvent)
businessEventsClient
.ingest({
body: mapEvent,
type: 'application/json',
})
.then(() => console.log('Event ingested'))
.catch((e) => console.error('Failed to ingest event: ' + e));
}
The event pops up in my environment, could you verify whether you are doing the same steps?
Featured Posts