Make Ticket-Creation Actions Safe to Retry After Timeouts
Last updated: November 29, 2026
Quick Overview
An assistant's plugin creates tickets in a customer's ITSM system, and network timeouts sometimes leave it unclear whether the ticket was created. Implement a retry wrapper that never creates duplicate tickets, retries only transient failures with backoff, and returns the same result when the same action is replayed.
Moveworks
November 29, 20260
0
0 solved
An assistant's plugin creates tickets in a customer's ITSM system, and network timeouts sometimes leave it unclear whether the ticket was created. Implement a retry wrapper that never creates duplicate tickets, retries only transient failures with backoff, and returns the same result when the same action is replayed.
Agentic actions have real side effects in systems the platform does not own (ServiceNow incidents, Okta group grants), and a duplicated ticket or double-granted license erodes customer trust fast. The interviewer probes idempotency keys, the difference between retryable and ambiguous failures, and backoff with jitter.
What the Interviewer Expects
- Derives a deterministic idempotency key from tenant, conversation, action and arguments
- Classifies errors into retryable, ambiguous (maybe applied) and fatal
- Reconciles ambiguous failures by looking up a correlation id before retrying
- Uses exponential backoff with jitter and a bounded attempt count
- Caches the final result so replays return it without a second side effect
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- The target system has no field to store a correlation id; what do you do?
- Two pods receive the same replayed message concurrently; how do you prevent both from creating?
- How long should idempotency records live, and what happens when they expire?
- How would you surface a permanently failed action to the employee in chat?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
run(key, create, find_by_correlation) performs create at most once in effect. Retryable errors (429, 503, connection refused before the request was sent) are safe to retry. Ambiguous errors (read ...
High-Level Design
Key = hash of (tenant, conversation, action, canonical args). Pass the key to the target as a correlation id (ServiceNow correlation_id, or a custom field / tag). On an ambiguous error, query by c...