ancient-wolf-19325
08/05/2024, 6:45 PM<https://docs.flyte.org/en/latest/deployment/configuration/generated/scheduler_config.html#workflow-active-deadline-config-duration|workflow-active-deadline>. Is there any way to define timeout for individual workflow maybe in LaunchPlan?
# Answer
Yes, you can define timeouts for individual workflows in Flyte using the timeout parameter in the LaunchPlan configuration. This allows you to specify a timeout for a specific workflow, overriding any global settings.
Here's an example of how to set a timeout for an individual workflow using the `LaunchPlan`:
from flytekit import LaunchPlan, workflow
from datetime import timedelta
@workflow
def my_workflow():
# Workflow definition here
pass
# Define a LaunchPlan with a specific timeout
my_workflow_launch_plan = LaunchPlan.create(
name="my_workflow_launch_plan",
workflow=my_workflow,
fixed_inputs={},
default_inputs={},
labels={},
annotations={},
timeout=timedelta(hours=2) # Set the timeout to 2 hours
)
This configuration ensures that the my_workflow will timeout if it runs longer than the specified duration (2 hours in this case).
Would you like more details on this?
Sources:
- Flyte Scheduler Configuration
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1722883505.302769 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.