Templates API
Manage workflow templates and scenarios.
GET
/api/admin/templatesList all workflow templates
Response:
{
"templates": [
{
"id": "template-1",
"name": "Payment Processing",
"version": "3.0",
"scenario": { ... }
}
],
"count": 1
}POST
/api/admin/templatesCreate new template
Request Body:
{
"name": "My Workflow",
"description": "A new workflow template",
"scenario": { "nodes": [...] },
"referenceDoc": "Optional reference documentation",
"resources": []
}Response:
{
"success": true,
"template": { ... },
"templateId": "generated-id",
"slug": "my-workflow",
"message": "Template "My Workflow" created successfully"
}GET
/api/admin/templates/[templateId]Get specific template by ID
Parameters:
templateId(string)requiredPUT
/api/admin/templates/[templateId]Update an existing template
Parameters:
templateId(string)requiredRequest Body:
{
"name": "Updated Workflow Name",
"scenario": { ... },
"referenceDoc": "Updated documentation"
}DELETE
/api/admin/templates/[templateId]Delete a template
Parameters:
templateId(string)requiredExecutions API
Control workflow execution and retrieve simulation state.
GET
/api/engine/templates/[templateId]/executions/[executionId]/stepExecute workflow steps or seek to a specific step
Parameters:
templateId(string)requiredexecutionId(string)requiredcurrentStep(number | 'end')Response:
{
"success": true,
"step": 6,
"timestamp": 1634567890123,
"queueSize": 4,
"activity": [ ... ],
"allActivities": [ ... ],
"nodeStates": { ... },
"activeNodeIds": ["node-1", "node-2"],
"queueSnapshot": { ... },
"message": "Executed step 6, 4 events remaining"
}GET
/api/engine/templates/[templateId]/executions/[executionId]/nodes/[nodeId]/eventsGet events processed by a specific node
Parameters:
templateId(string)requiredexecutionId(string)requirednodeId(string)requiredstep(number | 'last')GET
/api/engine/templates/[templateId]/executions/[executionId]/sinks/[sinkId]/aggregateGet aggregated data for a sink node
Parameters:
templateId(string)requiredexecutionId(string)requiredsinkId(string)requiredformula(string)Parser API
Configure and run the log parser.
GET
/api/parser/load-sourcesLoad parser configuration and data sources based on manifest.json
Response:
{
"success": true,
"sources": [
{
"id": "source-1",
"name": "Log File A",
"type": "log",
"content": "..."
}
],
"manifest": { ... }
}GET
/api/parser/configsList saved parser configurations
POST
/api/parser/configsSave parser configuration
Request Body:
{
"name": "My Config",
"description": "Parser configuration for X",
"sources": [ ... ],
"groupByField": "correlationId"
}Client SDK
For frontend applications, use the EngineAPIService class in lib/engine-api-service.ts to interact with the API.
Available Methods:
- getTemplate(templateId)
- getExecution(executionId)
- executeStep(templateId, executionId, currentStep)
- getNodeEvents(templateId, executionId, nodeId, step)
- getSinkAggregation(templateId, executionId, sinkId, formula)
- getNodeActivity(templateId, executionId, nodeId, step)
- getTokenLineage(templateId, executionId, correlationId, step)