Back to Documentation

API Reference

Complete REST API documentation for workflow engine and parser

Templates API

Manage workflow templates and scenarios.

GET/api/admin/templates

List all workflow templates

Response:

{
  "templates": [
    {
      "id": "template-1",
      "name": "Payment Processing",
      "version": "3.0",
      "scenario": { ... }
    }
  ],
  "count": 1
}
POST/api/admin/templates

Create 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)required
PUT/api/admin/templates/[templateId]

Update an existing template

Parameters:

templateId(string)required

Request Body:

{
  "name": "Updated Workflow Name",
  "scenario": { ... },
  "referenceDoc": "Updated documentation"
}
DELETE/api/admin/templates/[templateId]

Delete a template

Parameters:

templateId(string)required

Executions API

Control workflow execution and retrieve simulation state.

GET/api/engine/templates/[templateId]/executions/[executionId]/step

Execute workflow steps or seek to a specific step

Parameters:

templateId(string)required
executionId(string)required
currentStep(number | 'end')
- Target step number or 'end' to run to completion

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]/events

Get events processed by a specific node

Parameters:

templateId(string)required
executionId(string)required
nodeId(string)required
step(number | 'last')
GET/api/engine/templates/[templateId]/executions/[executionId]/sinks/[sinkId]/aggregate

Get aggregated data for a sink node

Parameters:

templateId(string)required
executionId(string)required
sinkId(string)required
formula(string)
- 'latest', 'sum', 'count', etc.

Parser API

Configure and run the log parser.

GET/api/parser/load-sources

Load 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/configs

List saved parser configurations

POST/api/parser/configs

Save 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)