Skip to main content

IPipelineExecutionReporter

Namespace: Meshmakers.Octo.Sdk.Common.Services

Interface for reporting pipeline execution metrics to the communication controller. Implementations should handle the communication with the backend service.

public interface IPipelineExecutionReporter

Methods​

ReportExecutionStartAsync(RtEntityId, Guid, PipelineTriggerType, DateTime, String)​

Reports the start of a pipeline execution.

Task ReportExecutionStartAsync(RtEntityId pipelineRtEntityId, Guid executionId, PipelineTriggerType triggerType, DateTime startedAt, string inputData)

Parameters​

pipelineRtEntityId RtEntityId
The pipeline entity ID

executionId Guid
Unique execution identifier

triggerType PipelineTriggerType
Type of trigger that started the execution

startedAt DateTime
When the execution started (UTC)

inputData String
Optional input data for debugging

Returns​

Task
Task representing the async operation

ReportExecutionEndAsync(Guid, PipelineExecutionStatus, DateTime, Int32, String, String)​

Reports the end of a pipeline execution.

Task ReportExecutionEndAsync(Guid executionId, PipelineExecutionStatus status, DateTime completedAt, int durationMs, string errorMessage, string outputData)

Parameters​

executionId Guid
Unique execution identifier

status PipelineExecutionStatus
Final status of the execution

completedAt DateTime
When the execution completed (UTC)

durationMs Int32
Duration in milliseconds

errorMessage String
Optional error message if failed

outputData String
Optional output data (JSON) from pipeline result

Returns​

Task
Task representing the async operation

ReportPipelineStatusAsync(RtEntityId, String, Boolean, DateTime)​

Reports a pipeline's live status line (AB#5385) — one line per poll from a trigger node, written by the controller to the pipeline entity's StatusMessage.

Task ReportPipelineStatusAsync(RtEntityId pipelineRtEntityId, string message, bool isError, DateTime timestampUtc)

Parameters​

pipelineRtEntityId RtEntityId
The pipeline entity ID

message String
The status line

isError Boolean
True when the line reports a failed poll

timestampUtc DateTime
When the status was produced (UTC)

Returns​

Task
Task representing the async operation

Remarks:

Never throws and must not block the caller on the controller: delivery is fire-and-forget, and a delivery failure (hub not connected, a controller predating the hub method) is logged at Debug, rate-limited so a poll loop does not repeat it every interval.

GetInterruptedExecutionIdsAsync()​

Gets the list of execution IDs that were marked as interrupted when this adapter disconnected. Called after reconnection to determine which executions need their final status reported.

Task<IReadOnlyList<string>> GetInterruptedExecutionIdsAsync()

Returns​

Task<IReadOnlyList<String>>
List of interrupted execution IDs

FailOrphanedExecutionsAsync(DateTime)​

Asks the controller to fail all non-terminal executions of this adapter that started before the given process start time. Called once on a fresh adapter startup to resolve executions orphaned by the previous process (whose in-memory task was lost on restart), so they are not left stuck in Running/Interrupted.

Task<int> FailOrphanedExecutionsAsync(DateTime processStartUtc)

Parameters​

processStartUtc DateTime
The adapter process start time (UTC)

Returns​

Task<Int32>
Number of orphaned executions failed, or 0 if reporting failed

ReportInterruptedExecutionResultAsync(Guid, PipelineExecutionStatus, DateTime, Int32, String, String)​

Reports the final result of an execution that was previously marked as interrupted.

Task ReportInterruptedExecutionResultAsync(Guid executionId, PipelineExecutionStatus status, DateTime completedAt, int durationMs, string errorMessage, string outputData)

Parameters​

executionId Guid
Unique execution identifier

status PipelineExecutionStatus
Final status of the execution

completedAt DateTime
When the execution completed (UTC)

durationMs Int32
Duration in milliseconds

errorMessage String
Optional error message if failed

outputData String
Optional output data (JSON) from pipeline result

Returns​

Task
Task representing the async operation