Here is the implementation of the Apex logic.
If you'd like, I can grant you access to the box for easier handling.
I have implemented the basic functionality based on the requirements, but of course it is possible to further customize everything even more dynamically.
- Namely, we can add a list of fields to the Field set, which will be used to search for duplicates.
- Add the ability to create tasks for each stage and customize them, but for this you will need to add a field on the task, which will qualify to which stage belongs to the task.
- Add the ability to assign certain people to each task, for the solution will need to determine which field will be unique for the search, so as not to use hardcoded id.
I implemented the logic call from both the trigger and Flow. I also added buttons to call logic without waiting for trigger conditions. I have also used several ways to call this functionality, via Flow, LWC, Aura components.
The process itself is based on task configuration management via Custom Metadata Types. Where we can customize the data.

It is also realized to run the logic through a trigger, and through Flow Trigger.

Buttons are added to call the logic regardless of the trigger condition. In 3 variants - Flow, LWC, Aura - Action Buttons
