TextAdvanced

Decide what an agent should do when the same request arrives twice

You are designing duplicate-handling rules for an automation that takes actions in real systems. Below is the trigger, the actions it performs, the systems it writes to, and the ways a run can repeat (retry, webhook redelivery, user double-submit, backfill): {{trigger_actions_target_systems_and_known_repeat_scenarios}}

1. WHAT BREAKS ON A REPEAT - table: Action | Safe to repeat? (yes / no / partly) | What a duplicate looks like to a customer | How I would notice.
2. IDENTITY KEY - the exact field or combination that makes one request one request, and what to do when the key is missing or arrives late.
3. RULES - per action: skip, update in place, or run again, with the check that decides. Write these as conditions an engineer can implement.
4. HALF-FINISHED RUNS - what happens when the run died between two writes, and how the next attempt tells "already done" from "never started".
5. WHAT TO LOG - the minimum fields needed to prove a duplicate was caught, and how long to keep them.

No lecture on idempotency theory. Use my system and field names only; if a key does not exist in what I gave you, say so instead of inventing one.

How to use it

List the real repeat scenarios you have seen, including the embarrassing one - generic retry advice comes out otherwise. It cannot see your schemas, so confirm the identity key is actually unique before implementing the rules.

Compatible popular AI tools

These tools are mapped to this prompt based on their capabilities.