I am building a script that performs more like a decision tree based on user input, external inputs, and time

instead of writing something like:
if step 0 is A and step 1 and B and it has passed 3 days, DO that (the output A is based on environment reaction sometimes outside of user control)

I also would not like to have ugly chained conditionals
if step 0 == A
if step 1 == A
if step 2 == B
(…)
if step 1 == B

consider we could have 10+ steps

Do you have any suggestion on how to best approach this problem ? I was thinking about maybe exploring Graph Databases in order to be make the code simpler, but I am not sure.
Do anyone know any framework that can make this easier ?