Portal Community

Timeout Flow

T

Timer Fires

The server-side timer for this interaction expires. The pipeline attempts to atomically lock the interaction. If a response arrived in the same millisecond (race condition), the response wins — the timeout is discarded.

P

Publish InteractionTimeout

The pipeline publishes an InteractionTimeout message to the callback topic interactions.callback.{interactionId}. The server's PublishAndWaitAsync() Task receives this and throws InteractionTimeoutException.

D

Dismiss Client UI

The pipeline publishes a dismissal signal to interactions.dismiss.{userId}. The client receives this, removes the interaction from the queue, and marks it as "Expired" in the history.

A

Audit Log

The audit hook logs the timeout event with the interactionId, timestamp, and "no response received" outcome. This creates a compliance record even for unanswered interactions.

InteractionTimeout Message

interface InteractionTimeout {
  interactionId: string;
  outcome: 'timeout';
  timedOutAt: string; // ISO 8601
  timeoutMs: number;  // The original timeout setting
}

Handling Timeout on the Server

// C# — handling timeout in a workflow node
public async Task ExecuteAsync(NodeExecutionContext context)
{
    try
    {
        var response = await _interactionPublisher.PublishAndWaitAsync(request);

        // Handle the user's response
        if (response.Outcome == "approved")
        {
            context.SetOutput("decision", "approved");
        }
        else if (response.Outcome == "rejected")
        {
            context.SetOutput("decision", "rejected");
            context.SetOutput("rejectionComment", response.Data?["comment"]);
        }
    }
    catch (InteractionTimeoutException ex)
    {
        // No response received within timeoutMs
        // Route to timeout branch in the workflow
        context.SetOutput("decision", "timeout");
        context.SetOutput("timedOutAt", ex.TimedOutAt.ToString("O"));

        // Optionally escalate — send to a manager, trigger an alert, etc.
        await _escalationService.EscalateAsync(ex.InteractionId);
    }
}

Timeout Strategies

StrategyDescriptionWhen to Use
EscalateOn timeout, send the same interaction to a higher-authority user or roleApproval chains — manager escalation
Auto-approveOn timeout, treat as approved (with audit log note)Non-critical confirmations with SLA pressure
Auto-rejectOn timeout, treat as rejectedSecurity-sensitive approvals — err on the side of caution
Fail the workflowOn timeout, terminate the workflow branch with an errorWhen no response means the process cannot continue
RetryOn timeout, re-publish the same interaction (new interactionId)Reminders — "you missed this, please respond"

Recommended Timeout Values

Interaction TypeRecommended TimeoutRationale
Approval (manager)24–48 hoursManagers may be unavailable for a full business day
Approval (real-time)30–60 minutesUser is online but may step away briefly
Confirmation (user action)5–15 minutesUser initiated the action and is likely present
Form collection30 minutesAllow time to fill in the form without rushing
Picker10–30 minutesSimple selection — should not take long
Notification (acknowledge)7 daysCompliance notifications — user must acknowledge but can do it later
Never Set Infinite Timeouts Do not set timeoutMs to an arbitrarily large value to avoid handling timeouts. This leaves pipeline resources (state store entries, callback subscriptions) open indefinitely. Always set a finite timeout and handle it explicitly.