Can I use config_db set() in a sequence_item

Hi all ,
I have a situation where the configuration of my environment depends on the packet:
Let’s say in my header I have a field of 3 bits if the value of that field vary from 0 to 5 we will work in REVERTED mode ( the environment should be in REVERTED mode)
and if the said field is from (5 to 7) the environment should be in NORMAL mode.
I am trying to randomize the field of my packet so I was thinking to set a variable “env_mode” in the body phase of my packet then use the get method in the top environment.
However, the environment is only set once and even if we change the header field the configuration of the environment won’t change.
To be honest I was not so eager to use the config_db set method : since the seq_item is a dynamic object I am not sure if it can set things in the config_db.
So my question is it possible to use the config_db set method in the seq_item ? is it possible to change the config of my env from the seq_item ?

In reply to mariam triki:

See Config/ConfiguringSequences | Verification Academy

In reply to dave_59:

In reply to mariam triki:
See Configuring Sequences | UVM Cookbook

Hi Dave.
In the link, you used main_phase() instead of run_phase(), what is your recommendation of sub-task phases or using run_phase() for UVM IEEE ?

Thanks

In reply to VE:

We continue recommending the run_phase() over any of the sub-task phases. In this case it’s irrelevant to the example which is probably why it wasn’t caught.