# Dealing with multiple runaway Workflows

**URL:** <https://community.temporal.io/t/dealing-with-multiple-runaway-workflows/5991>\
**Category:** Community Support\
**Tags:** general-impl, timeout, workflow-config\
**Created:** [September 16, 2022, 8:39am UTC](https://community.temporal.io/t/dealing-with-multiple-runaway-workflows/5991 "2022-09-16T08:39:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![llcooll](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@llcooll](https://community.temporal.io/u/llcooll)\
**Post date:** [September 16, 2022, 8:39am UTC](https://community.temporal.io/t/dealing-with-multiple-runaway-workflows/5991/1 "2022-09-16T08:39:14Z")

</div>

I have a Workflow called “processData”. When testing this Workflow, I unintentionally started a large number (100s-1000s) with a very large retry number and no timeout. Because the inputs are bad and the Workflow can’t process them, each run fails, and due to the retry and timeout configuration the Workflow Executions will keep running for a very large amount of time.

This problem leads me to two questions:

1. Is there a way to simultaneously terminate all the Workflow Executions, perhaps with tctl?
2. Can anyone offer guidance on retry and timeout configuration? Would any use cases require an infinite timeout?

---

<div class="post-metadata">

**Author:** ![antonio.perez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/antonio.perez/32/2417_2.png) [@antonio.perez](https://community.temporal.io/u/antonio.perez)\
**Post date:** [September 16, 2022, 2:02pm UTC](https://community.temporal.io/t/dealing-with-multiple-runaway-workflows/5991/3 "2022-09-16T14:02:51Z")

</div>

Hello @llcooll

1. use `tctl batch start` to terminate your running workflows [tctl batch start | Temporal Documentation](https://docs.temporal.io/tctl/batch/start) ie `tctl batch start --query "ExecutionStatus=\"Running\"" --re "reason" --batch_type terminate`. I would recommend you test the query first

`tctl workflow l --query "your query"`

If you have [advance visibility](https://docs.temporal.io/visibility#advanced-visibility) enabled you can run more advanced queries using operators

`tctl workflow l --query "ExecutionStatus=\"Running\" AND WorkflowType=\"GreetingWorkflow\""`

1. You can set [WorkflowRunTimeout](https://docs.temporal.io/application-development/features/#workflow-run-timeout) in your `WorkflowOptions` to limit the duration of your workflow run, after some time including workflow task retries the workflow will fail.
