Skip to content

AI for business · Practical guide

Check what happens when the same request arrives twice.

Prepare a repetition test for a workflow that creates tasks. The output is a specification to review with its implementer, not a production-ready protection mechanism.

By Eric Muriel2 min read
Hands typing on a laptop with code on screen.
Illustrative programming photograph; not a screenshot of the exercise.Photo: cottonbro studio · Pexels · Pexels License

The process at a glance

  1. First input

    S-17 creates a task

  2. Second input

    S-17 identifies the same operation

  3. Expected result

    One task, not two

Original diagram of this guide’s exercise.

01Define when two inputs mean the same operation

Fictional example: request S-17 should create one task. Use its request identifier to recognise that operation. Different requests from the same person are not necessarily duplicates.

Agree on what happens if S-17 arrives again with a different quantity. It might be a correction or a conflict; do not discard the change solely because the identifier matches.

02Separate repeating a call from repeating its effect

MDN defines idempotency through the intended effect staying the same when an identical request is repeated, and notes that POST does not guarantee it. A retry button or HTTP method alone does not resolve duplication across a workflow.

For this example, request that a recognised repetition returns access to the existing task. Implementation must also handle simultaneous inputs; a manual check followed by creation does not establish that behaviour.

Reference [1]: MDN Web Docs

03Rehearse three situations in testing

First, submit S-17 twice and check that only one task exists. Second, simulate task creation followed by a lost response; retrying should locate the earlier result.

Third, deliver two copies simultaneously with the technical team’s help. Check the actual task count, not just success messages. Record what the workflow returns to the sender of the second copy.

04Document conflict investigation

Keep the relationship between input identifier and result, plus the status needed by the operator. Define how differing data under one identifier is handled and when a person intervenes.

If your tool cannot demonstrate safe repetition, limit automatic retries and leave a review procedure. Include these cases whenever the workflow or its destination changes.

Sources and further reading

These references expand on the concepts indicated. The examples and exercises are original editorial material.

  1. [1] MDN Web Docs

    Idempotent ↗

    Effects of repeating an HTTP request.

    Back to the related section
How we use sources, quotes and images

Frequently asked questions

Can a person’s name or email identify the operation?

It may group many legitimate operations by the same person. This exercise needs a reference to the specific request, not only its sender.