Hi Team,
I am trying to build the crew and configured with multiple tasks, where the agent should call task basing on the intent of the user input, For example my crew was configured with task plan_status and plan_benefits, when user intent to get the status of the plan then execute only plan_status task and if intent is to get status and benefits execute both tasks and if intent is out of the context then don’t execute any task. Please guide on how to implement this. Thanks
I tried adding an ‘enabled:False’ in the task.yaml file just in case it worked, but it does not work. From the Docs:
’
It’s worth noting that CrewAI doesn’t provide a direct “on/off” switch for tasks. Instead, task execution is controlled through the overall crew configuration, process selection, and agent settings. If you need to temporarily disable a task, you would typically remove it from the tasks list when creating the Crew object or adjust your YAML configuration accordingly.
’
I would just keep three task.yaml files and load the correct one prior to run.
A more advanced way to handle this is to have an agent fetch the data about the user intent and then use Conditional Tasks based on that intent.