Cannot access automatically created id in unstructured state

Hi everyone,

I’m using CrewAI with an unstructured state in my flow, and according to the documentation, an "id" field should be automatically created and accessible in self.state when the flow starts.

However, in my code snippet below:

class CustomerSupportFlow(Flow):
    def __init__(self):
        super().__init__()
        load_dotenv()
        self.llm_model = os.getenv("MODEL")
        
    
    @start()
    def receive_ticket(self):
        # Inizializza il ticket
        print(f"Ricezione del ticket... state_id: {self.state["id"]}")
        self.state["ticket"] = Ticket(1, "Mario Rossi", "Problema con l'ordine")
        print(f"Ticket ricevuto: {self.state["ticket"].get_attr()}")

I get a KeyError: 'id' on the line where I try to print self.state["id"]. It seems that "id" is not initialized automatically in the unstructured state, contrary to what the docs say.

Has anyone encountered this? Is there a workaround or a step I might be missing?

Thanks in advance!

Edit:
Same problem with structured state when trying to access state id with self.state.id

Looks all good to me, check it out:

from crewai.flow.flow import Flow, start

class ExampleFlow(Flow):
    @start()
    def first_step(self):
        print("=" * 20)
        print("Starting flow...")
        # Each flow state automatically gets a unique ID:
        print(f"Flow State ID: {self.state['id']}")
        print("=" * 20, end="\n\n")

ExampleFlow().kickoff()