Cannot pass inputs into Flow when using kickoff_async()

I am packaging a crewai Flow into a FastAPI endpoint that I want to run async.

When doing so, the inputs arguments I am giving in kickoff_async() are not properly passed when the Flow state is initialized.

When I call this endpoint, sentence_count is properly propagated into the EmailFlow State:

@app.post("/process_email")
def process_email(
    uuid: str, 
    sentence_count: int
    ):
    try:
        result = EmailFlow().kickoff(inputs={"sentence_count": sentence_count})

When I call this async endpoint, sentence_count is not propagated into the EmailFlow state:

@app.post("/process_email")
async def process_email(
    uuid: str, 
    sentence_count: int
    ):
    try:
        result = await EmailFlow().kickoff_async(inputs={"sentence_count": sentence_count})

Why are inputs not processed properly in the context of an async call?

I have ran into this problem before with a setup similar to yours. I ended up doing this

class YourFlow(Flow[YourFlowState]):
    def __init__(self):
        .....
        super().__init__()

    def kickoff_async(self, inputs=None):
        if inputs:
            for key, value in inputs.items():
                if hasattr(self.state, key):
                    setattr(self.state, key, value)

        return super().kickoff_async()

This seems to work, try it and let me know how it goes