AI Compare Ninja AI Compare Ninja

Compare AI tools. Use prompts and skills.

Language
EN

Make a job or webhook safe to retry

Prompt that protects a job or webhook against double execution with an idempotency key, clear states and retry rules. Paste it into an AI tool of your choice, which then makes retries safe.

Topic
Apps & prototypes
Type
Prompt
Level
Advanced
Time
about 10 min

Results depend on the tool, the model and what you enter.

Result preview

Example: written by our editors, not real AI output.

Risk: the payment provider resends the same event if we do not reply within 10 seconds. Key: provider event ID, unique index in table "processed_events", kept for 30 days States: received → processing → done / failed Repeat while "done": return 200 at once, book nothing Retries: only timeouts and 5xx, at most 5, growing delay with jitter, then to the failed-jobs list Tests: send the event twice; abort after booking; two deliveries at the same time Assumption: the database supports transactions.

Fill in

What you type stays in this browser window. We store and send nothing.

Which process?
What happens if it runs twice?
What do you work with?

Your prompt

This is an instruction for an AI, not the result itself.

Where this prompt works

These AI tools are a good fit for this prompt:

How to use it

  1. Fill in the fields or tap a suggestion. Leave out names, addresses and other personal data.
  2. Copy the finished prompt into an AI tool of your choice.
  3. Before going live, deliberately feed duplicate events and interruptions into a test environment and check that every effect happens exactly once.

Why does this work?

When in doubt, networks and queues deliver twice rather than not at all. A key plus clear states turn "hopefully only once" into a testable "takes effect exactly once".

Tips

  • Store the key in the same transaction as the actual change, otherwise there is a gap between the two.

Also a good fit

You may use our prompts freely, including at work. Please do not republish them as your own collection. We give no warranty for AI results; check them yourself. Terms of use