# Getting Intermediate steps

**URL:** <https://community.crewai.com/t/getting-intermediate-steps/990>\
**Category:** Crews\
**Tags:** agent\
**Created:** [October 24, 2024, 9:04am UTC](https://community.crewai.com/t/getting-intermediate-steps/990 "2024-10-24T09:04:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://community.crewai.com/u/Yash)\
**Post date:** [October 24, 2024, 9:04am UTC](https://community.crewai.com/t/getting-intermediate-steps/990/1 "2024-10-24T09:04:25Z")

</div>

Is there any way in crewai for getting the intermediate steps stored in the result,  
like we do in langchain by setting return\_intermediate\_steps=True param in agent\_executor

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [October 24, 2024, 10:07am UTC](https://community.crewai.com/t/getting-intermediate-steps/990/2 "2024-10-24T10:07:35Z")

</div>

@Yash Yes, using [CrewAI Flows](https://docs.crewai.com/concepts/flows), which has implemented [state](https://docs.crewai.com/concepts/flows#flow-state-management).

See the example from the official CrewAI docs (_Note: It’s an example of structured state management._).

```auto
from crewai.flow.flow import Flow, listen, start
from pydantic import BaseModel

class ExampleState(BaseModel):
    counter: int = 0
    message: str = ""

class StructuredExampleFlow(Flow[ExampleState]):
    @start()
    def first_method(self):
        self.state.message = "Hello from structured flow"

    @listen(first_method)
    def second_method(self):
        self.state.counter += 1
        self.state.message += " - updated"

    @listen(second_method)
    def third_method(self):
        self.state.counter += 1
        self.state.message += " - updated again"

        print(f"State after third_method: {self.state}")

flow = StructuredExampleFlow()
flow.kickoff()

```

---

<div class="post-metadata">

**Author:** ![Yash](https://avatars.discourse-cdn.com/v4/letter/y/f17d59/32.png) [@Yash](https://community.crewai.com/u/Yash)\
**Post date:** [October 24, 2024, 10:32am UTC](https://community.crewai.com/t/getting-intermediate-steps/990/3 "2024-10-24T10:32:25Z")

</div>

@rokbenko i only have one crew and task which i guess do not require the flow,  
let me explain my usecase to you :

I have single agent comparising of multiple tools i want to get the output exact what is returned by the tool but sometimes my final answer is an explaination.

so what i am thinking is too get the intermediate steps in that case
