Where are task succession and order dependencies specified?

Hello Friends,

I’m still catching up with all things CrewAI and have a question:

  • Where are task succession and order dependencies specified?

I recall seeing a depends_on (or similarly named) attribute or argument, but I can’t seem to locate it again. Searching through the GitHub sources draws a blank for me - though I might have simply missed it.

Could someone clarify how this works?

Thank you! :blush:

You can add a depends statement in your task either in the task.yaml file or in the crew.py file when instantiating the tasks.

1 Like

Thank you. Can you mention the attribute name? I remember seeing them, but can’t find them. :woman_shrugging:

in yaml file…

research_task:
  description: >
    Some description

  expected_output: >
    1. Research findings in specified format

reporting_task:
  description: >
    Some description here
  expected_output: >
    A strategic research report
  context: 
    - research_task
1 Like

Do you mean the context: attribute, which is defined as:

  • context: List of Task instances providing task context or input data.

on line 62 of src/crewai/task.py?

I wish the definition were clearer (i.e., more explicit), but it makes sense.

Thank you. :blush:

EDIT: This context: [] ./tasks.yaml attribute is what I was seeking. I improved the topology and descriptions as much as I could, but it wasn’t until I specified this sequential control that I got the results I wanted and expected.