How stop workflows chain execution

I have an architecture where workflow processes works by chain (finished workflow schedules next workflow). So i want to know how i can stop that chain.
I tried way with searching running processes and terminating by “TerminateWorkflow”, but that method didn’t work. Processes have very short period when they are alive, so searching running processes returns nothing.
Now i am thinking about using redis: i will mark that processes should be stopped and check marker before each scheduling.
Maybe there is a way that will solve my problem only by temporal functionality?

Are you using continue as new to start the next workflow in the chain?
If you are you can terminate the workflow “chain” if you pass only the workflow ID (which is the recommended approach for addressing workflows).

Hi, i am using ExecuteChildWorkflow. I have 5-6 different workflows which can be combinated

My recommendation is to have a predetermined workflow ID for each child workflow chain.
Is there any reason why that’s not possible?

So i want to know how i can stop that chain.

Just to add, you can have a main workflow which invokes first child workflow async (using default parent close policy), this child workflow can invoke subsequent child workflows if needed.
In parent workflow you could wait on a stop signal and just return, meaning you would complete parent wf execution which would terminate all running child executions.
Could also set a workflow run timeout that would timeout main workflow after some time and terminate running children.